aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMansur Alisha Shaik <[email protected]>2020-05-01 08:28:00 +0200
committerMauro Carvalho Chehab <[email protected]>2020-07-04 12:25:55 +0200
commite0eb34810113dbbf1ace57440cf48d514312a373 (patch)
treefdabdd9af8ff98800a501773df5d35750cebdac7
parent3b4cfc6966ecaefdf46a1369923a55e7bdc86d19 (diff)
media: venus: fix multiple encoder crash
Currently we are considering the instances which are available in core->inst list for load calculation in min_loaded_core() function, but this is incorrect because by the time we call decide_core() for second instance, the third instance not filled yet codec_freq_data pointer. Solve this by considering the instances whose session has started. Cc: [email protected] # v5.7+ Fixes: 4ebf969375bc ("media: venus: introduce core selection") Tested-by: Douglas Anderson <[email protected]> Signed-off-by: Mansur Alisha Shaik <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/platform/qcom/venus/pm_helpers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index abf93158857b..531e7a41658f 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -496,6 +496,10 @@ min_loaded_core(struct venus_inst *inst, u32 *min_coreid, u32 *min_load)
list_for_each_entry(inst_pos, &core->instances, list) {
if (inst_pos == inst)
continue;
+
+ if (inst_pos->state != INST_START)
+ continue;
+
vpp_freq = inst_pos->clk_data.codec_freq_data->vpp_freq;
coreid = inst_pos->clk_data.core_id;