summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Li <Roman.Li@amd.com>2017-01-03 13:46:45 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:08:23 -0400
commit18f39f2d674e6556d169dcf1a42493c2a632c005 (patch)
tree781b2e5894fb55459c2d1ec0093d62a0c10a1a07
parent7fc698a0c0e5901923a6d6c04a59aceefffe4c9b (diff)
downloadlinux-stable-18f39f2d674e6556d169dcf1a42493c2a632c005.tar.gz
linux-stable-18f39f2d674e6556d169dcf1a42493c2a632c005.tar.bz2
linux-stable-18f39f2d674e6556d169dcf1a42493c2a632c005.zip
drm/amd/display: fix gamma for dpms usecase
For dpms usecase we need to set surface transfer function regardless of gamma set flag. Signed-off-by: Roman Li <Roman.Li@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>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index da8bd66f99ee..8807b48bc110 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -515,7 +515,6 @@ static void fill_gamma_from_crtc(
struct dc_gamma *gamma;
struct drm_crtc_state *state = crtc->state;
struct drm_color_lut *lut = (struct drm_color_lut *) state->gamma_lut->data;
- struct dc_transfer_func *input_tf;
gamma = dc_create_gamma();
@@ -529,16 +528,6 @@ static void fill_gamma_from_crtc(
}
dc_surface->gamma_correction = gamma;
-
- input_tf = dc_create_transfer_func();
-
- if (input_tf == NULL)
- return;
-
- input_tf->type = TF_TYPE_PREDEFINED;
- input_tf->tf = TRANSFER_FUNCTION_SRGB;
-
- dc_surface->in_transfer_func = input_tf;
}
static void fill_plane_attributes(
@@ -549,6 +538,7 @@ static void fill_plane_attributes(
const struct amdgpu_framebuffer *amdgpu_fb =
to_amdgpu_framebuffer(state->fb);
const struct drm_crtc *crtc = state->crtc;
+ struct dc_transfer_func *input_tf;
fill_rects_from_plane_state(state, surface);
fill_plane_attributes_from_fb(
@@ -557,6 +547,16 @@ static void fill_plane_attributes(
amdgpu_fb,
addrReq);
+ input_tf = dc_create_transfer_func();
+
+ if (input_tf == NULL)
+ return;
+
+ input_tf->type = TF_TYPE_PREDEFINED;
+ input_tf->tf = TRANSFER_FUNCTION_SRGB;
+
+ surface->in_transfer_func = input_tf;
+
/* In case of gamma set, update gamma value */
if (state->crtc->state->gamma_lut) {
fill_gamma_from_crtc(crtc, surface);