linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: amasule@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 v6 3/4] media: venus: Update to bitrate based clock scaling
Date: Tue, 27 Aug 2019 10:25:30 +0530	[thread overview]
Message-ID: <932dad4ac3c585080dfb35c7577b4b3f@codeaurora.org> (raw)
In-Reply-To: <cdfde490-8d02-c9a1-5fbd-9ae001692f55@linaro.org>

Hi Stan,

On 2019-07-29 17:08, Stanimir Varbanov wrote:
> Hi,
> 
> On 7/22/19 12:07 PM, Aniket Masule wrote:
>> Introduced clock scaling using bitrate, preavious
>> calculations consider only the cycles per mb.
>> Also, clock scaling is now triggered before every
>> buffer being queued to the device. This helps in
>> deciding precise clock cycles required.
>> 
>> Signed-off-by: Aniket Masule <amasule@codeaurora.org>
>> ---
>>  drivers/media/platform/qcom/venus/helpers.c | 33 
>> +++++++++++++++++++++++++----
>>  1 file changed, 29 insertions(+), 4 deletions(-)
>> 
>> diff --git a/drivers/media/platform/qcom/venus/helpers.c 
>> b/drivers/media/platform/qcom/venus/helpers.c
>> index 2c976e4..edf403d 100644
>> --- a/drivers/media/platform/qcom/venus/helpers.c
>> +++ b/drivers/media/platform/qcom/venus/helpers.c
>> @@ -399,17 +399,26 @@ static int scale_clocks(struct venus_inst *inst)
>>  	return ret;
>>  }
>> 
>> -static unsigned long calculate_vpp_freq(struct venus_inst *inst)
>> +static unsigned long calculate_inst_freq(struct venus_inst *inst,
>> +					 unsigned long filled_len)
>>  {
>> -	unsigned long vpp_freq = 0;
>> +	unsigned long vpp_freq = 0, vsp_freq = 0;
>> +	u64 fps = inst->fps;
>>  	u32 mbs_per_sec;
>> 
>>  	mbs_per_sec = load_per_instance(inst);
>>  	vpp_freq = mbs_per_sec * inst->clk_data.codec_freq_data->vpp_freq;
>>  	/* 21 / 20 is overhead factor */
>>  	vpp_freq += vpp_freq / 20;
>> +	vsp_freq = mbs_per_sec * inst->clk_data.codec_freq_data->vsp_freq;
>> 
>> -	return vpp_freq;
>> +	/* 10 / 7 is overhead factor */
>> +	if (inst->session_type == VIDC_SESSION_TYPE_ENC)
>> +		vsp_freq += (inst->controls.enc.bitrate * 10) / 7;
>> +	else
>> +		vsp_freq += ((fps * filled_len * 8) * 10) / 7;
> 
> load_per_instance() already taken into account fps, thus I think fps
> should be excluded from calculation.
> 
I will correct this, fps is needed for stream processor frequency 
calculations,
also fps is not needed for vpp.
>> +
>> +	return max(vpp_freq, vsp_freq);
>>  }
>> 

Regards,
Aniket

  reply	other threads:[~2019-08-27  4:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  9:07 [PATCH v6 1/4] media: venus: Add codec data table Aniket Masule
2019-07-22  9:07 ` [PATCH v6 2/4] media: venus: Update clock scaling Aniket Masule
2019-07-29  8:35   ` Stanimir Varbanov
2019-08-27  4:51     ` amasule
2019-07-22  9:07 ` [PATCH v6 3/4] media: venus: Update to bitrate based " Aniket Masule
2019-07-29  7:54   ` Stanimir Varbanov
2019-07-29 11:38   ` Stanimir Varbanov
2019-08-27  4:55     ` amasule [this message]
2019-07-22  9:07 ` [PATCH v6 4/4] media: venus: Update core selection Aniket Masule
2019-07-29  9:46   ` Stanimir Varbanov
2019-08-27  5:00     ` amasule

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=932dad4ac3c585080dfb35c7577b4b3f@codeaurora.org \
    --to=amasule@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 \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).