dv: fix the flickered problem [1/1]
authorYi Zhou <yi.zhou@amlogic.com>
Tue, 16 Oct 2018 02:26:02 +0000 (10:26 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Tue, 23 Oct 2018 08:36:40 +0000 (01:36 -0700)
PD#SWPL-348

Problem:
fix the flickered problem.

Solution:
when dv core1 don't run, the reset can't be executed

Verify:
t962e (txlx)

Change-Id: I90e78676bbe64ded505148aa4c2516d808bf4a82
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c

index c58a4c7..c422c98 100644 (file)
@@ -1118,10 +1118,13 @@ static int stb_dolby_core1_set(
        WRITE_VPP_REG(
                DOLBY_TV_CLKGATE_CTRL, 0x2800);
        if (reset) {
-               VSYNC_WR_MPEG_REG(VIU_SW_RESET, 1 << 9);
-               VSYNC_WR_MPEG_REG(VIU_SW_RESET, 0);
-               VSYNC_WR_MPEG_REG(
-                       DOLBY_TV_CLKGATE_CTRL, 0x2800);
+               if (!dolby_vision_core1_on) {
+                       VSYNC_WR_MPEG_REG(VIU_SW_RESET, 1 << 9);
+                       VSYNC_WR_MPEG_REG(VIU_SW_RESET, 0);
+                       VSYNC_WR_MPEG_REG(
+                               DOLBY_TV_CLKGATE_CTRL, 0x2800);
+               } else
+                       reset = 0;
        }
 
        if (!bl_enable)
@@ -4459,7 +4462,7 @@ static void calculate_panel_max_pq(
                } else {
                        max_lin = max_lin - 500 + 50;
                        max_lin = (max_lin / 100) * 100 + 500;
-                       max_pq = L2PQ_100_500[(max_lin - 500) / 100];
+                       max_pq = L2PQ_500_4000[(max_lin - 500) / 100];
                }
                pr_info("panel max lumin changed from %d(%d) to %d(%d)\n",
                        tv_max_lin, tv_max_pq, max_lin, max_pq);