From: Leo (Sunpeng) Li Date: Fri, 2 Feb 2018 14:46:41 +0000 (-0500) Subject: drm/amd/display: Use hardware max low point when sampling OTF X-Git-Tag: android-x86-8.1-r1~1211^2~30^2~34 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=08616da569751be1b9ce6128a28930847670c80d;p=android-x86%2Fkernel.git drm/amd/display: Use hardware max low point when sampling OTF 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 Reviewed-by: Krunoslav Kovac Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index 9e97cd74b0ec..bc698644d42a 100644 --- 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(struct pwl_result_data *rgb_resulted, 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(const struct dc_transfer_func *output_tf, /* 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;