osd: fix osd bootanimation shift [2/2]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Mon, 2 Mar 2020 07:40:20 +0000 (15:40 +0800)
committerLiang Ji <liang.ji@amlogic.com>
Wed, 4 Mar 2020 08:56:26 +0000 (16:56 +0800)
PD#SWPL-19862

Problem:
osd regs init are different with meson-hwc setting

Solution:
osd regs init are different with meson-hwc setting

Verify:
franklin

Change-Id: Ic9f19a82859e1e18e57084935873b10057436e3b
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
drivers/amlogic/media/osd/osd_hw.c

index 727773fa75b6bb5aea3e5a1bc5d81e7e3ef2764b..2d6373279092e8970ae6af4772f00d7c21e729c1 100644 (file)
@@ -3678,8 +3678,10 @@ void osd_switch_free_scale(
                if (next_index == OSD1
                        && osd_hw.osd_afbcd[next_index].enable
                        && next_enable) {
-                       osd_reg_write(VIU_SW_RESET, 0x80000000);
-                       osd_reg_write(VIU_SW_RESET, 0);
+                       if (osd_hw.osd_meson_dev.osd_ver == OSD_NORMAL) {
+                               osd_reg_write(VIU_SW_RESET, 0x80000000);
+                               osd_reg_write(VIU_SW_RESET, 0);
+                       }
                        osd_afbc_dec_enable = 0;
                        osd_hw.reg[OSD_GBL_ALPHA].update_func(next_index);
                }
@@ -3692,15 +3694,16 @@ void osd_switch_free_scale(
                        osd_hw.reg[DISP_FREESCALE_ENABLE].
                                                update_func(pre_index);
                        osd_hw.reg[OSD_ENABLE].update_func(pre_index);
-               }
-               osd_hw.reg[OSD_COLOR_MODE].update_func(next_index);
-               if (next_scale)
-                       osd_hw.reg
-                               [OSD_FREESCALE_COEF].update_func(next_index);
-               osd_hw.reg[DISP_GEOMETRY].update_func(next_index);
-               osd_hw.reg[DISP_FREESCALE_ENABLE].update_func(next_index);
-               osd_hw.reg[OSD_ENABLE].update_func(next_index);
 
+                       osd_hw.reg[OSD_COLOR_MODE].update_func(next_index);
+                       if (next_scale)
+                               osd_hw.reg[OSD_FREESCALE_COEF].
+                               update_func(next_index);
+                       osd_hw.reg[DISP_GEOMETRY].update_func(next_index);
+                       osd_hw.reg[DISP_FREESCALE_ENABLE].
+                               update_func(next_index);
+                       osd_hw.reg[OSD_ENABLE].update_func(next_index);
+               }
                spin_unlock_irqrestore(&osd_lock, lock_flags);
                osd_wait_vsync_hw(next_index);
        } else {
@@ -8669,15 +8672,15 @@ static int osd_setting_order(u32 output_index)
 static void osd_setting_default_hwc(void)
 {
        u32 blend_hsize, blend_vsize;
-       u32 blend2_premult_en = 1, din_premult_en = 0;
-       u32 blend_din_en = 0x1;
+       u32 blend2_premult_en = 3, din_premult_en = 0;
+       u32 blend_din_en = 0x5;
        /* blend_din0 input to blend0 */
-       u32 din0_byp_blend = 1;
+       u32 din0_byp_blend = 0;
        /* blend1_dout to blend2 */
-       u32 din2_osd_sel = 1;
+       u32 din2_osd_sel = 0;
        /* blend1_din3 input to blend1 */
-       u32 din3_osd_sel = 1;
-       u32 din_reoder_sel = 0x1;
+       u32 din3_osd_sel = 0;
+       u32 din_reoder_sel = 0x4441;
        u32 postbld_src3_sel = 3, postbld_src4_sel = 0;
        u32 postbld_osd1_premult = 0, postbld_osd2_premult = 0;
 
@@ -9539,6 +9542,8 @@ void osd_init_hw(u32 logo_loaded, u32 osd_probe,
                for (idx = 0; idx < osd_hw.osd_meson_dev.viu1_osd_count; idx++)
                        osd_reg_write(
                                hw_osd_reg_array[idx].osd_ctrl_stat, data32);
+               if (osd_hw.osd_meson_dev.osd_ver == OSD_HIGH_ONE)
+                       osd_setting_default_hwc();
        }
        if (osd_hw.osd_meson_dev.osd_ver <= OSD_NORMAL) {
                osd_vpp_misc =
@@ -9651,7 +9656,6 @@ void osd_init_hw(u32 logo_loaded, u32 osd_probe,
                #endif
                osd_set_basic_urgent(true);
                osd_set_two_ports(true);
-               osd_setting_default_hwc();
        }
        /* disable deband as default */
        if (osd_hw.osd_meson_dev.has_deband)