AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wayne Lin <Wayne.Lin@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <Harry.Wentland@amd.com>, <Sunpeng.Li@amd.com>,
	<Rodrigo.Siqueira@amd.com>, <Aurabindo.Pillai@amd.com>,
	<roman.li@amd.com>, <wayne.lin@amd.com>,
	<agustin.gutierrez@amd.com>, <chiahsuan.chung@amd.com>,
	<jerry.zuo@amd.com>, <zaeem.mohamed@amd.com>,
	Dillon Varone <dillon.varone@amd.com>,
	Alvin Lee <alvin.lee2@amd.com>
Subject: [PATCH 13/22] drm/amd/display: Force enable 3DLUT DMA check for dcn401 in DML
Date: Tue, 30 Jul 2024 15:18:34 +0800	[thread overview]
Message-ID: <20240730071843.880430-14-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20240730071843.880430-1-Wayne.Lin@amd.com>

From: Dillon Varone <dillon.varone@amd.com>

[WHY]
Currently TR0 (trip 0) is not properly budgeting for urgent latency in
DML2.1. This results in overly aggressive prefetch schedules that are
vulnerable to request return jitter, resulting in severe underflow at
the start of the frame.

[HOW]
Forcing 3DLUT DMA check to enable causes urgent latency to be budgeted
properly into the prefetch schedule, avoiding the vulnerability.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
---
 .../amd/display/dc/dml2/dml21/dml21_translation_helper.c    | 6 ++++--
 drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h          | 1 +
 .../drm/amd/display/dc/resource/dcn401/dcn401_resource.c    | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c
index b0de8920f7e7..006667aa961b 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_translation_helper.c
@@ -816,6 +816,7 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
 
 	if (plane_state->mcm_luts.lut3d_data.lut3d_src == DC_CM2_TRANSFER_FUNC_SOURCE_VIDMEM) {
 		plane->tdlut.setup_for_tdlut = true;
+
 		switch (plane_state->mcm_luts.lut3d_data.gpu_mem_params.layout) {
 		case DC_CM2_GPU_MEM_LAYOUT_3D_SWIZZLE_LINEAR_RGB:
 		case DC_CM2_GPU_MEM_LAYOUT_3D_SWIZZLE_LINEAR_BGR:
@@ -825,6 +826,7 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
 			plane->tdlut.tdlut_addressing_mode = dml2_tdlut_simple_linear;
 			break;
 		}
+
 		switch (plane_state->mcm_luts.lut3d_data.gpu_mem_params.size) {
 		case DC_CM2_GPU_MEM_SIZE_171717:
 			plane->tdlut.tdlut_width_mode = dml2_tdlut_width_17_cube;
@@ -833,8 +835,8 @@ static void populate_dml21_plane_config_from_plane_state(struct dml2_context *dm
 			//plane->tdlut.tdlut_width_mode = dml2_tdlut_width_flatten; // dml2_tdlut_width_flatten undefined
 			break;
 		}
-	} else
-		plane->tdlut.setup_for_tdlut = false;
+	}
+	plane->tdlut.setup_for_tdlut |= dml_ctx->config.force_tdlut_enable;
 
 	plane->dynamic_meta_data.enable = false;
 	plane->dynamic_meta_data.lines_before_active_required = 0;
diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h b/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h
index 023325e8f6e2..0f944fcfd5a5 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h
@@ -236,6 +236,7 @@ struct dml2_configuration_options {
 
 	bool use_clock_dc_limits;
 	bool gpuvm_enable;
+	bool force_tdlut_enable;
 	struct dml2_soc_bb *bb_from_dmub;
 };
 
diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
index 3e76732ac0dc..ec676d269d33 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c
@@ -2099,6 +2099,7 @@ static bool dcn401_resource_construct(
 	dc->dml2_options.use_native_soc_bb_construction = true;
 	dc->dml2_options.minimize_dispclk_using_odm = true;
 	dc->dml2_options.map_dc_pipes_with_callbacks = true;
+	dc->dml2_options.force_tdlut_enable = true;
 
 	resource_init_common_dml2_callbacks(dc, &dc->dml2_options);
 	dc->dml2_options.callbacks.can_support_mclk_switch_using_fw_based_vblank_stretch = &dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch;
-- 
2.37.3


  parent reply	other threads:[~2024-07-30  7:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30  7:18 [PATCH 00/22] DC Patches July 29, 2024 Wayne Lin
2024-07-30  7:18 ` [PATCH 01/22] drm/amd/display: Add missing DCN314 to the DML Makefile Wayne Lin
2024-07-30  7:18 ` [PATCH 02/22] drm/amd/display: Cleanup dml2 and dc/resource Makefile Wayne Lin
2024-07-30  7:18 ` [PATCH 03/22] drm/amd/display: Remove useless defines Wayne Lin
2024-07-30  7:18 ` [PATCH 04/22] drm/amd/display: Remove unused fields from dmub_cmd_update_dirty_rect_data Wayne Lin
2024-07-30  7:18 ` [PATCH 05/22] drm/amd/display: Remove unused fields from dc_caps Wayne Lin
2024-07-30  7:18 ` [PATCH 06/22] drm/amd/display: Add missing program DET segment call to pipe init Wayne Lin
2024-07-30  7:18 ` [PATCH 07/22] drm/amd/display: Fix overlay with pre-blend color processing Wayne Lin
2024-07-30  7:18 ` [PATCH 08/22] drm/amd/display: Add stream and char control callback Wayne Lin
2024-07-30  7:18 ` [PATCH 09/22] drm/amd/display: fix a UBSAN warning in DML2.1 Wayne Lin
2024-07-30  7:18 ` [PATCH 10/22] drm/amd/display: Print Pcon FRL Link BW in Debug Message Wayne Lin
2024-07-30  7:18 ` [PATCH 11/22] drm/amd/display: Disable SubVP if Hardware Rotation is Used Wayne Lin
2024-07-30  7:18 ` [PATCH 12/22] drm/amd/display: Assume 32 bpp cursor in DML21 Wayne Lin
2024-07-30  7:18 ` Wayne Lin [this message]
2024-07-30  7:18 ` [PATCH 14/22] drm/amd/display: Re-enable panel replay feature Wayne Lin
2024-07-30  7:18 ` [PATCH 15/22] drm/amd/display: Add clock control callbacks Wayne Lin
2024-07-30  7:18 ` [PATCH 16/22] drm/amd/display: skip crtc power down when ips switch Wayne Lin
2024-07-30  7:18 ` [PATCH 17/22] drm/amd/display: Skip Recompute DSC Params if no Stream on Link Wayne Lin
2024-07-30  7:18 ` [PATCH 18/22] drm/amd/display: Address coverity change Wayne Lin
2024-07-30  7:18 ` [PATCH 19/22] drm/amd/display: Add clock control callbacks Wayne Lin
2024-07-30  7:18 ` [PATCH 20/22] drm/amd/display: Revert Avoid overflow assignment Wayne Lin
2024-07-30  7:18 ` [PATCH 21/22] drm/amd/display: Add DML2.1 option to disable DRR clamped P-State Strategies Wayne Lin
2024-07-30  7:18 ` [PATCH 22/22] drm/amd/display: 3.2.295 Wayne Lin
2024-08-06 13:10 ` [PATCH 00/22] DC Patches July 29, 2024 Wheeler, Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240730071843.880430-14-Wayne.Lin@amd.com \
    --to=wayne.lin@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=agustin.gutierrez@amd.com \
    --cc=alvin.lee2@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=chiahsuan.chung@amd.com \
    --cc=dillon.varone@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=zaeem.mohamed@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox