dv: graphic blend test failed on HDR TV [1/1]
authoryao liu <yao.liu@amlogic.com>
Tue, 22 Oct 2019 11:07:25 +0000 (19:07 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 29 Oct 2019 02:05:12 +0000 (19:05 -0700)
PD#SWPL-15631

Problem:
1.HDR Luminance 375 is too large
2.osd osd_h_filter_mode is not update

Solution:
1.set gmax to 300 for HDR output
2.update osd_h_filter_mode

Verify:
SM1

Change-Id: Ic6f1b02703341d01235a2081bd9ac7ee46b989e7
Signed-off-by: yao liu <yao.liu@amlogic.com>
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c
drivers/amlogic/media/osd/osd_fb.c
drivers/amlogic/media/osd/osd_hw.c
drivers/amlogic/media/vout/vout_serve/vout_serve.c

index 9abff9b80b499578ae8e704116af706199a41967..b7e32a0e8c64418795fae0c29a91c80d9caafaec 100644 (file)
@@ -277,6 +277,7 @@ static bool is_osd_off;
 static bool force_reset_core2;
 static int core1_switch;
 static int core3_switch;
+static bool force_set_lut;
 
 module_param(vtotal_add, uint, 0664);
 MODULE_PARM_DESC(vtotal_add, "\n vtotal_add\n");
@@ -313,11 +314,17 @@ static unsigned int dolby_vision_default_max[3][3] = {
 
 static unsigned int dolby_vision_graphic_min = 50; /* 0.0001 */
 static unsigned int dolby_vision_graphic_max; /* 100 */
+static unsigned int old_dolby_vision_graphic_max;
 module_param(dolby_vision_graphic_min, uint, 0664);
 MODULE_PARM_DESC(dolby_vision_graphic_min, "\n dolby_vision_graphic_min\n");
 module_param(dolby_vision_graphic_max, uint, 0664);
 MODULE_PARM_DESC(dolby_vision_graphic_max, "\n dolby_vision_graphic_max\n");
 
+static unsigned int dv_HDR10_graphics_max = 300;
+static unsigned int dv_graphic_blend_test;
+module_param(dv_graphic_blend_test, uint, 0664);
+MODULE_PARM_DESC(dv_graphic_blend_test, "\n dv_graphic_blend_test\n");
+
 static unsigned int dv_target_graphics_max[3][3] = {
        { 300, 375, 380 }, /* DOVI => DOVI/HDR/SDR */
        { 300, 375, 100 }, /* HDR =>  DOVI/HDR/SDR */
@@ -2346,7 +2353,7 @@ static int dolby_core2_set(
                count = 256 * 5;
        else
                count = lut_count;
-       if (count && (set_lut || reset)) {
+       if (count && (set_lut || reset || force_set_lut)) {
                if (dolby_vision_flags & FLAG_CLKGATE_WHEN_LOAD_LUT)
                        VSYNC_WR_DV_REG_BITS(DOLBY_CORE2A_CLKGATE_CTRL,
                                2, 2, 2);
@@ -2371,6 +2378,7 @@ static int dolby_core2_set(
                        VSYNC_WR_DV_REG_BITS(
                                DOLBY_CORE2A_CLKGATE_CTRL, 0, 2, 2);
        }
+       force_set_lut = false;
 
        /* enable core2 */
        VSYNC_WR_DV_REG(DOLBY_CORE2A_SWAP_CTRL0, dolby_enable << 0);
@@ -2652,6 +2660,19 @@ static int is_graphic_changed(void)
                        ret |= 2;
                }
        }
+       if (old_dolby_vision_graphic_max !=
+           dolby_vision_graphic_max) {
+               if (debug_dolby & 0x10)
+                       pr_dolby_dbg("graphic max changed %d-%d\n",
+                                    old_dolby_vision_graphic_max,
+                                    dolby_vision_graphic_max);
+               if (!is_osd_off) {
+                       old_dolby_vision_graphic_max =
+                               dolby_vision_graphic_max;
+                       ret |= 2;
+                       force_set_lut = true;
+               }
+       }
        return ret;
 }
 
@@ -6483,6 +6504,9 @@ int dolby_vision_parse_metadata(
                                dv_target_graphics_max
                                        [src_format][dst_format];
                }
+               if (dv_graphic_blend_test && dst_format == FORMAT_HDR10) {
+                       graphic_max = dv_HDR10_graphics_max;
+               }
        }
 
        if (dolby_vision_flags & FLAG_USE_SINK_MIN_MAX) {
index c91d921cf6a3a0a1a3892090754d39f913df972c..354d273ff16c73ec8e560f56d1ac15a7d3b888e4 100644 (file)
@@ -4281,6 +4281,7 @@ static int osd_probe(struct platform_device *pdev)
        prop = of_get_property(pdev->dev.of_node, "scale_mode", NULL);
        if (prop)
                prop_idx = of_read_ulong(prop, 1);
+       prop_idx = 0;
        /* Todo: only osd0 */
        osd_set_free_scale_mode_hw(DEV_OSD0, prop_idx);
        prop_idx = 0;
@@ -4291,6 +4292,7 @@ static int osd_probe(struct platform_device *pdev)
        /* get default display mode from dt */
        ret = of_property_read_string(pdev->dev.of_node,
                "display_mode_default", &str);
+       prop_idx = 0;
        prop = of_get_property(pdev->dev.of_node, "pxp_mode", NULL);
        if (prop)
                prop_idx = of_read_ulong(prop, 1);
index 871fc6ea824f3a1c8163df45c44a73ed34805c2f..d2304ebdfb8f9c8f1881f5b176b97079930b0578 100644 (file)
@@ -8604,10 +8604,9 @@ static int osd_setting_order(u32 output_index)
                        osd_hw.reg[DISP_GEOMETRY].update_func(i);
                        osd_hw.reg[OSD_GBL_ALPHA].update_func(i);
                        osd_hw.reg[DISP_OSD_REVERSE].update_func(i);
+                       osd_hw.reg[OSD_FREESCALE_COEF].update_func(i);
                        if (update || osd_update_window_axis) {
                                osd_set_scan_mode(i);
-                               osd_hw.reg
-                                       [OSD_FREESCALE_COEF].update_func(i);
                                osd_hw.reg[DISP_FREESCALE_ENABLE]
                                .update_func(i);
                                osd_update_window_axis = false;
index acfbf18ef7f4a713a4e1d7190238f5fc022ba952..b784b34c6b71b6c1c2b01beecb358474f463313e 100644 (file)
@@ -901,8 +901,6 @@ static int refresh_tvout_mode(void)
                 * When systemcontrol bootup, it will set the correct mode and
                 * colorspace according to current EDID from kernel.
                 */
-               VOUTPR("hdmichecksum [%s], kernel hdmichecksum [%s]\n",
-                               hdmichecksum, info->hdmichecksum);
                if ((memcmp(hdmichecksum, info->hdmichecksum, 10)) &&
                        (memcmp(emptychecksum, info->hdmichecksum, 10)) &&
                        (memcmp(invalidchecksum, hdmichecksum, 10))) {