[alsa-devel] [PATCH 0/4] drm_audio_component support for AMD/ATI HDMI codecs

Takashi Iwai tiwai at suse.de
Tue Jul 24 07:19:45 CEST 2018


On Mon, 23 Jul 2018 22:53:08 +0200,
Alex Deucher wrote:
> 
> On Mon, Jul 23, 2018 at 10:50 AM, Takashi Iwai <tiwai at suse.de> wrote:
> > Hi,
> >
> > this is a patch set to add the support of drm_audio_component for
> > AMD/ATI HDMI codecs.  With the drm_audio_component, the HDMI/DP audio
> > hotplug and ELD read-out can be achieved directly without the hardware
> > access.  The best point by that is that it makes the hotplug
> > notification working even during runtime suspend.
> >
> > The support is totally optional and dynamic, hence it still works even
> > if either HD-audio or DRM side isn't patched, and it'll fall back to
> > the existing method.
> 
> I'm still getting my head around how the new callbacks work so bear
> with me.  It seems like we'd want to set the ELD and report whether
> the display is attached in when we detect the displays or fetch the
> EDID rather than at modeset time when we enable the audio stream.

Basically the callbacks are just replacements of the existing
mechanism with the direct calls.

In the traditional model, from GPU to HD-audio, we trigger a hotplug
event via writing a dedicated GPU register.  In HD-audio side, it's
transmitted as an unsolicited event via HD-audio bus, and HD-audio
driver receives it.  And for passing ELD, we write some bytes to GPU
registers in DRM driver.  These are read by HD-audio driver in hotplug
handler after receiving the event.

In the callback model, GPU calls audio_ops.pin_eld_notify() with the
pin index.  This callback is set by HD-audio.  Then HD-audio reads
back ELD bytes in return by calling ops.get_eld() with the given pin
index.  This callback is set by DRM.

For registration and de-registration, DRM gives the component bind /
unbind to set / clear its ops.


thanks,

Takashi

> 
> Alex
> 
> 
> >
> > The current patch supports only radeon and a part of amdgpu; the DC
> > support isn't included yet.
> >
> >
> > Takashi
> >
> > ===
> >
> > Takashi Iwai (4):
> >   ALSA: hda/hdmi: Use single mutex unlock in error paths
> >   ALSA: hda/hdmi: Allow audio component for AMD/ATI HDMI
> >   drm/radeon: Add audio component support
> >   drm/amdgpu: Add audio component support
> >
> >  drivers/gpu/drm/Kconfig                   |   2 +
> >  drivers/gpu/drm/amd/amdgpu/Makefile       |   2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu.h       |   4 +
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_audio.c |  97 ++++++++++
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h  |   3 +
> >  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c    |   6 +
> >  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c    |   6 +
> >  drivers/gpu/drm/amd/amdgpu/dce_v6_0.c     |   6 +
> >  drivers/gpu/drm/amd/amdgpu/dce_v8_0.c     |   6 +
> >  drivers/gpu/drm/radeon/radeon.h           |   3 +
> >  drivers/gpu/drm/radeon/radeon_audio.c     |  79 ++++++++
> >  sound/pci/hda/patch_hdmi.c                | 209 +++++++++++++++++-----
> >  12 files changed, 374 insertions(+), 49 deletions(-)
> >  create mode 100644 drivers/gpu/drm/amd/amdgpu/amdgpu_audio.c
> >
> > --
> > 2.18.0
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 


More information about the Alsa-devel mailing list