Skip to content
Permalink
Browse files
venus: guard load_scale
load_scale can only be safely called after
the encoder has been initialized.

Signed-off-by: Fritz Koenig <frkoenig@chromium.org>
  • Loading branch information
Fritz Koenig authored and intel-lab-lkp committed Nov 10, 2020
1 parent 0ab4f90 commit 0f286c3baefce09c2d1845a683814847fed9e45d
Showing 1 changed file with 4 additions and 0 deletions.
@@ -35,6 +35,10 @@ static inline int venus_pm_load_scale(struct venus_inst *inst)
if (!core->pm_ops || !core->pm_ops->load_scale)
return 0;

if (inst->session_type == VIDC_SESSION_TYPE_ENC &&
inst->enc_state == VENUS_ENC_STATE_INIT)
return 0;

return core->pm_ops->load_scale(inst);
}

0 comments on commit 0f286c3

Please sign in to comment.