From patchwork Thu May 4 10:36:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 90044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp218680vqo; Thu, 4 May 2023 04:01:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/I16TRPXjgJd9Ka5hDtpXS6E+qD5v8qWPetOnMJQZU8+X9UxzQBk8QZp8ipqA2e3fV3p3 X-Received: by 2002:a17:902:b618:b0:1a9:aebc:d4ff with SMTP id b24-20020a170902b61800b001a9aebcd4ffmr2587773pls.39.1683198074640; Thu, 04 May 2023 04:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683198074; cv=none; d=google.com; s=arc-20160816; b=mHPIK2iXPk3AmGIFQ3JyCcoz0kynZ5nDiwNAaQsl3UPSSwX3Uo7XHkDEBdgYetLtZA cMbrzTablDOgC1zP0iuTVdukC8d9Ver0jx8dz2nQW40SShLFa/776AJ7U6dBNsZJii8i iIr+j9OFJZNVxoWLGrd9z2pM5GAjBgUyyGZnWVXrt/JRl3Aocm7goKbYuYdCFxiaYkFc /fgtSSVCdRJf7hvq2TXy6T62fPZgqVgT7yaSbxYVrHRyJ5oT3OmFmdPrlPvmXESCkqCS 5pB2AkCBlZTPahwbiADrYvofuuCizIUovfNhSHCja2Vl7uWMzRWKYD9gLCiZRimPz/z5 Ktag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=ja4McYpDweECEhW5T3LlcCCcrzFhUN/KK5TCWSffgjw=; b=tyh8Gm6I1WbE3CYBB7U4AnuJ/36gVUSNzFzdk08DUoRpxD4srYRgfNMdK1VsOuXZcj jx0jYYY1Po+JaIVFmJZfZmu/3Fgh1KjbSORnJMYKu1yuPgiqG8i+8yEP0dgp0SvvdAtT q6xrMmLkWspFespPoDnIdqT3lbckM3xPy9w68cRulmFoP4PXQKh1GEqNbwwRbWmb1N2i EaUk2i4tAD7rDuekypVXlWmPsg5ruRw00ey2Cxjt98EIYlNlU3fm3kActe4WfPrMpkPv c/UJYjnBfantaU21Mpqs+Haq533a/hy/oXESHM/bjAqtlmi5JarGlMG87Q32UO6N0bqB /PTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AJEaLA2U; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a170902e5c200b001a989e412bbsi26046756plf.514.2023.05.04.04.00.59; Thu, 04 May 2023 04:01:14 -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=AJEaLA2U; 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 S229932AbjEDKhM (ORCPT + 99 others); Thu, 4 May 2023 06:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbjEDKhC (ORCPT ); Thu, 4 May 2023 06:37:02 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68FE14C2D; Thu, 4 May 2023 03:36:51 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3449OHD1029873; Thu, 4 May 2023 10:36:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=ja4McYpDweECEhW5T3LlcCCcrzFhUN/KK5TCWSffgjw=; b=AJEaLA2UhqWMqJPh6ZLMca2axR47j7iuIrXwRmYCTLIAnN1+nZG6oJFp+iVyQt5WcgPR qGUXWNgrbJMT5WMjYIvuY828qB3p2zfX6PaOEYvuAIakHgX3m+ARAAetNCE6UexqYMuw Z81cZSAYfdXIAhO8yuGJWZOLW+2BlIdQjxvSehooaVNFSvJtmxwETXlMffsr3Yteyy20 uLdBhmU6gP/GLUXVqWzhu+q7fRKOHtvo8gwoXD2JjUN2OY1GsfkN11u83AXoCR4sHxf0 XNHzOynET4LhHA5ooV7GdpkexYSatZTX49+94mnAJcGKBEWLRZPqRn02mJXn1iAznW+L NA== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qca1j857y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 10:36:47 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 344AagOH002434; Thu, 4 May 2023 10:36:44 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3q8vakt1qp-1; Thu, 04 May 2023 10:36:44 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 344AaicV002725; Thu, 4 May 2023 10:36:44 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-dikshita-hyd.qualcomm.com [10.213.110.13]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 344Aai72002627; Thu, 04 May 2023 10:36:44 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id 7222FBE0; Thu, 4 May 2023 16:06:43 +0530 (+0530) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.k.varbanov@gmail.com, quic_vgarodia@quicinc.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Dikshita Agarwal Subject: [PATCH 3/4] venus: add handling of bit depth change from firmwar Date: Thu, 4 May 2023 16:06:38 +0530 Message-Id: <1683196599-3730-4-git-send-email-quic_dikshita@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1683196599-3730-1-git-send-email-quic_dikshita@quicinc.com> References: <1683196599-3730-1-git-send-email-quic_dikshita@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: rmHEtJl6IkFsp2ROxw3Y99nEZkBXlAL6 X-Proofpoint-GUID: rmHEtJl6IkFsp2ROxw3Y99nEZkBXlAL6 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-04_06,2023-05-04_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 phishscore=0 mlxlogscore=735 spamscore=0 suspectscore=0 impostorscore=0 clxscore=1015 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305040086 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764961104085294747?= X-GMAIL-MSGID: =?utf-8?q?1764961104085294747?= Set opb format to TP10_UWC and dpb to client set format when bit depth change to 10 bit is detecting by firmware. Signed-off-by: Dikshita Agarwal Acked-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/helpers.c | 18 ++++++++++++++++++ drivers/media/platform/qcom/venus/vdec.c | 5 ++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 4ad6232..4f48ebd 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -1770,6 +1770,24 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 v4l2_fmt, if (!caps) return -EINVAL; + if (inst->bit_depth == VIDC_BITDEPTH_10 && + inst->session_type == VIDC_SESSION_TYPE_DEC) { + found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT, + HFI_COLOR_FORMAT_YUV420_TP10_UBWC); + found = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT2, + fmt); + if (found_ubwc && found) { + /* + * Hard-code DPB buffers to be 10bit UBWC + * until V4L2 is able to expose compressed/tiled + * formats to applications. + */ + *out_fmt = HFI_COLOR_FORMAT_YUV420_TP10_UBWC; + *out2_fmt = fmt; + return 0; + } + } + if (ubwc) { ubwc_fmt = fmt | HFI_COLOR_FORMAT_UBWC_BASE; found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT, diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 687d62e..69f7f6e 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -701,6 +701,9 @@ static int vdec_set_work_route(struct venus_inst *inst) } #define is_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_UBWC_BASE)) +#define is_10bit_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_10_BIT_BASE & \ + HFI_COLOR_FORMAT_UBWC_BASE)) + static int vdec_output_conf(struct venus_inst *inst) { @@ -748,7 +751,7 @@ static int vdec_output_conf(struct venus_inst *inst) inst->opb_fmt = out2_fmt; inst->dpb_buftype = HFI_BUFFER_OUTPUT; inst->dpb_fmt = out_fmt; - } else if (is_ubwc_fmt(out2_fmt)) { + } else if (is_ubwc_fmt(out2_fmt) || is_10bit_ubwc_fmt(out_fmt)) { inst->opb_buftype = HFI_BUFFER_OUTPUT; inst->opb_fmt = out_fmt; inst->dpb_buftype = HFI_BUFFER_OUTPUT2;