aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0117-drm-amd-display-fix-gamma-for-dpms-usecase.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0117-drm-amd-display-fix-gamma-for-dpms-usecase.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0117-drm-amd-display-fix-gamma-for-dpms-usecase.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0117-drm-amd-display-fix-gamma-for-dpms-usecase.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0117-drm-amd-display-fix-gamma-for-dpms-usecase.patch
new file mode 100644
index 00000000..28595ba6
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0117-drm-amd-display-fix-gamma-for-dpms-usecase.patch
@@ -0,0 +1,73 @@
+From bf4f7579d5277cfc5425ba9675f490c02ea39ea9 Mon Sep 17 00:00:00 2001
+From: Roman Li <Roman.Li@amd.com>
+Date: Tue, 3 Jan 2017 13:46:45 -0500
+Subject: [PATCH 0117/4131] 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>
+---
+ .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 22 +++++++++++-----------
+ 1 file 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 66c72ca..ad29ef7 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
+@@ -514,7 +514,6 @@ static void fill_gamma_from_crtc(
+ {
+ int i;
+ struct dc_gamma *gamma;
+- struct dc_transfer_func *input_tf;
+ uint16_t *red, *green, *blue;
+ int end = (crtc->gamma_size > NUM_OF_RAW_GAMMA_RAMP_RGB_256) ?
+ NUM_OF_RAW_GAMMA_RAMP_RGB_256 : crtc->gamma_size;
+@@ -535,16 +534,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(
+@@ -555,6 +544,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(
+@@ -563,6 +553,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 (crtc->mode.private_flags &
+ AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET) {
+--
+2.7.4
+