diff options
author | Leo (Sunpeng) Li <sunpeng.li@amd.com> | 2018-01-30 11:14:27 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-19 14:20:08 -0500 |
commit | 236d0e4f6f1eaac500261660e35ededcfbd66eeb (patch) | |
tree | 7f90ecaaeaf2ad6357c88545e854bfa03781392e /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | |
parent | e277adc5a06cfc95ad3e1a6b80bcd97ab4b01ea6 (diff) | |
download | linux-236d0e4f6f1eaac500261660e35ededcfbd66eeb.tar.bz2 |
drm/amd/display: Refactor max color lut entries into a macro.
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index d7bc1b7dd152..62bb72fe9aa5 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -39,14 +39,13 @@ void amdgpu_dm_init_color_mod(void) } -#define MAX_LUT_ENTRIES 256 - /* * Return true if the given lut is a linear mapping of values, i.e. it acts * like a bypass LUT. * * It is considered linear if the lut represents: - * f(a) = (0xFF00/MAX_LUT_ENTRIES-1)a; for integer a in [0, MAX_LUT_ENTRIES) + * f(a) = (0xFF00/MAX_COLOR_LUT_ENTRIES-1)a; for integer a in + * [0, MAX_COLOR_LUT_ENTRIES) */ static bool __is_lut_linear(struct drm_color_lut *lut) { @@ -55,12 +54,12 @@ static bool __is_lut_linear(struct drm_color_lut *lut) uint32_t expected; int delta; - for (i = 0; i < MAX_LUT_ENTRIES; i++) { + for (i = 0; i < MAX_COLOR_LUT_ENTRIES; i++) { /* All color values should equal */ if ((lut[i].red != lut[i].green) || (lut[i].green != lut[i].blue)) return false; - expected = i * max_os / (MAX_LUT_ENTRIES-1); + expected = i * max_os / (MAX_COLOR_LUT_ENTRIES-1); /* Allow a +/-1 error. */ delta = lut[i].red - expected; @@ -113,7 +112,7 @@ int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc) if (!gamma) return -ENOMEM; - gamma->num_entries = MAX_LUT_ENTRIES; + gamma->num_entries = MAX_COLOR_LUT_ENTRIES; gamma->type = GAMMA_RGB_256; /* Truncate, and store in dc_gamma for output tf calculation */ |