dv: reset the g_vpotch value according to current vinfo [1/1]
authorBrian Zhu <brian.zhu@amlogic.com>
Thu, 16 May 2019 13:13:56 +0000 (21:13 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 20 May 2019 09:38:24 +0000 (02:38 -0700)
PD#SWPL-8419

Problem:
Get the wrong g_vpotch value when platform bootup

Solution:
reset the g_vpotch value according to current vinfo

Verify:
verified by u212

Change-Id: I063140f0a19cf349cd8e6d66c571ae5b2c7e3de7
Signed-off-by: Brian Zhu <brian.zhu@amlogic.com>
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c

index 5b0ded4..07fed4b 100644 (file)
@@ -2131,6 +2131,9 @@ static int dolby_core2_set(
                VSYNC_WR_DV_REG(DOLBY_CORE2A_SWAP_CTRL2,
                        (hsize << 16) | (vsize + g_vsize_add));
        }
+       if (debug_dolby & 2)
+               pr_dolby_dbg("g_hpotch %x, g_vpotch %x\n",
+               g_hpotch, g_vpotch);
        VSYNC_WR_DV_REG(DOLBY_CORE2A_SWAP_CTRL3,
                (g_hwidth << 16) | g_vwidth);
        VSYNC_WR_DV_REG(DOLBY_CORE2A_SWAP_CTRL4,
@@ -2458,7 +2461,23 @@ static void apply_stb_core_settings(
                        g_vpotch = 0x60;
                else
                        g_vpotch = 0x20;
+       } else if (is_meson_g12()) {
+               if (vinfo) {
+                       if (debug_dolby & 2)
+                               pr_dolby_dbg("vinfo %d %d %d\n",
+                                       vinfo->width,
+                                       vinfo->height,
+                                       vinfo->field_height);
+                       if ((vinfo->width < 1280) &&
+                               (vinfo->height < 720) &&
+                               (vinfo->field_height < 720))
+                               g_vpotch = 0x60;
+                       else
+                               g_vpotch = 0x8;
+               } else
+                       g_vpotch = 0x8;
        }
+
        if (mask & 1) {
                if (is_meson_txlx_stbmode()
                        || force_stb_mode) {