FAILED: patch "[PATCH] drm/amdgpu: Only enable HDMI audio if display supports it" failed to apply to 5.10-stable tree
Subsystems (3)
Sasha Levin
maintainerThe patch below does not apply to the 5.10-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-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 0de95c96655c8a12df62e47871016f49e5cd8618
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 0de95c96655c8a12df62e47871016f49e5cd8618 Mon Sep 17 00:00:00 2001
From: renpanpan <[email protected]>
Date: Mon, 2 Nov 2026 17:49:29 +0800
Subject: [PATCH] drm/amdgpu: Only enable HDMI audio if display supports it
The amdgpu legacy DCE audio path (dce_v6/v8/v10) unconditionally calls audio_enable(pin, true) at the end of afmt_setmode(), regardless of whether the connected display advertises audio support in its EDID.
This causes a phantom HDMI audio output to appear for displays that have no audio capability (no basic audio bit, no Audio Data Block in EDID), because the GPU sets the AUDIO_ENABLED register bit, which drives the HDA codec's ELDV pin sense, making the codec report the jack as audio-available.
The radeon, nouveau, and dw-hdmi drivers all gate audio enablement on display_info.has_audio. Apply the same check to amdgpu's DCE afmt_setmode functions.
--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +3 -2
@@ -1705,8 +1705,9 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,WREG32 (mmAFMT_RAMP_CONTROL2 + dig->afmt->offset,0x00000001 );WREG32 (mmAFMT_RAMP_CONTROL3 + dig->afmt->offset,0x00000001 ); -/* enable audio after to setting up hw */ -dce_v10_0_audio_enable (adev, dig->afmt->pin, true); +/* Only enable audio if the display supports it */ +if (connector->display_info.has_audio) +dce_v10_0_audio_enable (adev, dig->afmt->pin, true); }static void dce_v10_0_afmt_enable (struct drm_encoder *encoder,bool enable)
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +3 -2
@@ -1748,8 +1748,9 @@ static void dce_v6_0_afmt_setmode(struct drm_encoder *encoder,dce_v6_0_audio_dp_enable (encoder,1 ); } -/* enable audio after setting up hw */ -dce_v6_0_audio_enable (adev, dig->afmt->pin, true); +/* Only enable audio if the display supports it */ +if (connector->display_info.has_audio) +dce_v6_0_audio_enable (adev, dig->afmt->pin, true); }static void dce_v6_0_afmt_enable (struct drm_encoder *encoder,bool enable)
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +3 -2
@@ -1653,8 +1653,9 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32 (mmAFMT_RAMP_CONTROL2 + offset,0x00000001 );WREG32 (mmAFMT_RAMP_CONTROL3 + offset,0x00000001 ); -/* enable audio after setting up hw */ -dce_v8_0_audio_enable (adev, dig->afmt->pin, true); +/* Only enable audio if the display supports it */ +if (connector->display_info.has_audio) +dce_v8_0_audio_enable (adev, dig->afmt->pin, true); }static void dce_v8_0_afmt_enable (struct drm_encoder *encoder,bool enable)
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 drm/amdgpu: Only enable HDMI audio if display supports it
From: renpanpan <[email protected]>
[ Upstream commit 0de95c96655c8a12df62e47871016f49e5cd8618 ]
The amdgpu legacy DCE audio path (dce_v6/v8/v10) unconditionally calls audio_enable(pin, true) at the end of afmt_setmode(), regardless of whether the connected display advertises audio support in its EDID.
This causes a phantom HDMI audio output to appear for displays that have no audio capability (no basic audio bit, no Audio Data Block in EDID), because the GPU sets the AUDIO_ENABLED register bit, which drives the HDA codec's ELDV pin sense, making the codec report the jack as audio-available.
The radeon, nouveau, and dw-hdmi drivers all gate audio enablement on display_info.has_audio. Apply the same check to amdgpu's DCE afmt_setmode functions.
--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +3 -2
@@ -1737,8 +1737,9 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,WREG32 (mmAFMT_RAMP_CONTROL2 + dig->afmt->offset,0x00000001 );WREG32 (mmAFMT_RAMP_CONTROL3 + dig->afmt->offset,0x00000001 ); -/* enable audio after to setting up hw */ -dce_v10_0_audio_enable (adev, dig->afmt->pin, true); +/* Only enable audio if the display supports it */ +if (drm_detect_monitor_audio (amdgpu_connector_edid (connector))) +dce_v10_0_audio_enable (adev, dig->afmt->pin, true); }static void dce_v10_0_afmt_enable (struct drm_encoder *encoder,bool enable)
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +3 -2
@@ -1702,8 +1702,9 @@ static void dce_v6_0_afmt_setmode(struct drm_encoder *encoder,dce_v6_0_audio_dp_enable (encoder,1 ); } -/* enable audio after setting up hw */ -dce_v6_0_audio_enable (adev, dig->afmt->pin, true); +/* Only enable audio if the display supports it */ +if (drm_detect_monitor_audio (amdgpu_connector_edid (connector))) +dce_v6_0_audio_enable (adev, dig->afmt->pin, true); }static void dce_v6_0_afmt_enable (struct drm_encoder *encoder,bool enable)
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +3 -2
@@ -1666,8 +1666,9 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,WREG32 (mmAFMT_RAMP_CONTROL2 + offset,0x00000001 );WREG32 (mmAFMT_RAMP_CONTROL3 + offset,0x00000001 ); -/* enable audio after setting up hw */ -dce_v8_0_audio_enable (adev, dig->afmt->pin, true); +/* Only enable audio if the display supports it */ +if (drm_detect_monitor_audio (amdgpu_connector_edid (connector))) +dce_v8_0_audio_enable (adev, dig->afmt->pin, true); }static void dce_v8_0_afmt_enable (struct drm_encoder *encoder,bool enable)
Signature · 1 line
2.53.0