From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
Date: Fri, 2 Feb 2018 09:46:41 -0500
Subject: drm/amd/display: Use hardware max low point when sampling OTF
Git-commit: 08616da569751be1b9ce6128a28930847670c80d
Patch-mainline: v4.17-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166
The MAX_LOW_POINT macro should reflect the maximum low point within
hardware. Otherwise, sampling for the hardware points from the output
transfer function (OTF) will be incorrect.
Also, fix usage of MAX_LOW_POINT accordingly.
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -409,7 +409,7 @@ static bool convert_to_custom_float(stru
return true;
}
-#define MAX_LOW_POINT 11
+#define MAX_LOW_POINT 25
#define NUMBER_REGIONS 16
#define NUMBER_SW_SEGMENTS 16
@@ -443,8 +443,8 @@ dce110_translate_regamma_to_hw_format(co
/* 16 segments
* segments are from 2^-11 to 2^5
*/
- region_start = -MAX_LOW_POINT;
- region_end = NUMBER_REGIONS - MAX_LOW_POINT;
+ region_start = -11;
+ region_end = region_start + NUMBER_REGIONS;
for (i = 0; i < NUMBER_REGIONS; i++)
seg_distr[i] = 4;