FAILED: patch "[PATCH] drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP HDR" failed to apply to 6.12-stable tree
Sasha Levin
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 81f923b065801c7d30042bcda31ccb9449b4f58b
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 81f923b065801c7d30042bcda31ccb9449b4f58b Mon Sep 17 00:00:00 2001
From: Melissa Wen <[email protected]>
Date: Wed, 21 Oct 2026 14:29:25 +0200
Subject: [PATCH] drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP
HDR
Commit c2791297013e ("drm/amd/display: Add color bit info to freesync infoframe") created the app_tf interface for FreeSync HDR and commit c21a764a98cb ("drm/amd/display: Send PQ bit in AMD VSIF") used it to set PB9 bit 5 (PQ EOTF) in v2/v3 AMD Freesync infopacket. However, Linux never made use of this interface: DM ignores what userspace sets regarding HDR and always passes TRANSFER_FUNC_UNKNOWN as app_tf, so the PQ bit is never set in the infopacket received by the eDP panel.
Check the EOTF in the HDR static metadata and set the PQ bit in Freesync infopacket for DP accordingly. This fixes gray-washed HDR on KDE/GNOME on Framework 13 Pro AI 9 HX 370 (DCN 3.5) and may fix similar issues on other VRR-capable panels that advertise Replay in its AMD VSDB.
It doesn't affect color/EOTF bits on infopackets for SDR and native HDMI.
--- .../display/amdgpu_dm/amdgpu_dm_freesync.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_freesync.c +18 -1
@@ -173,6 +173,18 @@ void amdgpu_dm_get_freesync_config_for_crtc( }EXPORT_IF_KUNIT (amdgpu_dm_get_freesync_config_for_crtc); +#define DP_HDR_SDP_EOTF_IDX 2 + +static bool dm_dp_in_hdr_mode (const struct dc_stream_state *stream) +{ +const struct dc_info_packet *hdr = &stream->hdr_static_metadata; + +if (!dc_is_dp_signal (stream->signal) || !hdr->valid) +return false; + +return hdr->sb[DP_HDR_SDP_EOTF_IDX ] ==HDMI_EOTF_SMPTE_ST2084 ; +} + void amdgpu_dm_update_freesync_state_on_stream( struct amdgpu_display_manager *dm, struct dm_crtc_state *new_crtc_state,
@@ -189,6 +201,7 @@ void amdgpu_dm_update_freesync_state_on_stream(bool pack_sdp_v1_3 = false;struct amdgpu_dm_connector *aconn;enum vrr_packet_type packet_type =PACKET_TYPE_VRR ; +enum color_transfer_func app_tf;if (!new_stream)return ;
@@ -240,12 +253,16 @@ void amdgpu_dm_update_freesync_state_on_stream( &new_stream->adaptive_sync_infopacket); } + app_tf =dm_dp_in_hdr_mode (new_stream) ? +TRANSFER_FUNC_PQ2084 : +TRANSFER_FUNC_UNKNOWN ; +mod_freesync_build_vrr_infopacket ( dm->freesync_module, new_stream, &vrr_params, packet_type, -TRANSFER_FUNC_UNKNOWN , + app_tf, &vrr_infopacket, pack_sdp_v1_3);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 drm/amd/display: Signal PQ EOTF in FreeSync infopacket for DP HDR
From: Melissa Wen <[email protected]>
[ Upstream commit 81f923b065801c7d30042bcda31ccb9449b4f58b ]
Commit c2791297013e ("drm/amd/display: Add color bit info to freesync infoframe") created the app_tf interface for FreeSync HDR and commit c21a764a98cb ("drm/amd/display: Send PQ bit in AMD VSIF") used it to set PB9 bit 5 (PQ EOTF) in v2/v3 AMD Freesync infopacket. However, Linux never made use of this interface: DM ignores what userspace sets regarding HDR and always passes TRANSFER_FUNC_UNKNOWN as app_tf, so the PQ bit is never set in the infopacket received by the eDP panel.
Check the EOTF in the HDR static metadata and set the PQ bit in Freesync infopacket for DP accordingly. This fixes gray-washed HDR on KDE/GNOME on Framework 13 Pro AI 9 HX 370 (DCN 3.5) and may fix similar issues on other VRR-capable panels that advertise Replay in its AMD VSDB.
It doesn't affect color/EOTF bits on infopackets for SDR and native HDMI.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +11 -1
@@ -8817,6 +8817,8 @@ static void prepare_flip_isr(struct amdgpu_crtc *acrtc) acrtc->crtc_id); } +#define DP_HDR_SDP_EOTF_IDX 2 + static void update_freesync_state_on_stream( struct amdgpu_display_manager *dm, struct dm_crtc_state *new_crtc_state,
@@ -8832,6 +8834,8 @@ static void update_freesync_state_on_stream(bool pack_sdp_v1_3 = false;struct amdgpu_dm_connector *aconn;enum vrr_packet_type packet_type =PACKET_TYPE_VRR ; +enum color_transfer_func app_tf; +const struct dc_info_packet *hdr;if (!new_stream)return ;
@@ -8883,12 +8887,18 @@ static void update_freesync_state_on_stream( &new_stream->adaptive_sync_infopacket); } + hdr = &new_stream->hdr_static_metadata; + app_tf =dc_is_dp_signal (new_stream->signal) && hdr->valid && + hdr->sb[DP_HDR_SDP_EOTF_IDX ] ==HDMI_EOTF_SMPTE_ST2084 ? +TRANSFER_FUNC_PQ2084 : +TRANSFER_FUNC_UNKNOWN ; +mod_freesync_build_vrr_infopacket ( dm->freesync_module, new_stream, &vrr_params, packet_type, -TRANSFER_FUNC_UNKNOWN , + app_tf, &vrr_infopacket, pack_sdp_v1_3);
Signature · 1 line
2.53.0