Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp324050rwr; Thu, 4 May 2023 03:47:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6t+xJ2jDwKffXCzVngxNccx16PmNsCQnTRzlLWEMtZe5TqMmHBMc1WrN8LOL2CBzENz7+j X-Received: by 2002:a17:902:d2c9:b0:1aa:f091:4823 with SMTP id n9-20020a170902d2c900b001aaf0914823mr3836762plc.11.1683197263111; Thu, 04 May 2023 03:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683197263; cv=none; d=google.com; s=arc-20160816; b=r2F81C3WjBD3/yXH64bHZLhwZ6pmiy9AY3ncam4ArwVbeE5a3NaFGLx0sgxk4RNr6s ltGHm8N8DDrQyZlMyajCXldLaxUMhJSysKU5qGcV356leWv8kDzb0Ufvpr7HL3qWf3UI nyeHvUSsVmRdwB+CclM0LOiyCbx6R1qI5Q6uqSCGiJ0OiMxjCZ7qZ6PCkBy9x6baEe/i QrSfNIsRdIQ+QDtJ/sSmZnNP00xn618DBPzNcTvsJW9bEpEyITmPryoDkHtICfMM5zwa 3h/VUYZSao2gocoMvtUGi+J3zfyYxobWMU5zKEm6pPzkjN9oKraY+G+Zf63m07X0nJgg XilQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a170902e84e00b001ab1279d418si5740625plg.474.2023.05.04.03.47.29; Thu, 04 May 2023 03:47:43 -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 S229873AbjEDKhR (ORCPT + 99 others); Thu, 4 May 2023 06:37:17 -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 Use dpb color format, width and height of output port for calculating buffer size of dpb buffers. Signed-off-by: Dikshita Agarwal --- 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)) { -- 2.7.4