Bläddra i källkod

video: driver: fix race issue with seek after EOS

HAL received lastflag FBD(for EOS) from reverse(polling) thread,
and before it sends SessionContinue(START_CMD) to driver, component
thread initiated streamoff on input port. So driver statemachine
got changed from DRAIN_LAST_FLAG to START_OUTPUT state.

After Streamoff sequence, reverse thread attempting START_CMD will
fail due to driver statemachine check. So q->last_buffer_dequeued
was never getting reset at v4l2 layer. As a result all subsequent
dqbuf ioctl calls will fail and leading to session hung issue.

Added change to call vb2_clear_last_buffer_dequeued() before
START_CMD rejection at driver side to avoid above mentioned issue.

Change-Id: Ic06f555f0c4deaa05c526ba9c0a19396d5a6f289
Signed-off-by: Govindaraj Rajagopal <[email protected]>
Govindaraj Rajagopal 3 år sedan
förälder
incheckning
c9f4e6c3c0
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      driver/vidc/src/msm_vdec.c

+ 2 - 2
driver/vidc/src/msm_vdec.c

@@ -2305,6 +2305,8 @@ int msm_vdec_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
 			return rc;
 	} else if (cmd == V4L2_DEC_CMD_START) {
 		i_vpr_h(inst, "received cmd: resume\n");
+		vb2_clear_last_buffer_dequeued(&inst->vb2q[OUTPUT_META_PORT]);
+		vb2_clear_last_buffer_dequeued(&inst->vb2q[OUTPUT_PORT]);
 
 		if (capability->cap[CODED_FRAMES].value == CODED_FRAMES_INTERLACE &&
 			!is_ubwc_colorformat(capability->cap[PIX_FMTS].value)) {
@@ -2317,8 +2319,6 @@ int msm_vdec_process_cmd(struct msm_vidc_inst *inst, u32 cmd)
 		if (!msm_vidc_allow_start(inst))
 			return -EBUSY;
 		port = (inst->state == MSM_VIDC_DRAIN_LAST_FLAG) ? INPUT_PORT : OUTPUT_PORT;
-		vb2_clear_last_buffer_dequeued(&inst->vb2q[OUTPUT_META_PORT]);
-		vb2_clear_last_buffer_dequeued(&inst->vb2q[OUTPUT_PORT]);
 
 		rc = msm_vidc_state_change_start(inst);
 		if (rc)