From: sashiko-bot@kernel.org
To: "Avi Weiss" <thnkslprpt@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: Initialize missing TD-LUT programming inputs
Date: Sun, 11 Oct 2026 07:58:11 +0000 [thread overview]
Message-ID: <sashiko-outbox-167111@kernel.org> (raw)
In-Reply-To: <20261011074510.2495683-1-thnkslprpt@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] amd/display: Implicit cast of unsigned int to bool in is_gfx11 breaks GFX12
--
commit 6cadd8de043129ed240d5c445ed5c65b848832cc
Author: Avi Weiss <thnkslprpt@gmail.com>
drm/amd/display: Initialize missing TD-LUT programming inputs
This commit aligns the mode programming path with the mode support path by
explicitly initializing tdlut_mpc_width_flag and is_gfx11 inputs in
dml_core_mode_programming() for DCN401 sources.
Fixes: 70839da63605 ("drm/amd/display: Add new DCN401 sources")
> 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
> --- 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
> @@ -11052,6 +11052,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);
[Severity: High]
This problem wasn't introduced by this patch, but it appears this copies an
existing bug from dml_core_mode_support() into dml_core_mode_programming().
Looking at dml_get_gfx_version(), it returns an unsigned int 12 for GFX12
swizzle modes. When this result is assigned directly to the boolean field
is_gfx11, it will evaluate to true because any non-zero integer is true in C.
Could this cause GFX12 hardware to incorrectly use GFX11 TD-LUT pitch
alignment (like 256B instead of 128B), leading to display corruption?
Would it be better to use an explicit equality check here and in the mode
support path, such as:
is_gfx11 = (dml_get_gfx_version(...) == 11);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261011074510.2495683-1-thnkslprpt@gmail.com?part=1
prev parent reply other threads:[~2026-10-11 7:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 7:45 [PATCH] drm/amd/display: Initialize missing TD-LUT programming inputs Avi Weiss
2026-10-11 7:58 ` sashiko-bot [this message]
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=sashiko-outbox-167111@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=thnkslprpt@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.