MLK-22920 vpu: windsor encoder: change the writeable flag synchronously

If the writeable flag is not change synchronously,
the flag may not changed correct,
it'll case the encode stream hang.
It's likely to happen when small resolution stream do suspend.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
This commit is contained in:
ming_qian
2019-11-07 13:45:41 +08:00
committed by Dong Aisheng
parent 3900a48da1
commit ccc268d1b8

View File

@ -2646,8 +2646,10 @@ static int handle_event_start_done(struct vpu_ctx *ctx)
if (!ctx)
return -EINVAL;
down(&ctx->q_data[V4L2_SRC].drv_q_lock);
set_bit(VPU_ENC_STATUS_START_DONE, &ctx->status);
set_queue_rw_flag(&ctx->q_data[V4L2_SRC], VPU_ENC_FLAG_WRITEABLE);
up(&ctx->q_data[V4L2_SRC].drv_q_lock);
submit_input_and_encode(ctx);
enable_fps_sts(get_vpu_ctx_attr(ctx));
@ -2841,8 +2843,10 @@ static void vpu_enc_event_handler(struct vpu_ctx *ctx,
handle_event_stop_done(ctx);
break;
case VID_API_ENC_EVENT_FRAME_INPUT_DONE:
down(&ctx->q_data[V4L2_SRC].drv_q_lock);
set_queue_rw_flag(&ctx->q_data[V4L2_SRC],
VPU_ENC_FLAG_WRITEABLE);
up(&ctx->q_data[V4L2_SRC].drv_q_lock);
response_stop_stream(ctx);
submit_input_and_encode(ctx);
break;