summaryrefslogtreecommitdiff
authorNanxin Qin <nanxin.qin@amlogic.com>2020-07-09 16:39:44 (GMT)
committer Zhi Zhou <zhi.zhou@amlogic.com>2020-07-15 07:43:14 (GMT)
commit9787d42524cfe4bc4e58b7f75acd8bc9c349f3eb (patch)
tree9d92ec55cacb8f081d2af18986925f1600555065
parenta1cd3c48a985d072d693ceb7418f9bb9ed786f59 (diff)
downloadmedia_modules-9787d42524cfe4bc4e58b7f75acd8bc9c349f3eb.zip
media_modules-9787d42524cfe4bc4e58b7f75acd8bc9c349f3eb.tar.gz
media_modules-9787d42524cfe4bc4e58b7f75acd8bc9c349f3eb.tar.bz2
v4l: fixed the issue of cts. [1/1]
PD#SWPL-28575 Problem: When capture buffer's status isn't stream on, there is no flush video pipeline. The driver will not send EOS to the back end, this will cause jamming. Solution: When the upper layer sends the stop command, flush the video pipeline. Verify: U212 Change-Id: I0ae3f73e536bfcba85f8901c2cb7ce4d46b99e75 Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
Diffstat
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c
index c8445d2..1216ada 100644
--- a/drivers/amvdec_ports/aml_vcodec_dec.c
+++ b/drivers/amvdec_ports/aml_vcodec_dec.c
@@ -1126,15 +1126,12 @@ static int vidioc_decoder_cmd(struct file *file, void *priv,
if (ret)
return ret;
- dst_vq = v4l2_m2m_get_vq(ctx->m2m_ctx,
- multiplanar ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE :
- V4L2_BUF_TYPE_VIDEO_CAPTURE);
switch (cmd->cmd) {
case V4L2_DEC_CMD_STOP:
ATRACE_COUNTER("v4l2_stop", 0);
if (ctx->state != AML_STATE_ACTIVE) {
if (ctx->state >= AML_STATE_IDLE &&
- ctx->state <= AML_STATE_PROBE) {
+ ctx->state < AML_STATE_PROBE) {
ctx->state = AML_STATE_ABORT;
ATRACE_COUNTER("v4l2_state", ctx->state);
aml_vdec_dispatch_event(ctx, V4L2_EVENT_REQUEST_EXIT);
@@ -1152,13 +1149,7 @@ static int vidioc_decoder_cmd(struct file *file, void *priv,
return 0;
}
- if (!vb2_is_streaming(dst_vq)) {
- v4l_dbg(ctx, V4L_DEBUG_CODEC_ERROR,
- "Capture stream is off. No need to flush.\n");
- return 0;
- }
-
- /* flush src */
+ /* flush pipeline */
v4l2_m2m_buf_queue(ctx->m2m_ctx, &ctx->empty_flush_buf->vb);
v4l2_m2m_try_schedule(ctx->m2m_ctx);//pay attention
ctx->receive_cmd_stop = true;
@@ -1166,6 +1157,9 @@ static int vidioc_decoder_cmd(struct file *file, void *priv,
case V4L2_DEC_CMD_START:
v4l_dbg(ctx, V4L_DEBUG_CODEC_EXINFO, "CMD V4L2_DEC_CMD_START\n");
+ dst_vq = v4l2_m2m_get_vq(ctx->m2m_ctx,
+ multiplanar ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE :
+ V4L2_BUF_TYPE_VIDEO_CAPTURE);
vb2_clear_last_buffer_dequeued(dst_vq);//pay attention
break;