lkml.org 
[lkml]   [2019]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 3/4] media: venus: Add interface for load per core
From
Date
Hi Aniket,

On 6/25/19 7:27 PM, Aniket Masule wrote:
> Add and interface to calculate load per core. Also,
> add an interface to get maximum cores available with
> video. This interface is preparation for updating core
> selection.
>
> Signed-off-by: Aniket Masule <amasule@codeaurora.org>
> ---
> drivers/media/platform/qcom/venus/helpers.c | 19 +++++++++++++++++++
> drivers/media/platform/qcom/venus/hfi_helper.h | 1 +
> drivers/media/platform/qcom/venus/hfi_parser.h | 5 +++++
> 3 files changed, 25 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index e1a0247..b79e83a 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))
> + 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;
> +}
> +

Please squash this patch with the next one where load_per_core() is used
to avoid compiler warnings.

--
regards,
Stan

\
 
 \ /
  Last update: 2019-07-01 15:56    [W:0.101 / U:2.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site