In this patch series, clock scaling and core selection methods are
updated. Current clock scaling and core selection methods are same
for vpu4 and previous versions. Introducing load calculations using
vpp cycles, which indicates the cycles required by video hardware to
process each macroblock. Also adding vsp cycles, cycles require by
stream processor. Clock scaling is now done more precisely using vpp
and vsp cycles. Instance is assigned to core with minimum load, instead
of static assignment.
Changes since v3:
- vsp_cycles and vpp_cyles are now unsigned long.
- Core number counting aligned with VIDC_CORE_ID_.
- Aligned hardware overload handling of scale_clocks_v4 with scale_clocks.
- Added bitrate based clock scaling patch in this patch series.
- Instance state check is now moved from scale_clocks to load_scale_clocks.
Aniket Masule (4):
media: venus: Add codec data table
media: venus: Update clock scaling
media: venus: Update to bitrate based clock scaling
media: venus: Update core selection
drivers/media/platform/qcom/venus/core.c | 13 ++
drivers/media/platform/qcom/venus/core.h | 16 ++
drivers/media/platform/qcom/venus/helpers.c | 213 +++++++++++++++++++++++--
drivers/media/platform/qcom/venus/helpers.h | 3 +-
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 | 6 +-
drivers/media/platform/qcom/venus/venc.c | 6 +-
8 files changed, 250 insertions(+), 13 deletions(-)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
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 <[email protected]>
---
drivers/media/platform/qcom/venus/helpers.c | 31 +++++++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 2c976e4..5726d86 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;
+
+ return max(vpp_freq, vsp_freq);
}
static int scale_clocks_v4(struct venus_inst *inst)
@@ -417,13 +426,27 @@ static int scale_clocks_v4(struct venus_inst *inst)
struct venus_core *core = inst->core;
const struct freq_tbl *table = core->res->freq_tbl;
unsigned int num_rows = core->res->freq_tbl_size;
+ struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx;
struct clk *clk = core->clks[0];
struct device *dev = core->dev;
unsigned int i;
unsigned long freq = 0, freq_core1 = 0, freq_core2 = 0;
+ unsigned long filled_len = 0;
+ struct venus_buffer *buf, *n;
+ struct vb2_buffer *vb;
int ret;
- freq = calculate_vpp_freq(inst);
+ mutex_lock(&inst->lock);
+ v4l2_m2m_for_each_src_buf_safe(m2m_ctx, buf, n) {
+ vb = &buf->vb.vb2_buf;
+ filled_len = max(filled_len, vb2_get_plane_payload(vb, 0));
+ }
+ mutex_unlock(&inst->lock);
+
+ if (inst->session_type == VIDC_SESSION_TYPE_DEC && !filled_len)
+ return 0;
+
+ freq = calculate_inst_freq(inst, filled_len);
if (freq > table[0].freq)
dev_warn(dev, "HW is overloaded, needed: %lu max: %lu\n",
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
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 <[email protected]>
---
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))
+ 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;
+}
+
static u32 load_per_type(struct venus_core *core, u32 session_type)
{
struct venus_inst *inst = NULL;
@@ -505,6 +524,16 @@ static int load_scale_clocks(struct venus_inst *inst)
return scale_clocks(inst);
}
+int set_core_usage(struct venus_inst *inst, u32 usage)
+{
+ const u32 ptype = HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE;
+ struct hfi_videocores_usage_type cu;
+
+ cu.video_core_enable_mask = usage;
+
+ return hfi_session_set_property(inst, ptype, &cu);
+}
+
static void fill_buffer_desc(const struct venus_buffer *buf,
struct hfi_buffer_desc *bd, bool response)
{
@@ -808,19 +837,47 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode)
}
EXPORT_SYMBOL_GPL(venus_helper_set_work_mode);
-int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage)
+int venus_helper_set_core(struct venus_inst *inst)
{
- const u32 ptype = HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE;
- struct hfi_videocores_usage_type cu;
+ struct venus_core *core = inst->core;
+ u32 min_core_id = 0, core1_load = 0, core2_load = 0;
+ unsigned long min_load, max_freq, cur_inst_load;
+ u32 cores_max;
+ int ret;
if (!IS_V4(inst->core))
return 0;
- cu.video_core_enable_mask = usage;
+ core1_load = load_per_core(core, VIDC_CORE_ID_1);
+ core2_load = load_per_core(core, VIDC_CORE_ID_2);
+ min_core_id = core1_load < core2_load ? VIDC_CORE_ID_1 : VIDC_CORE_ID_2;
+ min_load = min(core1_load, core2_load);
+ cores_max = core_num_max(inst);
- return hfi_session_set_property(inst, ptype, &cu);
+ if (cores_max < VIDC_CORE_ID_2) {
+ min_core_id = VIDC_CORE_ID_1;
+ min_load = core1_load;
+ }
+
+ cur_inst_load = load_per_instance(inst) *
+ inst->clk_data.codec_freq_data->vpp_freq;
+ max_freq = core->res->freq_tbl[0].freq;
+
+ if ((cur_inst_load + min_load) > max_freq) {
+ dev_warn(core->dev, "HW is overloaded, needed: %lu max: %lu\n",
+ cur_inst_load, max_freq);
+ return -EINVAL;
+ }
+
+ ret = set_core_usage(inst, min_core_id);
+ if (ret)
+ return ret;
+
+ inst->clk_data.core_id = min_core_id;
+
+ return 0;
}
-EXPORT_SYMBOL_GPL(venus_helper_set_core_usage);
+EXPORT_SYMBOL_GPL(venus_helper_set_core);
int venus_helper_init_codec_freq_data(struct venus_inst *inst)
{
diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h
index 2c13245..1034111 100644
--- a/drivers/media/platform/qcom/venus/helpers.h
+++ b/drivers/media/platform/qcom/venus/helpers.h
@@ -42,7 +42,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst,
u32 buftype);
int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode);
int venus_helper_init_codec_freq_data(struct venus_inst *inst);
-int venus_helper_set_core_usage(struct venus_inst *inst, u32 usage);
+int venus_helper_set_core(struct venus_inst *inst);
int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs,
unsigned int output_bufs,
unsigned int output2_bufs);
diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h
index 34ea503..f3d1018 100644
--- a/drivers/media/platform/qcom/venus/hfi_helper.h
+++ b/drivers/media/platform/qcom/venus/hfi_helper.h
@@ -559,6 +559,7 @@ struct hfi_bitrate {
#define HFI_CAPABILITY_LCU_SIZE 0x14
#define HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS 0x15
#define HFI_CAPABILITY_MBS_PER_SECOND_POWERSAVE 0x16
+#define HFI_CAPABILITY_MAX_VIDEOCORES 0x2B
struct hfi_capability {
u32 capability_type;
diff --git a/drivers/media/platform/qcom/venus/hfi_parser.h b/drivers/media/platform/qcom/venus/hfi_parser.h
index 3e931c7..264e6dd 100644
--- a/drivers/media/platform/qcom/venus/hfi_parser.h
+++ b/drivers/media/platform/qcom/venus/hfi_parser.h
@@ -107,4 +107,9 @@ static inline u32 frate_step(struct venus_inst *inst)
return cap_step(inst, HFI_CAPABILITY_FRAMERATE);
}
+static inline u32 core_num_max(struct venus_inst *inst)
+{
+ return cap_max(inst, HFI_CAPABILITY_MAX_VIDEOCORES);
+}
+
#endif
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index d037f80..620e060 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -551,7 +551,7 @@ static int vdec_output_conf(struct venus_inst *inst)
if (ret)
return ret;
- ret = venus_helper_set_core_usage(inst, VIDC_CORE_ID_1);
+ ret = venus_helper_set_core(inst);
if (ret)
return ret;
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index cdddc82..28e76cc 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -660,7 +660,7 @@ static int venc_set_properties(struct venus_inst *inst)
if (ret)
return ret;
- ret = venus_helper_set_core_usage(inst, VIDC_CORE_ID_2);
+ ret = venus_helper_set_core(inst);
if (ret)
return ret;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Hi,
On 7/2/19 5:46 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 <[email protected]>
> ---
> drivers/media/platform/qcom/venus/helpers.c | 31 +++++++++++++++++++++++++----
> 1 file changed, 27 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 2c976e4..5726d86 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;
> +
> + return max(vpp_freq, vsp_freq);
> }
>
> static int scale_clocks_v4(struct venus_inst *inst)
> @@ -417,13 +426,27 @@ static int scale_clocks_v4(struct venus_inst *inst)
> struct venus_core *core = inst->core;
> const struct freq_tbl *table = core->res->freq_tbl;
> unsigned int num_rows = core->res->freq_tbl_size;
> + struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx;
> struct clk *clk = core->clks[0];
> struct device *dev = core->dev;
> unsigned int i;
> unsigned long freq = 0, freq_core1 = 0, freq_core2 = 0;
> + unsigned long filled_len = 0;
> + struct venus_buffer *buf, *n;
> + struct vb2_buffer *vb;
> int ret;
>
> - freq = calculate_vpp_freq(inst);
> + mutex_lock(&inst->lock);
> + v4l2_m2m_for_each_src_buf_safe(m2m_ctx, buf, n) {
> + vb = &buf->vb.vb2_buf;
> + filled_len = max(filled_len, vb2_get_plane_payload(vb, 0));
> + }
> + mutex_unlock(&inst->lock);
> +
> + if (inst->session_type == VIDC_SESSION_TYPE_DEC && !filled_len)
> + return 0;
> +
> + freq = calculate_inst_freq(inst, filled_len);
>
> if (freq > table[0].freq)
> dev_warn(dev, "HW is overloaded, needed: %lu max: %lu\n",
>
The original patch has a call to load_scale_clocks from
venus_helper_vb2_buf_queue, why it is not included here?
--
regards,
Stan
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 <[email protected]>
> ---
> 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?
> + 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,
Stan
Hi,
On 2019-07-15 21:28, Stanimir Varbanov wrote:
> Hi,
>
> On 7/2/19 5:46 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 <[email protected]>
>> ---
>> drivers/media/platform/qcom/venus/helpers.c | 31
>> +++++++++++++++++++++++++----
>> 1 file changed, 27 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/media/platform/qcom/venus/helpers.c
>> b/drivers/media/platform/qcom/venus/helpers.c
>> index 2c976e4..5726d86 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;
>> +
>> + return max(vpp_freq, vsp_freq);
>> }
>>
>> static int scale_clocks_v4(struct venus_inst *inst)
>> @@ -417,13 +426,27 @@ static int scale_clocks_v4(struct venus_inst
>> *inst)
>> struct venus_core *core = inst->core;
>> const struct freq_tbl *table = core->res->freq_tbl;
>> unsigned int num_rows = core->res->freq_tbl_size;
>> + struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx;
>> struct clk *clk = core->clks[0];
>> struct device *dev = core->dev;
>> unsigned int i;
>> unsigned long freq = 0, freq_core1 = 0, freq_core2 = 0;
>> + unsigned long filled_len = 0;
>> + struct venus_buffer *buf, *n;
>> + struct vb2_buffer *vb;
>> int ret;
>>
>> - freq = calculate_vpp_freq(inst);
>> + mutex_lock(&inst->lock);
>> + v4l2_m2m_for_each_src_buf_safe(m2m_ctx, buf, n) {
>> + vb = &buf->vb.vb2_buf;
>> + filled_len = max(filled_len, vb2_get_plane_payload(vb, 0));
>> + }
>> + mutex_unlock(&inst->lock);
>> +
>> + if (inst->session_type == VIDC_SESSION_TYPE_DEC && !filled_len)
>> + return 0;
>> +
>> + freq = calculate_inst_freq(inst, filled_len);
>>
>> if (freq > table[0].freq)
>> dev_warn(dev, "HW is overloaded, needed: %lu max: %lu\n",
>>
>
> The original patch has a call to load_scale_clocks from
> venus_helper_vb2_buf_queue, why it is not included here?
Yes, I need to include it for before every buffer being queued to the
device
to have accurate precise clock.
Regards,
Aniket
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 <[email protected]>
>> ---
>> 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