[PATCH 01/19] drm/amd/display: add always_scale debug flag to dc

Harry Wentland harry.wentland at amd.com
Wed May 31 15:52:00 UTC 2017


From: Dmytro Laktyushkin <Dmytro.Laktyushkin at amd.com>

Change-Id: Ie2f36ef791ae61da6a806c1b6ad6195db52afd83
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc.h                    |  1 +
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c | 14 +++++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index f2efa32fe4ac..3b35487897b7 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -181,6 +181,7 @@ struct dc_debug {
 	int urgent_latency_ns;
 	int percent_of_ideal_drambw;
 	int dram_clock_change_latency_ns;
+	int always_scale;
 #endif
 	bool disable_pplib_clock_request;
 	bool disable_clock_gate;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c
index 3718fb5a3238..609805877508 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c
@@ -157,7 +157,8 @@ static void transform_set_otg_blank(
 			OTG_V_BLANK_END, v_blank_end);
 }
 
-static enum dscl_mode_sel get_dscl_mode(const struct scaler_data *data)
+static enum dscl_mode_sel get_dscl_mode(
+		const struct scaler_data *data, bool dbg_always_scale)
 {
 	const long long one = dal_fixed31_32_one.value;
 	bool ycbcr = false;
@@ -177,7 +178,8 @@ static enum dscl_mode_sel get_dscl_mode(const struct scaler_data *data)
 	if (data->ratios.horz.value == one
 			&& data->ratios.vert.value == one
 			&& data->ratios.horz_c.value == one
-			&& data->ratios.vert_c.value == one)
+			&& data->ratios.vert_c.value == one
+			&& !dbg_always_scale)
 		return DSCL_MODE_SCALING_444_BYPASS;
 
 	if (!format420) {
@@ -603,7 +605,8 @@ void transform_set_scaler_auto_scale(
 {
 	enum lb_memory_config lb_config;
 	struct dcn10_transform *xfm = TO_DCN10_TRANSFORM(xfm_base);
-	enum dscl_mode_sel dscl_mode = get_dscl_mode(scl_data);
+	enum dscl_mode_sel dscl_mode = get_dscl_mode(
+			scl_data, xfm_base->ctx->dc->debug.always_scale);
 	bool ycbcr = scl_data->format >= PIXEL_FORMAT_VIDEO_BEGIN
 				&& scl_data->format <= PIXEL_FORMAT_VIDEO_END;
 
@@ -611,7 +614,7 @@ void transform_set_scaler_auto_scale(
 
 	transform_set_otg_blank(xfm, scl_data);
 
-	REG_UPDATE(SCL_MODE, DSCL_MODE, get_dscl_mode(scl_data));
+	REG_UPDATE(SCL_MODE, DSCL_MODE, dscl_mode);
 
 	transform_set_viewport(xfm, &scl_data->viewport, &scl_data->viewport_c);
 
@@ -740,7 +743,8 @@ static void transform_set_scaler_manual_scale(
 {
 	enum lb_memory_config lb_config;
 	struct dcn10_transform *xfm = TO_DCN10_TRANSFORM(xfm_base);
-	enum dscl_mode_sel dscl_mode = get_dscl_mode(scl_data);
+	enum dscl_mode_sel dscl_mode = get_dscl_mode(
+			scl_data, xfm_base->ctx->dc->debug.always_scale);
 	bool ycbcr = scl_data->format >= PIXEL_FORMAT_VIDEO_BEGIN
 				&& scl_data->format <= PIXEL_FORMAT_VIDEO_END;
 
-- 
2.11.0



More information about the amd-gfx mailing list