[PATCH 04/10] drm/amd/display: debug option to disable color module fucntionality

Harry Wentland harry.wentland at amd.com
Thu Dec 29 18:29:37 UTC 2016


From: Tony Cheng <tony.cheng at amd.com>

Change-Id: I1793eeeff0e38d1b85cb64c0a1496dc5567cc526
Signed-off-by: Tony Cheng <tony.cheng at amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at 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 e368d660362f..aca13d1cd4bb 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 823a87224498..23f41b690c02 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.9.3



More information about the amd-gfx mailing list