From e73b59b7e0cdecf0663b76f77b770c88b2d61604 Mon Sep 17 00:00:00 2001 From: Dmytro Laktyushkin Date: Fri, 19 May 2017 13:01:35 -0400 Subject: [PATCH] drm/amd/display: add always_scale debug flag to dc Signed-off-by: Dmytro Laktyushkin Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/dc.h | 1 + .../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;