From 0630510039b0749b11994bcf30942026c5208f26 Mon Sep 17 00:00:00 2001 From: "gan.zhang" Date: Mon, 23 Nov 2020 20:25:32 +0800 Subject: [PATCH] media: fix the display problem with some non-standard dv streams. [1/2] PD#SWPL-36900 Problem: For non-standardized dv streams, dv effect is displayed because meta data is parsed. Solution: For non-standardized dv streams, discard_dv_data flag is passed to the dv module. Verify: AH212 Change-Id: Ibb6ace0825a98ceb0e948542489f672f94018d46 Signed-off-by: gan.zhang --- drivers/frame_provider/decoder/h264_multi/vmh264.c | 11 +++++++++++ drivers/frame_provider/decoder/h265/vh265.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index 38e8c4e..24de3c7 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -920,6 +920,7 @@ struct vdec_h264_hw_s { int loop_last_poc; bool enable_fence; int fence_usage; + bool discard_dv_data; }; static u32 again_threshold; @@ -2979,6 +2980,9 @@ static int post_video_frame(struct vdec_s *vdec, struct FrameStore *frame) } set_frame_info(hw, vf, buffer_index); + if (hw->discard_dv_data) { + vf->discard_dv_data = true; + } if (hw->mmu_enable && hw->double_write_mode) { vf->width = hw->frame_width / @@ -9954,6 +9958,13 @@ static int ammvdec_h264_probe(struct platform_device *pdev) "parm_fence_usage", &config_val) == 0) hw->fence_usage = config_val; + + if (get_config_int(pdata->config, + "negative_dv", + &config_val) == 0) { + hw->discard_dv_data = config_val; + dpb_print(DECODE_ID(hw), 0, "discard dv data\n"); + } } else hw->double_write_mode = double_write_mode; diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index 0a23180..2882071 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -1814,6 +1814,7 @@ struct hevc_state_s { u32 poc_error_count; u32 timeout_flag; ulong timeout; + bool discard_dv_data; } /*hevc_stru_t */; #ifdef AGAIN_HAS_THRESHOLD @@ -9388,6 +9389,10 @@ static int prepare_display_buf(struct hevc_state_s *hevc, struct PIC_s *pic) vf->canvas0Addr = vf->canvas1Addr = spec2canvas(pic); #endif set_frame_info(hevc, vf, pic); + if (hevc->discard_dv_data) { + vf->discard_dv_data = true; + } + /* if((vf->width!=pic->width)||(vf->height!=pic->height)) */ /* hevc_print(hevc, 0, "aaa: %d/%d, %d/%d\n", @@ -14048,6 +14053,12 @@ static int ammvdec_h265_probe(struct platform_device *pdev) hevc->dv_duallayer = config_val; else hevc->dv_duallayer = false; + + if (get_config_int(pdata->config, "negative_dv", + &config_val) == 0) { + hevc->discard_dv_data = config_val; + hevc_print(hevc, 0, "discard dv data\n"); + } #endif } else { if (pdata->sys_info) -- 2.20.1