From: sashiko-bot@kernel.org
To: "Adrian Betschart" <adrian.betschart@cinemaone.ch>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: Default HDMI RGB output to limited range on CTA modes
Date: Thu, 10 Sep 2026 18:29:22 +0000 [thread overview]
Message-ID: <20260910182923.3C5041F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260910181517.68781-1-adrian.betschart@cinemaone.ch>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] NULL pointer dereference in KUnit tests due to uninitialized `connector_state->connector` pointer.
--
commit 76d9dc4fc5efbfc79cdb3d3327ee0c10ae387dea
Author: Adrian Betschart <adrian.betschart@cinemaone.ch>
drm/amd/display: Default HDMI RGB output to limited range on CTA modes
This commit changes the default HDMI RGB output to limited range on CTA
modes by introducing the rgb_output_is_limited_range function. The function
evaluates the broadcast_rgb property and falls back to inspecting the
connector's display_info for HDMI capabilities when set to automatic.
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5796
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
[ ... ]
> @@ -734,6 +734,24 @@ get_aspect_ratio(const struct drm_display_mode *mode_in)
> +static bool rgb_output_is_limited_range(const struct dc_crtc_timing *dc_crtc_timing,
> + const struct drm_connector_state *connector_state)
> +{
> + switch (connector_state->hdmi.broadcast_rgb) {
> + case DRM_HDMI_BROADCAST_RGB_FULL:
> + return false;
> + case DRM_HDMI_BROADCAST_RGB_LIMITED:
> + return true;
> + default:
> + return connector_state->connector->display_info.is_hdmi &&
[Severity: Medium]
Will this cause a NULL pointer dereference during KUnit test execution?
The rgb_output_is_limited_range function dereferences
connector_state->connector to check display_info.is_hdmi in the default
broadcast RGB case.
Many KUnit tests for amdgpu_dm_get_output_color_space, such as
dm_test_output_color_space_default_rgb_full, allocate a dummy
drm_connector_state without explicitly initializing the connector pointer,
leaving it NULL.
When these tests run, they will hit this path and crash when evaluating
connector_state->connector->display_info.is_hdmi. Could we add a check for
connector_state->connector, or update the KUnit tests to initialize it?
> + dc_crtc_timing->vic > 1;
> + }
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260910181517.68781-1-adrian.betschart@cinemaone.ch?part=1
next prev parent reply other threads:[~2026-09-10 18:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 18:15 [PATCH] drm/amd/display: Default HDMI RGB output to limited range on CTA modes Adrian Betschart
2026-09-10 18:29 ` sashiko-bot [this message]
2026-09-10 18:56 ` [PATCH v2] " Adrian Betschart
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=20260910182923.3C5041F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=adrian.betschart@cinemaone.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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