Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp616927rwr; Fri, 5 May 2023 02:16:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7pWB632OuqJUECqhjA1EonAQUmt80GEFd5H4x6BH2vEC53Id2TfeLtTk46XBYgameqHona X-Received: by 2002:a05:6a20:3d91:b0:f2:e20a:c8f4 with SMTP id s17-20020a056a203d9100b000f2e20ac8f4mr1016606pzi.31.1683278213146; Fri, 05 May 2023 02:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683278213; cv=none; d=google.com; s=arc-20160816; b=C8Kkot+u07LaFG2mhYZzgazTRbHdimHKiNEfnO43UD506JBEgM/2f30LWiFOrJh9uw eVoEk+JFNU60cJd4dvM9m6m6kZtBpUDVSC1/LQ+K51U4T4Y6t3bMqaO8aFLnpmvoaOEI MnGCk8SIWJmjKTIAad04s1OYSxFAKODqvpgWVneH7AM2dFiQ8HXyjfSdmHhLGQDb2yy9 CmlLpAcurn6c+TC1A846++7et1YNl1ocV0TBRqqqS0T1kWMLXEaQSLA9jyOFeNvSTta8 M7AfTIogxi5h1JgbPgceEhn8+lemzdPhTXzTsBYqKsq8KGpFpnOBn4raHdPd+4A7K0vI sHRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=74mGx6giKbWdRN8nfSAqZDCC8vlmrxk/WzeQd3WiVco=; b=RKueIvJA8GAUxFaaUPAsPf3PXrT3nlRF1BVNzR9DKBJ4GWfq3ahs7p8fueOGCQfaee 7HvmO/LZn+DiSISeR7XnCF1L/+n5LGEeKrIEAGmKPJsVF/gMHYhdpVs1Qz5YlJW84b+2 KZOdMMN5PVFRGVfhsNXRzg8vdmYLdgpvVV3oy+iXC/dNJ41m66TfgiIC2+f7C58fsUWy RPtTP1QRK4R54vtcYdIF8rE3M1eFX3d6GBFNZ05R7lKUBsBrXycXE/zEESUV6hmNj+c2 1Tx40SV4gNAtJmc9T9GDJ2DOsHU63OxhmkBYKwqwy/g35oy9tSHmPHN/1xrMFsYURMsU wCrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=iCqmLfUB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a625405000000b00637745fdf99si1537471pfb.370.2023.05.05.02.16.39; Fri, 05 May 2023 02:16:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=iCqmLfUB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231256AbjEEJDn (ORCPT + 99 others); Fri, 5 May 2023 05:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbjEEJDk (ORCPT ); Fri, 5 May 2023 05:03:40 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3185218860; Fri, 5 May 2023 02:03:39 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3457inYD020612; Fri, 5 May 2023 09:03:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=74mGx6giKbWdRN8nfSAqZDCC8vlmrxk/WzeQd3WiVco=; b=iCqmLfUBqWMyfXuU/cIlTTOW8Qe2SEc14o9uXxgme7eHtRZRBqTVP3St1ZgHtlR6Shkt MWlhk+/mBHTNTJZI22Nt/KeKHuPdoUYiqnbPmwyHJcVPOZeo8apFdyOnwowRvHBn1lN+ Wgz1RCjQHCiIVbwnkzBDP1EVtiynFq1Wps6eBH1kX0Z2Q3xFV13T5oV5isi5RR+iOHk/ vMsnB8ZuHEL3O3aRVx31LS8/oVEpmdx8ypIgsHz4umPyvEVVA8KknpGfd7Cto9aPkLgT t1WSyTe5WHhkGrR3DzdPOz6LwCqU6r4z2wIXi3iWyENfb3kvIC8TgzeFI5a3GSUIatyT bw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qcmm393p4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 May 2023 09:03:34 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34593XTU018315 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 5 May 2023 09:03:33 GMT Received: from [10.50.39.163] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Fri, 5 May 2023 02:03:30 -0700 Message-ID: Date: Fri, 5 May 2023 14:33:20 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH 4/4] venus: return P010 as preferred format for 10 bit decode To: Konrad Dybcio , , , , , , CC: , References: <1683196599-3730-1-git-send-email-quic_dikshita@quicinc.com> <1683196599-3730-5-git-send-email-quic_dikshita@quicinc.com> <02f5d449-a64b-8f5e-6b72-2fdf8d9bafbe@linaro.org> Content-Language: en-US From: Dikshita Agarwal In-Reply-To: <02f5d449-a64b-8f5e-6b72-2fdf8d9bafbe@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: x5EAaqSF3P65jWAk0qpoxT0PiX3AGHPR X-Proofpoint-GUID: x5EAaqSF3P65jWAk0qpoxT0PiX3AGHPR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-05_15,2023-05-04_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 impostorscore=0 adultscore=0 malwarescore=0 suspectscore=0 phishscore=0 clxscore=1015 bulkscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305050074 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/4/2023 10:50 PM, Konrad Dybcio wrote: > > On 4.05.2023 12:36, Dikshita Agarwal wrote: >> If bit depth is detected as 10 bit by firmware, return >> P010 as preferred decoder format to the client. >> >> Signed-off-by: Dikshita Agarwal >> --- >> drivers/media/platform/qcom/venus/vdec.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c >> index 69f7f6e..ed11dc2 100644 >> --- a/drivers/media/platform/qcom/venus/vdec.c >> +++ b/drivers/media/platform/qcom/venus/vdec.c >> @@ -1468,8 +1468,13 @@ static void vdec_event_change(struct venus_inst *inst, >> inst->out_width = ev_data->width; >> inst->out_height = ev_data->height; >> >> - if (inst->bit_depth != ev_data->bit_depth) >> + if (inst->bit_depth != ev_data->bit_depth) { >> inst->bit_depth = ev_data->bit_depth; >> + if (inst->bit_depth == VIDC_BITDEPTH_10) >> + inst->fmt_cap = &vdec_formats[3]; >> + else >> + inst->fmt_cap = &vdec_formats[0]; > This doesn't scale and is very error-prone, please enumerate the > entries and assign it using the enumerator, like: > > enum { > VDEC_FORMAT_FOO, > ... > }; > > ... vdec_formats[] = { > [VDEC_FORMAT_FOO] = { foo, bar, baz } > } > > Konrad I agree, this can be improved but I would prefer making that change as separate patch. As this is not only related to HDR 10 decoding, there are other places in the code which will require similar change. Thanks, Dikshita >> + } >> >> if (inst->pic_struct != ev_data->pic_struct) >> inst->pic_struct = ev_data->pic_struct;