From: sashiko-bot@kernel.org
To: "Fangzhi Zuo" <jerry.zuo@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 1/4] drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block
Date: Fri, 14 Aug 2026 16:55:05 +0000 [thread overview]
Message-ID: <20260814165505.905321F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814164344.3098143-2-jerry.zuo@amd.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The VTEM info packet incorrectly overwrites the AMD FreeSync (SPD) info packet in the local `vrr_infopacket` variable, causing the FreeSync metadata to be lost and the VTEM packet to be programmed into the wrong hardware slot.
- [High] Unsafe dereference of the deprecated `new_stream->sink` pointer without a NULL check inside a spinlock, risking a kernel panic and system deadlock.
--
--- Patch [1]: [PATCH v4 1/4] drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block ---
commit ac51682620be921a897de496468475a6c9820661
Author: Fangzhi Zuo <Jerry.Zuo@amd.com>
Subject: drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block
This commit adds HDMI 2.1 FreeSync support by parsing the AMD VSDB for HDMI
FRL signals. It updates the FreeSync capabilities and introduces a function to
build and send the VTEM info packet during the freesync state update.
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c
[ ... ]
> @@ -229,6 +230,9 @@ void amdgpu_dm_update_freesync_state_on_stream(
> &vrr_infopacket,
> pack_sdp_v1_3);
>
> + if (new_stream->sink->sink_signal == SIGNAL_TYPE_HDMI_FRL)
[Severity: High]
Is it possible for new_stream->sink to be NULL here?
Existing KUnit tests like dm_test_update_freesync_state_default_packet()
allocate dummy streams with a NULL sink. Phantom streams or writeback setups
can also have a NULL sink.
Since this check occurs inside the event_lock spinlock, would a NULL sink
cause a kernel panic and a system deadlock? Would it be safer to verify
new_stream->sink is not NULL before dereferencing it, or use the already
available new_stream->signal instead?
> + mod_build_infopacket_vtem(new_stream, &vrr_params, 0, &vrr_infopacket);
[Severity: High]
Does this overwrite the existing AMD FreeSync metadata stored in
vrr_infopacket?
Looking at the newly added mod_build_infopacket_vtem(), it calls memset()
on the passed infopacket:
drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c:mod_build_infopacket_vtem() {
memset(infopacket, 0, sizeof(struct dc_info_packet));
...
}
Since vrr_infopacket was just populated by mod_freesync_build_vrr_infopacket()
immediately before this block, the memset() appears to erase the SPD packet.
Furthermore, this assigns the VTEM packet to the vrr_infopacket variable,
which is later routed to the SPD hardware slot in set_spd_info_packet().
Should the VTEM packet be stored in new_stream->vtem_infopacket instead to
preserve the FreeSync packet and ensure VTEM is sent in the correct slot?
> +
> new_crtc_state->freesync_vrr_info_changed |=
> (memcmp(&new_crtc_state->vrr_infopacket,
> &vrr_infopacket,
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260814164344.3098143-1-jerry.zuo@amd.com?part=1
next prev parent reply other threads:[~2026-08-14 16:55 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 17:17 [PATCH 1/4] drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block Fangzhi Zuo
2026-07-30 17:17 ` [PATCH 2/4] drm/edid: parse HDMI 2.1 gaming (ALLM/VRR) capabilities from HF-VSDB Fangzhi Zuo
2026-07-31 19:55 ` Harry Wentland
2026-07-30 17:17 ` [PATCH 3/4] drm/amd/display: Add HDMI 2.1 VRR support " Fangzhi Zuo
2026-07-31 19:57 ` Harry Wentland
2026-08-06 20:17 ` Zuo, Jerry
2026-07-30 17:17 ` [PATCH 4/4] drm/amd/display: Add HDMI ALLM support Fangzhi Zuo
2026-07-31 20:11 ` Harry Wentland
2026-08-06 20:20 ` Zuo, Jerry
2026-07-31 19:37 ` [PATCH 1/4] drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block Harry Wentland
2026-08-06 20:54 ` [PATCH v2 0/4] HDMI 2.1 VRR and ALLM support Fangzhi Zuo
2026-08-06 20:54 ` [PATCH v2 1/4] drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block Fangzhi Zuo
2026-08-06 21:13 ` sashiko-bot
2026-08-06 20:54 ` [PATCH v2 2/4] drm/edid: parse HDMI 2.1 gaming (ALLM/VRR) capabilities from HF-VSDB Fangzhi Zuo
2026-08-06 20:54 ` [PATCH v2 3/4] drm/amd/display: Add HDMI 2.1 VRR support " Fangzhi Zuo
2026-08-06 21:07 ` sashiko-bot
2026-08-06 20:54 ` [PATCH v2 4/4] drm/amd/display: Add HDMI ALLM support Fangzhi Zuo
2026-08-06 21:08 ` sashiko-bot
2026-08-10 21:04 ` Harry Wentland
2026-08-11 0:39 ` [PATCH v3 0/4] HDMI 2.1 VRR and " Fangzhi Zuo
2026-08-11 0:39 ` [PATCH v3 1/4] drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block Fangzhi Zuo
2026-08-11 0:39 ` [PATCH v3 2/4] drm/edid: parse HDMI 2.1 gaming (ALLM/VRR) capabilities from HF-VSDB Fangzhi Zuo
2026-08-11 17:35 ` Harry Wentland
2026-08-11 17:38 ` Deucher, Alexander
2026-08-11 0:39 ` [PATCH v3 3/4] drm/amd/display: Add HDMI 2.1 VRR support " Fangzhi Zuo
2026-08-11 0:39 ` [PATCH v3 4/4] drm/amd/display: Add HDMI ALLM support Fangzhi Zuo
2026-08-11 13:48 ` Derek Foreman
2026-08-11 15:23 ` Daniel Stone
2026-08-11 17:42 ` Harry Wentland
2026-08-13 10:29 ` Daniel Stone
2026-08-13 13:36 ` Harry Wentland
2026-08-12 0:43 ` Zuo, Jerry
2026-08-13 8:35 ` Daniel Stone
2026-08-14 15:41 ` Zuo, Jerry
2026-08-14 16:43 ` [PATCH v4 0/4] HDMI 2.1 VRR and " Fangzhi Zuo
2026-08-14 16:43 ` [PATCH v4 1/4] drm/amd/display: Add 2.1 FreeSync support for AMD VSDB EDID Block Fangzhi Zuo
2026-08-14 16:55 ` sashiko-bot [this message]
2026-08-14 16:43 ` [PATCH v4 2/4] drm/edid: parse HDMI 2.1 gaming (ALLM/VRR) capabilities from HF-VSDB Fangzhi Zuo
2026-08-14 16:49 ` sashiko-bot
2026-08-14 16:43 ` [PATCH v4 3/4] drm/amd/display: Add HDMI 2.1 VRR support " Fangzhi Zuo
2026-08-14 16:55 ` sashiko-bot
2026-08-14 16:43 ` [PATCH v4 4/4] drm/amd/display: Enable HDMI ALLM for Gaming-VRR Fangzhi Zuo
2026-08-14 17:01 ` sashiko-bot
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=20260814165505.905321F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jerry.zuo@amd.com \
--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 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.