Skip to content

drm/i915/audio/ASoC/SOF: Add flag to skip device link creation for audio component#5458

Merged
bardliao merged 4 commits intothesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/no-device-link-for-hdmi-01
Jul 1, 2025
Merged

drm/i915/audio/ASoC/SOF: Add flag to skip device link creation for audio component#5458
bardliao merged 4 commits intothesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/no-device-link-for-hdmi-01

Conversation

@ujfalusi
Copy link
Collaborator

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.

ujfalusi added 4 commits June 13, 2025 16:25
…nent

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@linux.intel.com>
The hdac_bus->audio_component is used as a pointer to a
'struct drm_audio_component' or to 'struct i915_audio_component' while it's
type is 'struct drm_audio_component'.

Convert it to void* to avoid this abuse.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…ay audio

i915_no_device_link can be set by audio stacks where there is no direct
hardware dependency exist between display and HDA.
The flag will be passed to acomp->no_device_link for the display stack to
skip the creation of the display link if it is set.

By default the link creation will remain to ensure that it is skipped only
when it is possible by the architecture.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
In systems where SOF is used there is no direct dependency between HDA
controller and the display stack, there is no need to create the device
link.

Without the device link it will be allowed to suspend and resume the
display and audio hardware in parallel.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
@ujfalusi
Copy link
Collaborator Author

Replaces: #5433

@kv2019i
Copy link
Collaborator

kv2019i commented Jun 17, 2025

I've been doing some spot testing, and this seems to work for all cases I've tried. The get_power() via component framework is covering basicly all SOF needs.

It would be good to understand why this is ok now and mention it in the commit message.. The original link was not added for discrete-gfx cases (Intel had none in 2018). If you look at Imre's commit, aef9f33 , it refers to ensuring system resume/suspend ordering. Looking at the 2018 code in i915, I can't directly say what is the problem prevented here (on display side). I believe the volume/dominant platforms at the time (Coffee and Sky Lake) had the audio controller on a separate PCI device (see HDA_CONTROLLER_IN_GPU() macro in hda_intel for exceptions), so the link was not added just for HDA_CONTROLLER_IN_GPU platforms.

This would be seem some dependency on display side. For audio, if get_power() via component framework is guaranteed to work even if the system suspend/resume ordering can be different (or fully parallel), then this PR should be ok. If display side is ok ti proceed, I'm ok as well.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I would add in a commit message showing the improvement to resume time.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed the change with @ujfalusi and we concluded the the RPM call from asoc core is still serializing i915/xe and audio before PCMs are exposed to user-space in resume. So from SOF perspective this is ok.

@bardliao bardliao merged commit d431348 into thesofproject:topic/sof-dev Jul 1, 2025
7 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants