From 694de3352fee93a5aa0d78453ede2c3cf6507350 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: May 17 2023 19:16:02 +0000 Subject: drm/amd/display: Add minimum Z8 residency debug option (bsc#1012628). --- diff --git a/patches.kernel.org/6.3.3-220-drm-amd-display-Add-minimum-Z8-residency-debug-.patch b/patches.kernel.org/6.3.3-220-drm-amd-display-Add-minimum-Z8-residency-debug-.patch new file mode 100644 index 0000000..3023b65 --- /dev/null +++ b/patches.kernel.org/6.3.3-220-drm-amd-display-Add-minimum-Z8-residency-debug-.patch @@ -0,0 +1,71 @@ +From: Nicholas Kazlauskas +Date: Fri, 17 Feb 2023 11:17:50 -0500 +Subject: [PATCH] drm/amd/display: Add minimum Z8 residency debug option +References: bsc#1012628 +Patch-mainline: 6.3.3 +Git-commit: 0db13eae41fcc67f408dbb3dfda59633c4fa03fb + +[ Upstream commit 0db13eae41fcc67f408dbb3dfda59633c4fa03fb ] + +[Why] +Allows finer control and tuning for debug and profiling. + +[How] +Add the debug option into DC. The default remains the same as before +for now. + +Reviewed-by: Jun Lei +Acked-by: Qingqing Zhuo +Signed-off-by: Nicholas Kazlauskas +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Stable-dep-of: d893f39320e1 ("drm/amd/display: Lowering min Z8 residency time") +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + drivers/gpu/drm/amd/display/dc/dc.h | 1 + + drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 1 + + drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 3 ++- + 3 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h +index 84caf1f6..3fb868f2 100644 +--- a/drivers/gpu/drm/amd/display/dc/dc.h ++++ b/drivers/gpu/drm/amd/display/dc/dc.h +@@ -795,6 +795,7 @@ struct dc_debug_options { + unsigned int force_odm_combine; //bit vector based on otg inst + unsigned int seamless_boot_odm_combine; + unsigned int force_odm_combine_4to1; //bit vector based on otg inst ++ int minimum_z8_residency_time; + bool disable_z9_mpc; + unsigned int force_fclk_khz; + bool enable_tri_buf; +diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +index 9ffba4c6..5c23c934 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +@@ -887,6 +887,7 @@ static const struct dc_plane_cap plane_cap = { + static const struct dc_debug_options debug_defaults_drv = { + .disable_z10 = false, + .enable_z9_disable_interface = true, ++ .minimum_z8_residency_time = 1000, + .psr_skip_crtc_disable = true, + .disable_dmcu = true, + .force_abm_enable = false, +diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +index d3ba65ef..f3cfc144 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +@@ -973,7 +973,8 @@ static enum dcn_zstate_support_state decide_zstate_support(struct dc *dc, struc + else if (context->stream_count == 1 && context->streams[0]->signal == SIGNAL_TYPE_EDP) { + struct dc_link *link = context->streams[0]->sink->link; + struct dc_stream_status *stream_status = &context->stream_status[0]; +- bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > 1000.0; ++ int minmum_z8_residency = dc->debug.minimum_z8_residency_time > 0 ? dc->debug.minimum_z8_residency_time : 1000; ++ bool allow_z8 = context->bw_ctx.dml.vba.StutterPeriod > (double)minmum_z8_residency; + bool is_pwrseq0 = link->link_index == 0; + + if (dc_extended_blank_supported(dc)) { +-- +2.35.3 + diff --git a/series.conf b/series.conf index c09a6e2..585d795 100644 --- a/series.conf +++ b/series.conf @@ -953,6 +953,7 @@ patches.kernel.org/6.3.3-217-drm-i915-mtl-Add-workarounds-Wa_14017066071-and.patch patches.kernel.org/6.3.3-218-drm-i915-mtl-Add-Wa_14017856879.patch patches.kernel.org/6.3.3-219-drm-i915-disable-sampler-indirect-state-in-bind.patch + patches.kernel.org/6.3.3-220-drm-amd-display-Add-minimum-Z8-residency-debug-.patch ######################################################## # Build fixes that apply to the vanilla kernel too.