[RFC 1/4] drm/i915/audio: Add flag to skip device link creation for audio component

Peter Ujfalusi peter.ujfalusi at linux.intel.com
Wed Jun 25 14:02:19 UTC 2025


When there is no direct dependency between audio and display there is no
reason to add device link, which forces indirect PM dependency between
the independent (in power and clock sense) subsystems.
The audio stack takes care of powering up the display codec when needed,
but during suspend and resume there is really no need to serialize the two
devices.

There are still cases when the dependency is valid, like on discrete gfx
cards. The default behavior remains the same: device link is added, which
can be revised if desired.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_audio.c | 13 ++++++++-----
 include/drm/intel/i915_component.h         |  6 ++++++
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
index 55af3a553c58..ddc254ab065e 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -1263,10 +1263,12 @@ static int intel_audio_component_bind(struct device *drv_kdev,
 	if (drm_WARN_ON(display->drm, acomp->base.ops || acomp->base.dev))
 		return -EEXIST;
 
-	if (drm_WARN_ON(display->drm,
-			!device_link_add(hda_kdev, drv_kdev,
-					 DL_FLAG_STATELESS)))
-		return -ENOMEM;
+	if (!acomp->no_device_link) {
+		if (drm_WARN_ON(display->drm,
+				!device_link_add(hda_kdev, drv_kdev,
+						DL_FLAG_STATELESS)))
+			return -ENOMEM;
+	}
 
 	drm_modeset_lock_all(display->drm);
 	acomp->base.ops = &intel_audio_component_ops;
@@ -1292,7 +1294,8 @@ static void intel_audio_component_unbind(struct device *drv_kdev,
 	display->audio.component = NULL;
 	drm_modeset_unlock_all(display->drm);
 
-	device_link_remove(hda_kdev, drv_kdev);
+	if (!acomp->no_device_link)
+		device_link_remove(hda_kdev, drv_kdev);
 
 	if (display->audio.power_refcount)
 		drm_err(display->drm,
diff --git a/include/drm/intel/i915_component.h b/include/drm/intel/i915_component.h
index 4ea3b17aa143..ed87eb09f768 100644
--- a/include/drm/intel/i915_component.h
+++ b/include/drm/intel/i915_component.h
@@ -51,6 +51,12 @@ struct i915_audio_component {
 	 * @aud_sample_rate: the array of audio sample rate per port
 	 */
 	int aud_sample_rate[MAX_PORTS];
+
+	/**
+	 * @no_device_link: Do not add device link for HDMI audio
+	 */
+	bool no_device_link:1;
+
 };
 
 #endif /* _I915_COMPONENT_H_ */
-- 
2.50.0



More information about the Intel-gfx-trybot mailing list