dolby: set gmax for LL mode [1/1]
authoryao liu <yao.liu@amlogic.com>
Wed, 22 May 2019 09:38:13 +0000 (17:38 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Fri, 24 May 2019 09:11:52 +0000 (02:11 -0700)
PD#SWPL-8799

Problem:
HDR-001-TC3 GXF is brighter than VID in LL mode

Solution:
dolby_vision_target_graphics_L for LL mode

Verify:
verified on u212

Change-Id: I3b39ec048bfff3d8ae797702c1c783356d59e604
Signed-off-by: yao liu <yao.liu@amlogic.com>
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c

index 3d62c39..d4ed4fc 100644 (file)
@@ -301,6 +301,7 @@ MODULE_PARM_DESC(dolby_vision_graphic_max, "\n dolby_vision_graphic_max\n");
 static unsigned int dolby_vision_target_graphics_max[3] = {
        300, 300, 100
 }; /* DOVI/HDR/SDR */
+static unsigned int dolby_vision_target_graphics_LL = 210;
 
 /*these two parameters form OSD*/
 static unsigned int osd_graphic_width = 1920;
@@ -5538,6 +5539,14 @@ int dolby_vision_parse_metadata(
                graphic_max =
                        dolby_vision_target_graphics_max[dst_format];
 
+       if (dst_format == FORMAT_DOVI) {
+               if ((dolby_vision_flags
+                       & FLAG_FORCE_DOVI_LL) ||
+                       (dolby_vision_ll_policy
+                       >= DOLBY_VISION_LL_YUV422))
+                       graphic_max = dolby_vision_target_graphics_LL;
+       }
+
        if (is_graphics_output_off()) {
                graphic_min = 0;
                graphic_max = 0;