media: fix the display problem with some non-standard dv streams. [1/2]
authorgan.zhang <gan.zhang@amlogic.com>
Mon, 23 Nov 2020 12:25:32 +0000 (20:25 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Tue, 24 Nov 2020 01:45:49 +0000 (17:45 -0800)
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 <gan.zhang@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c
drivers/frame_provider/decoder/h265/vh265.c

index 38e8c4eaa3f5c5b2351369f197b9a1fb86353bf8..24de3c73c1ef8da15e9096602a000f293fba1014 100644 (file)
@@ -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;
 
index 0a23180e46599e94e2bf0570318b3cf8b9b8c775..2882071f6557ecf5007177766be480685066089c 100644 (file)
@@ -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)