linux-kernel.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 v4 4/4] media: venus: Update core selection
Date: Tue, 16 Jul 2019 10:18:21 +0530	[thread overview]
Message-ID: <ca31e291b14a8c3494d0c49a097452ae@codeaurora.org> (raw)
In-Reply-To: <66c52577-fae8-9b3d-ec1d-886b97897729@linaro.org>

On 2019-07-15 21:30, Stanimir Varbanov wrote:
> Hi,
> 
> On 7/2/19 5:46 PM, Aniket Masule wrote:
>> Present core assignment is static. Introduced load balancing
>> across the cores. Load on earch core is calculated and core
>> with minimum load is assigned to given instance.
>> 
>> Signed-off-by: Aniket Masule <amasule@codeaurora.org>
>> ---
>>  drivers/media/platform/qcom/venus/helpers.c    | 69 
>> +++++++++++++++++++++++---
>>  drivers/media/platform/qcom/venus/helpers.h    |  2 +-
>>  drivers/media/platform/qcom/venus/hfi_helper.h |  1 +
>>  drivers/media/platform/qcom/venus/hfi_parser.h |  5 ++
>>  drivers/media/platform/qcom/venus/vdec.c       |  2 +-
>>  drivers/media/platform/qcom/venus/venc.c       |  2 +-
>>  6 files changed, 72 insertions(+), 9 deletions(-)
>> 
>> diff --git a/drivers/media/platform/qcom/venus/helpers.c 
>> b/drivers/media/platform/qcom/venus/helpers.c
>> index 5726d86..321e9f7 100644
>> --- a/drivers/media/platform/qcom/venus/helpers.c
>> +++ b/drivers/media/platform/qcom/venus/helpers.c
>> @@ -26,6 +26,7 @@
>>  #include "helpers.h"
>>  #include "hfi_helper.h"
>>  #include "hfi_venus_io.h"
>> +#include "hfi_parser.h"
>> 
>>  struct intbuf {
>>  	struct list_head list;
>> @@ -331,6 +332,24 @@ static u32 load_per_instance(struct venus_inst 
>> *inst)
>>  	return mbs * inst->fps;
>>  }
>> 
>> +static u32 load_per_core(struct venus_core *core, u32 core_id)
>> +{
>> +	struct venus_inst *inst = NULL;
>> +	u32 mbs_per_sec = 0, load = 0;
>> +
>> +	mutex_lock(&core->lock);
>> +	list_for_each_entry(inst, &core->instances, list) {
>> +		if (!(inst->clk_data.core_id == core_id))
> 
> 		if (inst->clk_data.core_id != core_id)
> 
> I guess will be more readable?
> 
Yes, I will modify the check.
>> +			continue;
>> +
>> +		mbs_per_sec = load_per_instance(inst);
>> +		load = mbs_per_sec * inst->clk_data.codec_freq_data->vpp_freq;
>> +	}
>> +	mutex_unlock(&core->lock);
>> +
>> +	return load;
>> +}
>> +
> 
> <cut>

Regards,
Aniket

      reply	other threads:[~2019-07-16  4:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 14:46 [PATCH v4 0/4] media: venus: Update clock scaling and core selection Aniket Masule
2019-07-02 14:46 ` [PATCH v4 1/4] media: venus: Add codec data table Aniket Masule
2019-07-02 14:46 ` [PATCH v4 2/4] media: venus: Update clock scaling Aniket Masule
2019-07-02 14:46 ` [PATCH v4 3/4] media: venus: Update to bitrate based " Aniket Masule
2019-07-15 15:58   ` Stanimir Varbanov
2019-07-16  4:46     ` amasule
2019-07-02 14:46 ` [PATCH v4 4/4] media: venus: Update core selection Aniket Masule
2019-07-15 16:00   ` Stanimir Varbanov
2019-07-16  4:48     ` amasule [this message]

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=ca31e291b14a8c3494d0c49a097452ae@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).