From 398008ac0e70febe2fcb83352d50ba87041502be Mon Sep 17 00:00:00 2001 From: yao liu Date: Fri, 21 Jun 2019 15:46:18 +0800 Subject: [PATCH] Dolby: HDR-001-TC5: VID and GFX doesn't match [1/1] PD#SWPL-8159 Problem: HDR-001-TC5 source is dv, need graphic max 300 HDR-001-TC3 source is hdr, need graphic max 210 Solution: Set 300 for DV source and 210 for HDR source in LL mode Verify: Verified on U212 Change-Id: I93c71ee51fc128d9d01113d4e24d4df1786901e2 Signed-off-by: yao liu --- .../media/enhancement/amdolby_vision/amdolby_vision.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c index 08ad383..57fa80e 100644 --- a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c +++ b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c @@ -301,7 +301,11 @@ 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; +static unsigned int dv_target_graphics_LL_max[3][3] = { + { 300, 300, 100 }, /* DOVI => DOVI/HDR/SDR */ + { 210, 300, 100 }, /* HDR => DOVI/HDR/SDR */ + { 300, 300, 100 }, /* SDR => DOVI/HDR/SDR */ +}; /*these two parameters form OSD*/ static unsigned int osd_graphic_width = 1920; @@ -5553,16 +5557,15 @@ int dolby_vision_parse_metadata( graphic_min = dolby_vision_graphic_min; if (dolby_vision_graphic_max != 0) graphic_max = dolby_vision_graphic_max; - else + else { 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 ((dolby_vision_flags & FLAG_FORCE_DOVI_LL) || + (dolby_vision_ll_policy >= DOLBY_VISION_LL_YUV422)) { + graphic_max = + dv_target_graphics_LL_max[src_format][dst_format]; + } } if (is_graphics_output_off()) { -- 2.7.4