Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp899131rwr; Thu, 4 May 2023 11:03:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69XzFI3XvCkAYFgKw16cXbiXnqf89AzRJSpmzrFh8UR/ZEOdV8StMR7MlXuIQiqKUeMWZ+ X-Received: by 2002:a17:90a:7e10:b0:24d:f77c:71e7 with SMTP id i16-20020a17090a7e1000b0024df77c71e7mr2742689pjl.41.1683223402317; Thu, 04 May 2023 11:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683223402; cv=none; d=google.com; s=arc-20160816; b=tvwbrHz6BEdj2lA21HA9PQ1mpgwLCdprsDZSM+qJAQBhMo9j2dDo6+GiUw6DTq37Ox fSgGFdonCZj8d4lbgi85IFXKt10nmH4RFcEXxNK+ws70RSZ3u31mR6FvCKLTz3dzyzJr S6EGV82wZGrUXTO1Ti/2GhV56U6MaWy21btsTpLMrxTTco+VyZ2wJzcexS2Dsd5h7DKT m82/awsfxG7bEojl+3oLyTgQ4bYuMj3GApTZrH1kcd3MlpYd9qLo1PqYUsxt4ErlyC/F lDLgi5GbjDjJEby4fdRUt6f+BSJTg2mimew53SBjfo3rPgfQX45e2lK2/nHtlgz7OCQY 2ung== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7rqx2oaS2krP8hJ8s1gObuqMtMm/34roOVXO517vfLI=; b=PDX/O1xoh4qRqpnyBYulz1HKbPXCc5Q8WFO4aU+/JE40TWkWq9tgeyFxvzFNfRdp/E WrM3U/YAD0kEQvWtFDWQ9ESf9oOVxTca6f4MHG14sq6Mz90OSoGGLNBpf++Q7Skiip5w IEcLRqYTgSv+5l+1a2vyO9mMU+/BVWioRbKnUTTwTgJQXYZ39yIXlmqkrh0NqxXxl26I ehB/erzPYxSb85V2EVaw82daiuF84KglR+2KllsyJE7Y8Mf9iHSUpMzQNhMW1PZbD/4M rWlTneTOIVHlAjvWrmohxq9EvCZ+uj0hgfcBGEeyG82+ofVoYrjY2tPez5YInHMvQi5B tOCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Md78zS/H"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j190-20020a6380c7000000b0052c637acde1si16987pgd.235.2023.05.04.11.03.01; Thu, 04 May 2023 11:03:22 -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=@linaro.org header.s=google header.b="Md78zS/H"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjEDR3o (ORCPT + 99 others); Thu, 4 May 2023 13:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbjEDR3n (ORCPT ); Thu, 4 May 2023 13:29:43 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94E3C4ED7 for ; Thu, 4 May 2023 10:29:41 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4eff4ea8e39so916344e87.1 for ; Thu, 04 May 2023 10:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683221380; x=1685813380; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7rqx2oaS2krP8hJ8s1gObuqMtMm/34roOVXO517vfLI=; b=Md78zS/H9nDi4/5TGuN1rrSIYirmon/lnfYwDTygH4+2pCycoSP6NK3jcUDncU+Jrd y13kGRsJ1YWLDPFyiKUSqXWOeLjKpkHSZUMNWdS8Qdg2GSRn8NITQdMr8SfOFwm1JcFF 4gKBsBaxMlDsy2b7ShEEVScbBW9arecty7gvYrAE/QUpvmh4AkatVf8S3pxnRqBXHZT3 ONOLcutZQHPp/X/pxImmSZvAmozE92GUnzHU/Z8/RBVoeQ9F8QyuqQIFOeexU12KOoZ8 xnjoEkOk/AwjEn0AtpmOSCBooXT6FAuh9+A745R+ept329yqKSBsxTZMzP8GJoKh+Hzg 3v7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683221380; x=1685813380; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7rqx2oaS2krP8hJ8s1gObuqMtMm/34roOVXO517vfLI=; b=k7nOaFEiDtuVgx2V9dgDNMS8XnB9Zh9fDymgUnyXrLDChdCnP6bjPbtNQqVA1hj+Y6 BdTonvFYUb+ptlRDdA4Wqx6MyII+g4g12rwvljzwlTp92W5rD6ry36O6DwANn9nKOrp9 xSUh+N8jqijC+KCWkDcaCCvr3BVxeymOg9+7gCDIZ+eUdFHYyswzn6OLsm+WiSnZBGBg SCb8eXmd1jLj7eLntqJ08wu1wo1Hk2t/ALp7oEIcSnY+YbguCw7NVnnlrn5aIBzUBsn2 qd4HMepY6FH1etu8oGz+En6FBv02jQ9snIzcmelgAIHDQHru1wLRAdtC6Jmo53HEWiv2 LTeA== X-Gm-Message-State: AC+VfDzdXQZahXxDIpvpH4ub8f0wdeE3IKjOD2O1Qqt6Ot1G2/tkvsrP PoY+6H/YamwbDFB2+KtLSf+Z504FiuQat0k1S4E= X-Received: by 2002:a19:ee03:0:b0:4ea:fa26:2378 with SMTP id g3-20020a19ee03000000b004eafa262378mr1922417lfb.23.1683221379830; Thu, 04 May 2023 10:29:39 -0700 (PDT) Received: from [192.168.1.101] (abyl248.neoplus.adsl.tpnet.pl. [83.9.31.248]) by smtp.gmail.com with ESMTPSA id c8-20020ac24148000000b004edc20b8929sm6588853lfi.69.2023.05.04.10.29.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 May 2023 10:29:39 -0700 (PDT) Message-ID: Date: Thu, 4 May 2023 19:29:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH 2/4] venus: update calculation for dpb buffers Content-Language: en-US To: Dikshita Agarwal , linux-media@vger.kernel.org, stanimir.k.varbanov@gmail.com, quic_vgarodia@quicinc.com, agross@kernel.org, andersson@kernel.org, mchehab@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <1683196599-3730-1-git-send-email-quic_dikshita@quicinc.com> <1683196599-3730-3-git-send-email-quic_dikshita@quicinc.com> From: Konrad Dybcio In-Reply-To: <1683196599-3730-3-git-send-email-quic_dikshita@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 4.05.2023 12:36, Dikshita Agarwal wrote: > Use dpb color format, width and height of output port > for calculating buffer size of dpb buffers. > > Signed-off-by: Dikshita Agarwal > --- Looks sane but I'm not exactly an expert on this Acked-by: Konrad Dybcio Konrad > 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)) {