From 1fc8b2829c24d295861479f0e979afb8fc644a02 Mon Sep 17 00:00:00 2001 From: Chandrakant I Viraktamath Date: Wed, 10 Jun 2020 10:26:51 +0530 Subject: [PATCH] msm: vidc: Fix mbpf calculation for active session Fix macro block per frame calculation by not considering sessions which have state greater than or equal to MSM_VIDC_STOP_DONE. Change-Id: Ie25e52e946386fcf226b0f9c073c1b022cf1ac0c Signed-off-by: Chandrakant I Viraktamath --- msm/vidc/msm_vidc_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index 3bab57959bb5..d1e8cdf99715 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -5768,8 +5768,9 @@ static int msm_vidc_check_mbpf_supported(struct msm_vidc_inst *inst) mutex_lock(&core->lock); list_for_each_entry(temp, &core->instances, list) { - /* ignore invalid session */ - if (temp->state == MSM_VIDC_CORE_INVALID) + /* ignore invalid and completed session */ + if (temp->state == MSM_VIDC_CORE_INVALID || + temp->state >= MSM_VIDC_STOP_DONE) continue; /* ignore thumbnail session */ if (is_thumbnail_session(temp))