amvecm: optimize amvecm update in vsync [1/1]
authorMingLiang Dong <mingliang.dong@amlogic.com>
Sun, 28 Apr 2019 13:39:48 +0000 (09:39 -0400)
committerTao Zeng <tao.zeng@amlogic.com>
Tue, 7 May 2019 09:40:30 +0000 (02:40 -0700)
PD#SWPL-6475

Problem:
hdmi input signal, video flicker

Solution:
optimize amvecm update in vsync

Verify:
verify on TL1

Change-Id: I3379333053fc52b8a33747ca83b1d6d68ea874ab
Signed-off-by: MingLiang Dong <mingliang.dong@amlogic.com>
drivers/amlogic/media/enhancement/amvecm/amcsc.c
drivers/amlogic/media/video_sink/video.c

index 12f5f98..e4ef11b 100644 (file)
@@ -6375,15 +6375,6 @@ static void video_process(
                pr_csc("saturation offset = %d.\n",
                        saturation_offset);
                cur_csc_type = csc_type;
-
-               if (vf) {
-                       if ((cur_csc_type == VPP_MATRIX_BT2020YUV_BT2020RGB) &&
-                               (cur_csc_type != 0xffff) &&
-                               (vf->source_type == VFRAME_SOURCE_TYPE_HDMI)) {
-                               amvecm_wakeup_queue();
-                               pr_csc("wake up hdr status queue.\n");
-                       }
-               }
        }
 }
 
index a01cd14..e06ba7e 100644 (file)
@@ -6820,20 +6820,6 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
                        set_hdr_to_frame(vf);
 #endif
 
-#if defined(CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_VECM)
-                       refresh_on_vs(vf);
-                       if (amvecm_on_vs(
-                               (cur_dispbuf != &vf_local)
-                               ? cur_dispbuf : NULL,
-                               vf, CSC_FLAG_CHECK_OUTPUT,
-                               cur_frame_par ?
-                               cur_frame_par->supsc1_hori_ratio :
-                               0,
-                               cur_frame_par ?
-                               cur_frame_par->supsc1_vert_ratio :
-                               0) == 1)
-                               break;
-#endif
                        /*
                         *two special case:
                         *case1:4k display case,input buffer not enough &
@@ -6884,6 +6870,22 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
                                        video_3d_format = vf->trans_fmt;
                                }
                        }
+
+#if defined(CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_VECM)
+                       refresh_on_vs(vf);
+                       if (amvecm_on_vs(
+                               (cur_dispbuf != &vf_local)
+                               ? cur_dispbuf : NULL,
+                               vf, CSC_FLAG_CHECK_OUTPUT,
+                               cur_frame_par ?
+                               cur_frame_par->supsc1_hori_ratio :
+                               0,
+                               cur_frame_par ?
+                               cur_frame_par->supsc1_vert_ratio :
+                               0) == 1)
+                               break;
+#endif
+
                        vsync_toggle_frame(vf, __LINE__);
                        toggle_frame = vf;
 #ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION