Browse Source

video: driver: reset last_buffer_dequeued flag for streamoff case

After drc/drain sequence completion, if client initiates input port
streamoff, then firmware is expected to release all EBD's. But looks
like couple of FBD's also returned by firmware and gets added to
q->done_list.

Due to valid vb2_buffer entry, poll() gets unblocked everytime and
attempts to dequeue but dqbuf request on capture port after last_flag
will be rajected by vb2 with -EPIPE error.

So v2_buffer never gets dequeued and poll always gets unblocked i.e
leading to barrage of dqbuf failure prints.

Added change to clear last_buffer_dequeued flag as part of streamoff.
This is required for both input & output port side.

Change-Id: I9e84e642811100b1e32317228e7d9b3739def1c4
Signed-off-by: Govindaraj Rajagopal <[email protected]>
Govindaraj Rajagopal 4 years ago
parent
commit
816f15fbcf
1 changed files with 6 additions and 0 deletions
  1. 6 0
      driver/vidc/src/msm_vidc_vb2.c

+ 6 - 0
driver/vidc/src/msm_vidc_vb2.c

@@ -247,6 +247,12 @@ void msm_vidc_stop_streaming(struct vb2_queue *q)
 	}
 	i_vpr_h(inst, "Streamoff: %d\n", q->type);
 
+	/**
+	 * Clear q->last_buffer_dequeued flag to facilitate
+	 * userspace dqbuf on output port after last_flag FBD.
+	 */
+	vb2_clear_last_buffer_dequeued(&inst->vb2q[OUTPUT_META_PORT]);
+	vb2_clear_last_buffer_dequeued(&inst->vb2q[OUTPUT_PORT]);
 	if (q->type == INPUT_MPLANE) {
 		if (is_decode_session(inst))
 			rc = msm_vdec_streamoff_input(inst);