summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorming_qian <ming.qian@nxp.com>2019-06-05 15:53:32 +0800
committerming_qian <ming.qian@nxp.com>2019-06-05 17:04:15 +0800
commitaf399afcfe09dc9dc30a6dc7b9709c94d3babeef (patch)
treeacfe0815b5ac9bfb2d3b43511a4528bb1ec25802 /drivers
parent59bee5e9e730e87afd9dfead3c7d0b65eaba9d2b (diff)
MLK-21951: VPU Decoder: fix stop cmd may be missed
If user open and close in a short time, call close before driver receive the start done event, driver won't send stop cmd to firmware, and then release the context. next time user open device, the state of firmware is mismatch with driver, it will cause some unexpected error Signed-off-by: ming_qian <ming.qian@nxp.com> Reviewed-by: Zhou Peng <eagle.zhou@nxp.com> Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/vpu_malone/vpu_b0.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mxc/vpu_malone/vpu_b0.c b/drivers/mxc/vpu_malone/vpu_b0.c
index 6bd4ebb6547e..4e435e6404d5 100644
--- a/drivers/mxc/vpu_malone/vpu_b0.c
+++ b/drivers/mxc/vpu_malone/vpu_b0.c
@@ -2661,8 +2661,6 @@ static int vpu_dec_cmd_reset(struct vpu_ctx *ctx)
if (ret)
return ret;
- memset(ctx->pSeqinfo, 0, sizeof(MediaIPFW_Video_SeqInfo));
-
return 0;
}
@@ -3342,6 +3340,7 @@ static void vpu_api_event_handler(struct vpu_ctx *ctx, u_int32 uStrIdx, u_int32
respond_req_frame(ctx, &ctx->q_data[V4L2_DST], true);
reset_mbi_dcp_count(ctx);
up(&ctx->q_data[V4L2_DST].drv_q_lock);
+ memset(ctx->pSeqinfo, 0, sizeof(MediaIPFW_Video_SeqInfo));
complete(&ctx->completion);//reduce possibility of abort hang if decoder enter stop automatically
complete(&ctx->stop_cmp);
}
@@ -4763,8 +4762,6 @@ static bool vpu_dec_is_active(struct vpu_ctx *ctx)
{
if (!ctx)
return false;
- if (ctx->firmware_stopped)
- return false;
if (ctx->start_flag)
return false;
@@ -4829,7 +4826,7 @@ static int v4l2_open(struct file *filp)
ctx->start_flag = true;
ctx->wait_rst_done = false;
ctx->wait_res_change_done = false;
- ctx->firmware_stopped = false;
+ ctx->firmware_stopped = true;
ctx->firmware_finished = false;
ctx->eos_stop_received = false;
ctx->eos_stop_added = false;