LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: dikshita@codeaurora.org
To: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org
Subject: Re: [PATCH v4 6/7] media: venus: helpers: update NUM_MBS macro calculation
Date: Mon, 04 Oct 2021 13:07:22 +0530	[thread overview]
Message-ID: <5acab57bd6c1088dd1beff1df0ba71d1@codeaurora.org> (raw)
In-Reply-To: <283e23db-5383-57d7-48ca-0efa03420335@linaro.org>

Hi Stan,

On 2021-10-02 03:01, Stanimir Varbanov wrote:
> Hi,
> 
> On 8/10/21 12:47 PM, Dikshita Agarwal wrote:
>> Consider alignment while calculating NUM_MBS.
>> 
>> Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
>> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
>> ---
>>  drivers/media/platform/qcom/venus/helpers.c | 13 +++++++------
>>  1 file changed, 7 insertions(+), 6 deletions(-)
>> 
>> diff --git a/drivers/media/platform/qcom/venus/helpers.c 
>> b/drivers/media/platform/qcom/venus/helpers.c
>> index 60a2775..2db33ba 100644
>> --- a/drivers/media/platform/qcom/venus/helpers.c
>> +++ b/drivers/media/platform/qcom/venus/helpers.c
>> @@ -18,8 +18,8 @@
>>  #include "hfi_platform.h"
>>  #include "hfi_parser.h"
>> 
>> -#define NUM_MBS_720P	(((1280 + 15) >> 4) * ((720 + 15) >> 4))
>> -#define NUM_MBS_4K	(((4096 + 15) >> 4) * ((2304 + 15) >> 4))
>> +#define NUM_MBS_720P	(((ALIGN(1280, 16)) >> 4) * ((ALIGN(736, 16)) >> 
>> 4))
>> +#define NUM_MBS_4K	(((ALIGN(4096, 16)) >> 4) * ((ALIGN(2304, 16)) >> 
>> 4))
>> 
>>  struct intbuf {
>>  	struct list_head list;
>> @@ -1098,16 +1098,17 @@ static u32 venus_helper_get_work_mode(struct 
>> venus_inst *inst)
>>  	u32 num_mbs;
>> 
>>  	mode = VIDC_WORK_MODE_2;
>> +
>>  	if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
>> -		num_mbs = (ALIGN(inst->height, 16) * ALIGN(inst->width, 16)) / 256;
>> +		num_mbs = ((ALIGN(inst->height, 16))/16 * (ALIGN(inst->width, 
>> 16)))/16;
> 
> Could you help me understand what is the difference between both
> calculations? IMO this patch should only change NUM_MBS_720P and
> NUM_MBS_4K macros.
> 
We are updating the calculation here to match with the calculation used 
in Macro.
AFAIK, we were seeing a size mismatch for a resolution with the old 
calculation.

>>  		if (inst->hfi_codec == HFI_VIDEO_CODEC_MPEG2 ||
>> -		    inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE ||
>> -		    num_mbs <= NUM_MBS_720P)
>> +			inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE ||
>> +			num_mbs <= NUM_MBS_720P)
> 
> This change just makes indentation wrong and also it is not related to
> the patch subject.
I think it can be dropped.
> 
>>  			mode = VIDC_WORK_MODE_1;
>>  	} else {
>>  		num_mbs = (ALIGN(inst->out_height, 16) * ALIGN(inst->out_width, 
>> 16)) / 256;
>>  		if (inst->hfi_codec == HFI_VIDEO_CODEC_VP8 &&
>> -		    num_mbs <= NUM_MBS_4K)
>> +			num_mbs <= NUM_MBS_4K)
> 
> ditto
Same here.
> 
>>  			mode = VIDC_WORK_MODE_1;
>>  	}
>> 
>> 

  reply	other threads:[~2021-10-04  7:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  9:47 [PATCH v4 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
2021-08-10  9:47 ` [PATCH v4 1/7] venus: firmware: enable no tz fw loading for sc7280 Dikshita Agarwal
2021-08-10  9:47 ` [PATCH v4 2/7] media: venus: core: Add sc7280 DT compatible and resource data Dikshita Agarwal
2021-08-12 19:17   ` Stephen Boyd
2021-08-10  9:47 ` [PATCH v4 3/7] media: venus: Add num_vpp_pipes to resource structure Dikshita Agarwal
2021-08-10  9:47 ` [PATCH v4 4/7] media: venus: hfi: Skip AON register programming for V6 1pipe Dikshita Agarwal
2021-08-10  9:47 ` [PATCH v4 5/7] venus: vdec: set work route to fw Dikshita Agarwal
2021-08-12 19:20   ` Stephen Boyd
2021-08-10  9:47 ` [PATCH v4 6/7] media: venus: helpers: update NUM_MBS macro calculation Dikshita Agarwal
2021-10-01 21:31   ` Stanimir Varbanov
2021-10-04  7:37     ` dikshita [this message]
2021-08-10  9:47 ` [PATCH v4 7/7] media: venus: Set buffer to FW based on FW min count requirement Dikshita Agarwal
2021-08-30  7:28 ` [PATCH v4 0/7] media: venus: Enable venus support on sc7280 dikshita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5acab57bd6c1088dd1beff1df0ba71d1@codeaurora.org \
    --to=dikshita@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vgarodia@codeaurora.org \
    --subject='Re: [PATCH v4 6/7] media: venus: helpers: update NUM_MBS macro calculation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).