From 1e662d20c0dbdfbfdae6eb106d28cb22fbc94594 Mon Sep 17 00:00:00 2001 From: Govindaraj Rajagopal Date: Fri, 13 Nov 2020 12:07:17 +0530 Subject: [PATCH] msm: vidc: handle qbuf failure in batch_handler if msm_comm_qbuf_to_hfi is failed at msm_vidc_batch_handler path, then vb2_buffer refcount is still held at v4l2 layer. So added error handling for qbuf failure at batch timeout sequence. Change-Id: I61b14210ae382944e456df5c11790dc115ab2a15 Signed-off-by: Govindaraj Rajagopal --- msm/vidc/msm_vidc_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index c7444042ed1b..13b3f30b3605 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -4482,6 +4482,7 @@ static int msm_comm_qbuf_to_hfi(struct msm_vidc_inst *inst, rc = -EINVAL; } if (rc) { + mbuf->flags |= MSM_VIDC_FLAG_DEFERRED; s_vpr_e(inst->sid, "%s: Failed to qbuf: %d\n", __func__, rc); goto err_bad_input; } @@ -4517,8 +4518,10 @@ void msm_vidc_batch_handler(struct work_struct *work) __func__); rc = msm_comm_qbufs_batch(inst, NULL); - if (rc) + if (rc) { s_vpr_e(inst->sid, "%s: batch qbufs failed\n", __func__); + msm_vidc_queue_v4l2_event(inst, V4L2_EVENT_MSM_VIDC_SYS_ERROR); + } exit: put_inst(inst);