Re: [PATCH v3 3/4] media: venus: Add interface for load per core

From: Stanimir Varbanov
Date: Mon Jul 01 2019 - 09:55:08 EST


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@xxxxxxxxxxxxxx>
> ---
> 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