summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/amdgpu_dm
diff options
context:
space:
mode:
authorAnthony Koo <Anthony.Koo@amd.com>2017-08-03 09:59:23 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:16:20 -0400
commitd66cf5f5013a4268057bcb92d301d010268ea27f (patch)
tree3bad6df8f6eb551dacb8963036701f03f677a54d /drivers/gpu/drm/amd/display/amdgpu_dm
parent665da60f23d8c6bda5431529a73be49b3b9d97cb (diff)
drm/amd/display: implement DXGI Gamma Ramps
Support for gamma correction ramp in Floating Point format Signed-off-by: Anthony Koo <anthony.koo@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-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')
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 4535942e8a63..b0fcfebc04b8 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1874,15 +1874,14 @@ static int fill_plane_attributes_from_fb(
}
-#define NUM_OF_RAW_GAMMA_RAMP_RGB_256 256
-
static void fill_gamma_from_crtc_state(
const struct drm_crtc_state *crtc_state,
struct dc_plane_state *plane_state)
{
int i;
struct dc_gamma *gamma;
- struct drm_color_lut *lut = (struct drm_color_lut *) crtc_state->gamma_lut->data;
+ struct drm_color_lut *lut =
+ (struct drm_color_lut *) crtc_state->gamma_lut->data;
gamma = dc_create_gamma();
@@ -1891,10 +1890,11 @@ static void fill_gamma_from_crtc_state(
return;
}
- for (i = 0; i < NUM_OF_RAW_GAMMA_RAMP_RGB_256; i++) {
- gamma->red[i] = lut[i].red;
- gamma->green[i] = lut[i].green;
- gamma->blue[i] = lut[i].blue;
+ gamma->type = GAMMA_RGB_256_ENTRIES;
+ for (i = 0; i < GAMMA_RGB_256_ENTRIES; i++) {
+ gamma->entries.red[i] = dal_fixed31_32_from_int(lut[i].red);
+ gamma->entries.green[i] = dal_fixed31_32_from_int(lut[i].green);
+ gamma->entries.blue[i] = dal_fixed31_32_from_int(lut[i].blue);
}
plane_state->gamma_correction = gamma;