Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2548217rwd; Mon, 22 May 2023 00:01:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kZnwkbGOxBcwO089plgvVt5emMp9q2pu2dMKvgF6yb8PxYIDrLafkk8x7zOkGzS648Scj X-Received: by 2002:a05:6a20:4306:b0:104:1428:8d36 with SMTP id h6-20020a056a20430600b0010414288d36mr10008670pzk.35.1684738886800; Mon, 22 May 2023 00:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684738886; cv=none; d=google.com; s=arc-20160816; b=UxGSV3oCiIFqWdnX3YtbAfn6fn2wmyEx3yyDWpUbwXPKbRvpyHgnT8Oi4VJeEy9+XW fWkoZogQnFroKigab1YnvOqN8raMUiRAXFuWPAmkuE6vvuENXjnd0GFLrRi2eT22b/2C fZVHB/C3um/Uabu2iUkPS/lnGas4FK9gdliqCiCvdL2d/aLFCfZWi1BczNandEAILONp VQGywWWgbes5+g9EmbnRlTegh034NYt5RelP/IUTMOuaW19mMJu3v62nJ8whx5fAknJg VGGf8nfkBX/1uW+F1kkA3IBbz9gOy460Jye2TnIAbCqSQ1dXLiQzMcv6VJ9XtF0E/o16 Bibg== 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=laguvSuvD4TNDIsQCj7PU68pDJD0i4k1RzP7nL7SgP4=; b=fv9WwUOW3pvKx96nw5e/uL/S76+9XEyJdss6/jxTZicZ7I3KPue9R94IMClmL+79rW FvLstYfaLtxRGMobhShfXzVakcsmm2LFtlUiF0rV6yPfbRs9ZLLMv+g8u44Bw2Mx/+BL LHOIudRO0c0n9ftPcSl76XtcRUzyCwsqXt/rZ7Yv0EjcBoueYIXZ7s3GvZ0EmaKpsE6m PBBY/+nMXssCXXqEMiTEELOUkkNTUZPMsScuGrk3WKFAOXdrs7t3tcQZTwY4peaIBH/g UeU3LSIn+P2siWpvCpL4UHmB9GQehfyU1T2hZfqkKIIdOwEVnqxV/b8q8ZAea0rdDVoh esnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=dneuuB6P; 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 i190-20020a6387c7000000b0053b8f80c631si1742344pge.195.2023.05.22.00.01.10; Mon, 22 May 2023 00:01:26 -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=dneuuB6P; 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 S232130AbjEVGxN (ORCPT + 99 others); Mon, 22 May 2023 02:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232125AbjEVGwc (ORCPT ); Mon, 22 May 2023 02:52:32 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E1D2690; Sun, 21 May 2023 23:50:13 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34M6hYHO024392; Mon, 22 May 2023 06:48:31 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=laguvSuvD4TNDIsQCj7PU68pDJD0i4k1RzP7nL7SgP4=; b=dneuuB6P8B8l3ayyo71yTGRr/lB3hNtVLq/pnc5W2g9CgLOAcrd53jwkfyLZnLuWTHJo 3RLQu0FCl/H5r113/U1QGXtiu7NdN9escmPCru0xYwcGSUfxx/b9Mhi0fyDcU5riOD9N mf+FURxt4F7rhc4pEuA/6olbPthm33ZLCTGQswh2CxHgokxJxvjwUTUb+vQPsc60Z4ox ti5/fSRZjG/rvtGugU8BWyeQiGo/LfvWqNlrw90PraeGYDFmvmbfcSmepZt2Wydk7HZ6 h5uz4NZHEFzOYue2mZNUsmcOn+LCjpzAINBe5dWNM0gZhejFPaEUQXudSj9p6tAvuqSy ng== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qpnt62vss-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 22 May 2023 06:48:30 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 34M6mRaD009797; Mon, 22 May 2023 06:48:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3qpq9kej0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 22 May 2023 06:48:27 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 34M6mR83009791; Mon, 22 May 2023 06:48:27 GMT Received: from hu-sgudaval-hyd.qualcomm.com (hu-dikshita-hyd.qualcomm.com [10.213.110.13]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 34M6mRQp009786; Mon, 22 May 2023 06:48:27 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id 702473F7E; Mon, 22 May 2023 12:18:26 +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 v2 3/4] venus: add handling of bit depth change from firmwar Date: Mon, 22 May 2023 12:18:17 +0530 Message-Id: <1684738098-17372-4-git-send-email-quic_dikshita@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1684738098-17372-1-git-send-email-quic_dikshita@quicinc.com> References: <1684738098-17372-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: EXevUrK1-Dyspudgh59ot-LvkJGeWQKB X-Proofpoint-GUID: EXevUrK1-Dyspudgh59ot-LvkJGeWQKB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-22_04,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 priorityscore=1501 clxscore=1011 mlxlogscore=744 adultscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305220057 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 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 Set opb format to TP10_UWC and dpb to client set format when bit depth change to 10 bit is detecting by firmware. Acked-by: Konrad Dybcio Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/helpers.c | 16 ++++++++++++++++ drivers/media/platform/qcom/venus/vdec.c | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 7dbaa38..b543b65 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -1770,6 +1770,22 @@ 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 7aeaf77..96eceda 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -736,6 +736,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) { @@ -783,7 +786,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; -- 2.7.4