From 4812c1460efe97756d71e393c5abbe8481085287 Mon Sep 17 00:00:00 2001 From: Darshana Patil Date: Wed, 26 Jul 2023 16:34:48 -0700 Subject: [PATCH] video: driver: fix DPB buffer release In vp9 splitmode cases, there is a possibility fw reuses DPB buffers and hence does not return these buffers as part of STOP command during port reconfig. In this case, driver should not destroy these DPB buffers. Added a fix for the same. Issue observed with: 1A1622D8_Dec_VP9_Argon_EOS0. Change-Id: I81deded6a49290574ddda8d4f8efdfc0a9f733f3 Signed-off-by: Darshana Patil Signed-off-by: Maheshwar Ajja --- driver/vidc/src/msm_vdec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/driver/vidc/src/msm_vdec.c b/driver/vidc/src/msm_vdec.c index 73753beb45..5ebeafc76f 100644 --- a/driver/vidc/src/msm_vdec.c +++ b/driver/vidc/src/msm_vdec.c @@ -796,6 +796,13 @@ static int msm_vdec_destroy_internal_buffers(struct msm_vidc_inst *inst, } list_for_each_entry_safe(buf, dummy, &buffers->list, list) { + /* + * do not destroy internal buffer (DPB buffer) if firmware + * did not return it, so skip if QUEUED flag is present + */ + if (buf->attr & MSM_VIDC_ATTR_QUEUED) + continue; + i_vpr_h(inst, "%s: destroying internal buffer: type %d idx %d fd %d addr %#llx size %d\n", __func__, buf->type, buf->index, buf->fd,