mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Initialize missing TD-LUT programming inputs
@ 2026-10-11  7:45 Avi Weiss
  2026-10-20 14:08 ` Harry Wentland
  0 siblings, 1 reply; 2+ messages in thread
From: Avi Weiss @ 2026-10-11  7:45 UTC (permalink / raw)
  To: austin.zheng, jun.lei
  Cc: harry.wentland, sunpeng.li, siqueira, alexander.deucher,
	aurabindo.pillai, amd-gfx, dri-devel, linux-kernel

dml_core_mode_programming() memsets (clears) its scratch structure
before calculating TD-LUT settings, but does not initialize
tdlut_mpc_width_flag or is_gfx11.

Both inputs therefore remain false regardless of the plane
configuration which can result in incorrect calculations.

Initialize both fields using the same sources as the mode
support path (now both paths are aligned).

Fixes: 70839da63605 ("drm/amd/display: Add new DCN401 sources")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 .../dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c        | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c
index 72acf12e9251..0ee385e8ba5f 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c
@@ -11074,6 +11074,8 @@ static bool dml_core_mode_programming(struct dml2_core_calcs_mode_programming_ex
 		calculate_tdlut_setting_params->cursor_buffer_size = mode_lib->ip.cursor_buffer_size;
 		calculate_tdlut_setting_params->gpuvm_enable = display_cfg->gpuvm_enable;
 		calculate_tdlut_setting_params->gpuvm_page_size_kbytes = display_cfg->plane_descriptors[k].overrides.gpuvm_min_page_size_kbytes;
+		calculate_tdlut_setting_params->tdlut_mpc_width_flag = display_cfg->plane_descriptors[k].tdlut.tdlut_mpc_width_flag;
+		calculate_tdlut_setting_params->is_gfx11 = dml_get_gfx_version(display_cfg->plane_descriptors[k].surface.tiling);
 
 		// output
 		calculate_tdlut_setting_params->tdlut_pte_bytes_per_frame = &s->tdlut_pte_bytes_per_frame[k];
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/display: Initialize missing TD-LUT programming inputs
  2026-10-11  7:45 [PATCH] drm/amd/display: Initialize missing TD-LUT programming inputs Avi Weiss
@ 2026-10-20 14:08 ` Harry Wentland
  0 siblings, 0 replies; 2+ messages in thread
From: Harry Wentland @ 2026-10-20 14:08 UTC (permalink / raw)
  To: Avi Weiss
  Cc: austin.zheng, jun.lei, sunpeng.li, siqueira, alexander.deucher,
	aurabindo.pillai, amd-gfx, dri-devel, linux-kernel

On 10/11/26 03:45, Avi Weiss wrote:
> dml_core_mode_programming() memsets (clears) its scratch structure
> before calculating TD-LUT settings, but does not initialize
> tdlut_mpc_width_flag or is_gfx11.
>
> Both inputs therefore remain false regardless of the plane
> configuration which can result in incorrect calculations.
>
> Initialize both fields using the same sources as the mode
> support path (now both paths are aligned).
>
> Fixes: 70839da63605 ("drm/amd/display: Add new DCN401 sources")
> Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

The issue sashiko found is also a real problem but somewhat
unrelated.

Harry

> ---
>  .../dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c        | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c
> index 72acf12e9251..0ee385e8ba5f 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4_calcs.c
> @@ -11074,6 +11074,8 @@ static bool dml_core_mode_programming(struct dml2_core_calcs_mode_programming_ex
>  		calculate_tdlut_setting_params->cursor_buffer_size = mode_lib->ip.cursor_buffer_size;
>  		calculate_tdlut_setting_params->gpuvm_enable = display_cfg->gpuvm_enable;
>  		calculate_tdlut_setting_params->gpuvm_page_size_kbytes = display_cfg->plane_descriptors[k].overrides.gpuvm_min_page_size_kbytes;
> +		calculate_tdlut_setting_params->tdlut_mpc_width_flag = display_cfg->plane_descriptors[k].tdlut.tdlut_mpc_width_flag;
> +		calculate_tdlut_setting_params->is_gfx11 = dml_get_gfx_version(display_cfg->plane_descriptors[k].surface.tiling);
>  
>  		// output
>  		calculate_tdlut_setting_params->tdlut_pte_bytes_per_frame = &s->tdlut_pte_bytes_per_frame[k];


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-20 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11  7:45 [PATCH] drm/amd/display: Initialize missing TD-LUT programming inputs Avi Weiss
2026-10-20 14:08 ` Harry Wentland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®