From: ming_qian Date: Fri, 20 Sep 2019 02:22:42 +0000 (+0800) Subject: MLK-22647: VPU Decoder: make sure clear b_firstseq before send source X-Git-Tag: rel_imx_4.19.35_1.1.0~15 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=c5d3ec7ad151a34cc9e8725556f25e8d05369666;p=linux.git MLK-22647: VPU Decoder: make sure clear b_firstseq before send source change event If b_firstseq is cleared after sending source change event, user may get invalid frame size. Signed-off-by: ming_qian Reviewed-by: Shijie Qin Reviewed-by: Zhou Peng (cherry picked from commit 6794c08937d4b9b1f8509935ebaeb1072af0b4aa) --- diff --git a/drivers/mxc/vpu_malone/vpu_b0.c b/drivers/mxc/vpu_malone/vpu_b0.c index 0766ad73fd8a..a66dfbc49131 100644 --- a/drivers/mxc/vpu_malone/vpu_b0.c +++ b/drivers/mxc/vpu_malone/vpu_b0.c @@ -4294,9 +4294,9 @@ static void vpu_api_event_handler(struct vpu_ctx *ctx, u_int32 uStrIdx, u_int32 if (check_res_is_changed(ctx, &info)) ctx->res_change_occu_count++; memcpy(&ctx->seqinfo, &info, sizeof(MediaIPFW_Video_SeqInfo)); + calculate_frame_size(ctx); up(&ctx->q_data[V4L2_DST].drv_q_lock); - calculate_frame_size(ctx); parse_frame_interval_from_seqinfo(ctx, &ctx->seqinfo); vpu_dbg(LVL_BIT_FLOW, "ctx[%d] SEQINFO GET: uHorRes:%d uVerRes:%d uHorDecodeRes:%d uVerDecodeRes:%d\n", @@ -4322,6 +4322,7 @@ static void vpu_api_event_handler(struct vpu_ctx *ctx, u_int32 uStrIdx, u_int32 ctx->seqinfo.uVUIPresent); if (ctx->b_firstseq) { down(&ctx->q_data[V4L2_DST].drv_q_lock); + ctx->b_firstseq = false; reset_mbi_dcp_count(ctx); ctx->mbi_size = get_mbi_size(&ctx->q_data[V4L2_DST]); reset_frame_buffer(ctx); @@ -4330,7 +4331,6 @@ static void vpu_api_event_handler(struct vpu_ctx *ctx, u_int32 uStrIdx, u_int32 ctx->wait_res_change_done = true; send_source_change_event(ctx); pStreamPitchInfo->uFramePitch = 0x4000; - ctx->b_firstseq = false; vpu_calculate_performance(ctx, uEvent, "seq_hdr_found"); } } @@ -5399,7 +5399,7 @@ static ssize_t show_instance_buffer_info(struct device *dev, stream_length, ctx->stream_buffer.dma_size); num += scnprintf(buf + num, PAGE_SIZE - num, - "\t%40s:%16d\n", "decode dealy frame", + "\t%40s:%16d\n", "decode delay frame", ctx->frm_dec_delay); num += scnprintf(buf + num, PAGE_SIZE - num, "\t%40s:%16d\n", "display delay frame",