From 6c943a05840c3ffc309345944a74f8f5d14c3ee1 Mon Sep 17 00:00:00 2001 From: Amit Shekhar Date: Wed, 22 May 2019 16:09:58 -0700 Subject: [PATCH] msm: vidc: Reject read only OPB buffer in split mode Requirement stipulates OPB to be writable buffer in split mode. Erring out in case of read only buffer will help debugging quickly. Change-Id: I529a97b3d0aa5f82e7cf7d024475338a9d24d1dd Signed-off-by: Amit Shekhar --- msm/vidc/msm_vidc_common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index 4a7d60ba5e88..0e03d13c126e 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -2567,6 +2567,13 @@ static void handle_fbd(enum hal_command_response cmd, void *data) mbuf->flags &= ~MSM_VIDC_FLAG_QUEUED; vb = &mbuf->vvb.vb2_buf; + if (fill_buf_done->buffer_type == HAL_BUFFER_OUTPUT2 && + fill_buf_done->flags1 & HAL_BUFFERFLAG_READONLY) { + dprintk(VIDC_ERR, + "%s: Read only buffer not allowed for OPB\n", __func__); + goto exit; + } + if (fill_buf_done->flags1 & HAL_BUFFERFLAG_DROP_FRAME) fill_buf_done->filled_len1 = 0; vb->planes[0].bytesused = fill_buf_done->filled_len1;