aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0105-drm-amd-display-debug-option-to-disable-color-module.patch
blob: 3abf2a3b709b92af3c71e3cf0314725049373b92 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From d7ee6b84719d75e44cc47f2fb10574fc782d00e0 Mon Sep 17 00:00:00 2001
From: Tony Cheng <tony.cheng@amd.com>
Date: Fri, 23 Dec 2016 07:20:53 -0500
Subject: [PATCH 0105/4131] drm/amd/display: debug option to disable color
 module fucntionality

Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++++++------
 drivers/gpu/drm/amd/display/dc/dc.h      |  1 +
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index e368d66..aca13d1 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1452,8 +1452,11 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 				}
 			}
 
-			if (updates[i].gamma && updates[i].gamma !=
-				surface->public.gamma_correction) {
+			if (dc->debug.disable_color_module)
+				continue;  /* skip below color updates */
+
+			if (updates[i].gamma &&
+				updates[i].gamma != surface->public.gamma_correction) {
 				if (surface->public.gamma_correction != NULL)
 					dc_gamma_release(surface->public.
 							gamma_correction);
@@ -1464,8 +1467,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 			}
 
 			if (updates[i].in_transfer_func &&
-					updates[i].in_transfer_func !=
-					surface->public.in_transfer_func) {
+				updates[i].in_transfer_func != surface->public.in_transfer_func) {
 				if (surface->public.in_transfer_func != NULL)
 					dc_transfer_func_release(
 							surface->public.
@@ -1478,8 +1480,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 			}
 
 			if (updates[i].out_transfer_func &&
-					updates[i].out_transfer_func !=
-					stream->public.out_transfer_func) {
+				updates[i].out_transfer_func != stream->public.out_transfer_func) {
 				if (stream->public.out_transfer_func != NULL)
 					dc_transfer_func_release(
 							stream->public.
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 823a872..23f41b6 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -148,6 +148,7 @@ struct dc_debug {
 	bool disable_clock_gate;
 	bool disable_dmcu;
 	bool disable_hdmi_deep_color;
+	bool disable_color_module;
 };
 
 struct dc {
-- 
2.7.4