aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/2009-drm-amd-display-Don-t-use-ROM-for-output-TF-if-GAMMA.patch
blob: 29aaa3d795b0620d78f84146d2b2ed760ca67481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 988774b776ee937fa2b269fe06601f7fd37e6063 Mon Sep 17 00:00:00 2001
From: Hugo Hu <hugo.hu@amd.com>
Date: Fri, 3 May 2019 15:36:29 +0800
Subject: [PATCH 2009/2940] drm/amd/display: Don't use ROM for output TF if
 GAMMA_CS_TFM_1D
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We can’t use hardcoded SRGB ROM for output TF if we have GAMMA_CS_TFM_1D
(unless we know 1D LUT is identity), so we never want to return here early.
We apply the LUT part of ColorTransform3x4 only in apply_lut_1d() which is
called near the end of that function.

Signed-off-by: Hugo Hu <hugo.hu@amd.com>
Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
---
 drivers/gpu/drm/amd/display/modules/color/color_gamma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
index 8601d371776e..369a89071217 100644
--- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
+++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
@@ -1569,7 +1569,8 @@ bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
 			output_tf->tf == TRANSFER_FUNCTION_SRGB) {
 		if (ramp == NULL)
 			return true;
-		if (ramp->is_identity || (!mapUserRamp && ramp->type == GAMMA_RGB_256))
+		if ((ramp->is_identity && ramp->type != GAMMA_CS_TFM_1D) ||
+				(!mapUserRamp && ramp->type == GAMMA_RGB_256))
 			return true;
 	}
 
-- 
2.17.1