From patchwork Thu May 4 10:36:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 90039 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp210416vqo; Thu, 4 May 2023 03:45:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DC1Xv02fzMP4PKVW0XAbmm9CbhAuLo/ZqTwW3ldrVuPHDPBfyyi3Z2mRitzWEJptqN/D3 X-Received: by 2002:a17:902:da8a:b0:1aa:e739:4092 with SMTP id j10-20020a170902da8a00b001aae7394092mr4036900plx.52.1683197129562; Thu, 04 May 2023 03:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683197129; cv=none; d=google.com; s=arc-20160816; b=wleXv/FLmapDf5CVSJnQCjooGMaSM8KomRqY9lVv8t0XZ/86CohBuX956WznnPD6Pf vmQ9vEsP4FzW8ZU4YGY0PejgFEk7SN9mu+nkdzdQASlM280PyeMGmtWjNeVmGS1G2wa0 Jgh1hsfFJKL6opeWLL2k6qyu4zJOFTAABxJ0p25qvdGKk8+v4EgwF0iyfjI3HVGUtPZ9 xE44tmbG1MvL0Demj1crWaFdrnI+iU6dPLQYK2lN5d2G14GYRVCnP1//yArNfC8tMgJw tas7G+O1QQXiVjvkXkUONKk5lbCjL/XSl8JqoQVV+qk0Gnh4IMRGmVURtvNhoWhAZOE3 fIFw== 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=FcjjehFCYBKX3QBMmrHVYG5sIIbJ2DYag9lElXm9IGU=; b=QFyUOSOo7Kf+aQzTMpKwATQJEaIV4dQfiU5cxZ1etSOddZuVG5mjQINIzR/0jeX+qD Uc6T2l6CDStsCvIwIIVRZs26pNU3YxH5LXHLMbvoPLi+NsbREYqyGauepJcMyQCQ6g5k AbYtE2z2aEoNl0W+PcEqir2zaf/2aiRPwPXco7CFEynDKZYdRkJrsqzK98eZECHe+Xhd ipYPzHU1Tve25SgSAxCvxt4M86myALlt32wMPk5dbC7vLdiS0ffFWXYGyQbTZZXz9MEi mwffosK1oj/EdOJbQYuobIuNfX1UmWh87HRjPdqMrmH5lzm06f5qzyo31nz1AhJWJBFg nSZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="G8Aw/J89"; 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 p14-20020a170902a40e00b001a1abc91952si5885189plq.194.2023.05.04.03.45.08; Thu, 04 May 2023 03:45:29 -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="G8Aw/J89"; 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 S230162AbjEDKhF (ORCPT + 99 others); Thu, 4 May 2023 06:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbjEDKgu (ORCPT ); Thu, 4 May 2023 06:36:50 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2200846A1; Thu, 4 May 2023 03:36:50 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3447lgi9012994; Thu, 4 May 2023 10:36:46 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=FcjjehFCYBKX3QBMmrHVYG5sIIbJ2DYag9lElXm9IGU=; b=G8Aw/J89WF1iGGLOVae1Q5tIg+2TkSPB+2vg3Zb3gQp2f+GWa+y6UKV8qJ7lf9C17/XN 4Xj/jCZSf3q3XKQsNJ9VDgTIagbi3dm8V5YtAwbUVSpV4BOBDmEEDkvFJ9R8wjsfWyzh 9w+xjAGxL3XUbl2IyVBzHzzBom1y1TsaAk5NgZ1sTOhmqwBATZ7HuBeLs/XnORqD7HOD VkxGam92985z45dsMFudZ4vg/Jh8bee5DMO9WCR+wZIGM3Tztq1jHKnpbD2gPOrFLwWD joHDYpVo8hfSQEcsGXI0TZ4157lEtfB2xrXxDKm7PawcLxv9NbR95J77NRkP+y2aS3gU mA== 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 3qc8kw8b6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 10:36:45 +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 344AYaeE000446; Thu, 4 May 2023 10:36:42 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3q8vakt1qc-1; Thu, 04 May 2023 10:36:42 +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 344Aaggg002438; Thu, 4 May 2023 10:36:42 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 344AagpG002435; Thu, 04 May 2023 10:36:42 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id 92E8437B0; Thu, 4 May 2023 16:06:41 +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 1/4] venus: add support for V4L2_PIX_FMT_P010 color format Date: Thu, 4 May 2023 16:06:36 +0530 Message-Id: <1683196599-3730-2-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-GUID: 4aLmHT6MiY8caX3h-l6S-uV_AIuTlFqe X-Proofpoint-ORIG-GUID: 4aLmHT6MiY8caX3h-l6S-uV_AIuTlFqe 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 priorityscore=1501 lowpriorityscore=0 mlxlogscore=958 malwarescore=0 phishscore=0 adultscore=0 clxscore=1015 spamscore=0 impostorscore=0 bulkscore=0 mlxscore=0 suspectscore=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?1764960113014018979?= X-GMAIL-MSGID: =?utf-8?q?1764960113014018979?= add V4L2_PIX_FMT_P010 as supported color format for decoder. Signed-off-by: Dikshita Agarwal Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index ab6a29f..5946def 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -612,6 +612,8 @@ static u32 to_hfi_raw_fmt(u32 v4l2_fmt) return HFI_COLOR_FORMAT_NV12_UBWC; case V4L2_PIX_FMT_QC10C: return HFI_COLOR_FORMAT_YUV420_TP10_UBWC; + case V4L2_PIX_FMT_P010: + return HFI_COLOR_FORMAT_P010; default: break; } diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 4ceaba3..687d62e 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -43,6 +43,10 @@ static const struct venus_format vdec_formats[] = { .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, }, { + .pixfmt = V4L2_PIX_FMT_P010, + .num_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + }, { .pixfmt = V4L2_PIX_FMT_MPEG4, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, From patchwork Thu May 4 10:36:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 90042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp217583vqo; Thu, 4 May 2023 03:59:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Y7n8BAZCHnMFzex3WqCdBt6wCnUEsETmQCnjJTqex6cgaZtd3BZP6rzH1leXsNzwa2lI0 X-Received: by 2002:a05:6a00:1a0a:b0:63b:64f7:45a0 with SMTP id g10-20020a056a001a0a00b0063b64f745a0mr1973991pfv.12.1683197988959; Thu, 04 May 2023 03:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683197988; cv=none; d=google.com; s=arc-20160816; b=DbD5PCcbQhAx05ynsmoXRm7oHFBsyedXrR2uPBTLRL0jDFkVcvY8Eeb8NaHwjNCfwU il0Hdcxzwl1A6Sy1gNFQkYLKZ1HBeFnp4C5ifj95oKZlgoBq5EdFoRzAbHV42+ui65S7 gh2ubbs5TX1TPARU3thdZUhtDXw3T2WPq/P5tUEH0kJauUQqWKiz+D93reho0WGhqay+ NIM9U5BrQg9wVDFVk/kq8ZE9lgRXX3t+nQgjm6e3LAflU7pV8kdJVZ53z71QbS02dZu4 tEfzahnQnl0FsSQKwc2DXlxnsjLfWCoM5UajSiDMVioFDDK8Sy7ukY62Xh1AIF5v/WjR V8Rw== 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=n8Nqq5knuYs0m9wUvtQ0ByXIx5S1MpqjK4cnS+3hfwY=; b=Y3SyjjCIoma3sZCd8lR2UZUN1xcstRmMHXRrwAC9X291Ha+bd3b2jnzbUSJpjK0Ezv 425vQM6N5KudpWfLkXeO4assvl10NJlDnwu1LxVBfeQE+d6GsR3Na/uI1v+bLvmVQFB5 +md5WLVOBi9cBhnOgoyURLkBJEJqsOnW8n3aCHvRnJZn0Y94euqE1hSI8wHNeyA0Idbp ksEk141XRn2GGpm6H3JwAXFI95EPNO8Tfl5HjZNmqj+5DfDiX9w2T9Soqvy2bgyycHi1 1JY5rkXox3fH5+X5dy6BCLbdr6Zca/NdLtdR4l0/AFgS5szEfDj/5m4rlRfgw2IcgO5Q dmdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DxW05hqV; 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 g30-20020aa79dde000000b0063af5d600cfsi34931357pfq.302.2023.05.04.03.59.36; Thu, 04 May 2023 03:59:48 -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=DxW05hqV; 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 S229886AbjEDKhS (ORCPT + 99 others); Thu, 4 May 2023 06:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbjEDKhC (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 0122349E3; Thu, 4 May 2023 03:36:50 -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 344AMrWp004012; Thu, 4 May 2023 10:36:46 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=n8Nqq5knuYs0m9wUvtQ0ByXIx5S1MpqjK4cnS+3hfwY=; b=DxW05hqVBA9dHcOhxOSPJlQl/cJdylBk+iYHcOmmBnq8I41MbNQ+caDt2EJtRPu2Y0AA WQdBaIwX04YYD7+PO4MequMThZswUK+yPf1NyNjoXJ7i8Pm0wNRvtRg7M6kwpMcHQ8q1 S0+SY1x2fHMvmLwHjKNY+Pbz/mV6RsJDaepvuKyVTcCSZn4zbLJX75mNzpVwA4mUJl+J UVST8svdO4cn0FOwDW7JsYqjMox40NbE1JlZMrLZ40tAQW+zofONoidy1Y/M8mQ5/Qbp aiM25cQFTb9N5AZOZBfkOecmw3MkWgr4UWGeCNSp40BU6tbxtlmaREb+jidyx+VZa7yZ Cw== 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 3qca1j857w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 10:36:46 +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 344AahtL002473; Thu, 4 May 2023 10:36:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3q8vakt1qh-1; Thu, 04 May 2023 10:36:43 +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 344Aahcb002456; Thu, 4 May 2023 10:36:43 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 344Aagn6002451; Thu, 04 May 2023 10:36:43 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id 3AA09BE0; Thu, 4 May 2023 16:06:42 +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 2/4] venus: update calculation for dpb buffers Date: Thu, 4 May 2023 16:06:37 +0530 Message-Id: <1683196599-3730-3-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: qLvi9VwSO-0SDgYs5mrwGj--lkBtXrFx X-Proofpoint-GUID: qLvi9VwSO-0SDgYs5mrwGj--lkBtXrFx 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=619 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?1764961014584026975?= X-GMAIL-MSGID: =?utf-8?q?1764961014584026975?= Use dpb color format, width and height of output port for calculating buffer size of dpb buffers. Signed-off-by: Dikshita Agarwal Acked-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/helpers.c | 4 ++++ drivers/media/platform/qcom/venus/hfi_plat_bufs.h | 3 +++ drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 5946def..4ad6232 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -641,12 +641,16 @@ static int platform_get_bufreq(struct venus_inst *inst, u32 buftype, if (is_dec) { params.width = inst->width; params.height = inst->height; + params.out_width = inst->out_width; + params.out_height = inst->out_height; params.codec = inst->fmt_out->pixfmt; params.hfi_color_fmt = to_hfi_raw_fmt(inst->fmt_cap->pixfmt); params.dec.max_mbs_per_frame = mbs_per_frame_max(inst); params.dec.buffer_size_limit = 0; params.dec.is_secondary_output = inst->opb_buftype == HFI_BUFFER_OUTPUT2; + if (params.dec.is_secondary_output) + params.hfi_dpb_color_fmt = inst->dpb_fmt; params.dec.is_interlaced = inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE; } else { diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs.h b/drivers/media/platform/qcom/venus/hfi_plat_bufs.h index 52a51a3..25e6074 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs.h +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs.h @@ -12,8 +12,11 @@ struct hfi_plat_buffers_params { u32 width; u32 height; + u32 out_width; + u32 out_height; u32 codec; u32 hfi_color_fmt; + u32 hfi_dpb_color_fmt; enum hfi_version version; u32 num_vpp_pipes; union { diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c index ea25c45..3855b04 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1185,6 +1185,7 @@ static int bufreq_dec(struct hfi_plat_buffers_params *params, u32 buftype, enum hfi_version version = params->version; u32 codec = params->codec; u32 width = params->width, height = params->height, out_min_count; + u32 out_width = params->out_width, out_height = params->out_height; struct dec_bufsize_ops *dec_ops; bool is_secondary_output = params->dec.is_secondary_output; bool is_interlaced = params->dec.is_interlaced; @@ -1235,7 +1236,12 @@ static int bufreq_dec(struct hfi_plat_buffers_params *params, u32 buftype, bufreq->count_min = out_min_count; bufreq->size = venus_helper_get_framesz_raw(params->hfi_color_fmt, - width, height); + out_width, out_height); + if (buftype == HFI_BUFFER_OUTPUT && + params->dec.is_secondary_output) + bufreq->size = + venus_helper_get_framesz_raw(params->hfi_dpb_color_fmt, + out_width, out_height); } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH(version)) { bufreq->size = dec_ops->scratch(width, height, is_interlaced); } else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH_1(version)) { 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; From patchwork Thu May 4 10:36:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 90043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp217589vqo; Thu, 4 May 2023 03:59:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7NbiPrALIYLfVc0N+plm5GkVIMn8M8V5BoYVqXlCimWOYiJcyI+Z1YI9I4cCSZ9FybByi3 X-Received: by 2002:a17:903:120f:b0:1ab:1dbe:20ca with SMTP id l15-20020a170903120f00b001ab1dbe20camr4127944plh.56.1683197989423; Thu, 04 May 2023 03:59:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683197989; cv=none; d=google.com; s=arc-20160816; b=yGbPoL7RSDyqxM/ElmNTUTCH/DNG+dKEdmTzaSt/QA6hKTzjad9cpicCkwDZA+mcre qL9MYZJaBLkMvVJRUy/bdX5i5FYuVGD7vi52dCgv+2HTyGC576FqH+P+s3xLTmjyIwlK eTTWlOfI7U+W7/Gh0SeCBUOZC/3dzuw/F5MYtz8bR5oNYCXTG1vzQgso+ENbm4mQRNMO IA1K5/rPehx1TGn9mxc5Yb15TnkVhazDAXgJ0G6iCUs+owqaWtWViS6ChRWshCHn0RqL RRCb0ChxYtZCJ1SdXC7L66BjLv+FNsP2PqXkTDSJ0/M2ZRpHuiGhvXm8kjCRgZPbn1+z kJgA== 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=hyqZ3bFPRWDVwsGQ+XyTjSaOGixECGiQQNufB++Q97Q=; b=nb9XtVwvNKO+jmJApYORQ5lwe7pSJHZvhxKFjtQ7CrGizwU1V33H4L3HJXLpOSh8fR f7vbsYbZm/5pBBJ9v6UYatv/wIMI+9LLahx071ubELzU+yOJBx8A7U71kQn3HG+9s5Ag okjOmcz/VXqKs+oZZ0jozhUAEJ79XD/WQ1PiC+ufWST9aaSKqinNcJbxNUhmrqkHQArQ F1Gh2rAutrix9BygMK117ljBxp4FoD5Iutiss/V9Q9x2jr2/kfamyrHFU7F2vY0ZuEc1 Pp1K4qvH5lagIJH3QNGLn8nbupnXRTH2+/S6M+aBGoN27VD0I4/3hMr0jeOqDylN7par hVzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=N0GLEdul; 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 u22-20020a1709026e1600b001a95b85b09esi29275281plk.578.2023.05.04.03.59.36; Thu, 04 May 2023 03:59:49 -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=N0GLEdul; 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 S230270AbjEDKhP (ORCPT + 99 others); Thu, 4 May 2023 06:37:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbjEDKhC (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 AB13E4C2F; Thu, 4 May 2023 03:36:51 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 344AWqj5016251; 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=hyqZ3bFPRWDVwsGQ+XyTjSaOGixECGiQQNufB++Q97Q=; b=N0GLEdulIjIFkHWRxw3Jj0TcEo0xXRn4bXfnJaR3pXbXGSv49f4nwFiImgWmn/VmU/3e DmxqXPn79HXFB64Bkor/jbO+cKaAZcLgictNA5Ly/IuUHkjGN/fuxApgTsFb196OFPi1 YEw5AboD+un32gYQhc4j8dJFjEVZ+K7DdvTrNVFKF2SsIa+zqGyTFGxFfcgBY4x7UTKo e7J9ztzn11g6eMrR+tOHNPS8c+c5u+1XrOwQ7uKm1lXSPyvHLcQBVKcCtrLLivFlo98e sRHL2rhviPdgHyFdqlnXE68GLKY/a9U/ePXn841Xr8zjbPEeynK2kO61JJ0AyJ8mq450 JQ== 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 3qcb24807m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 10:36:48 +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 344AXAAu030568; Thu, 4 May 2023 10:36:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3q8vakt1qs-1; Thu, 04 May 2023 10:36:45 +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 344Aafcf002428; Thu, 4 May 2023 10:36:45 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 344AaibS002849; Thu, 04 May 2023 10:36:45 +0000 Received: by hu-sgudaval-hyd.qualcomm.com (Postfix, from userid 347544) id 3E7C137B0; Thu, 4 May 2023 16:06:44 +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 4/4] venus: return P010 as preferred format for 10 bit decode Date: Thu, 4 May 2023 16:06:39 +0530 Message-Id: <1683196599-3730-5-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-GUID: ajyrKPY4Ap9upicX4s8bZDgxu9gF7Xlw X-Proofpoint-ORIG-GUID: ajyrKPY4Ap9upicX4s8bZDgxu9gF7Xlw 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-03_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=884 phishscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 adultscore=0 suspectscore=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?1764961015345217690?= X-GMAIL-MSGID: =?utf-8?q?1764961015345217690?= 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]; + } if (inst->pic_struct != ev_data->pic_struct) inst->pic_struct = ev_data->pic_struct;