答复: [PATCH] vgaswitchroo: set audio client id according to bound gpu client id
Qu, Jim
Jim.Qu at amd.com
Fri Jun 29 08:55:40 UTC 2018
Hi Lukas,
Thanks to your response, please see comments in line.
Thanks
JimQu
________________________________________
发件人: Lukas Wunner <lukas at wunner.de>
发送时间: 2018年6月29日 16:06
收件人: Qu, Jim
抄送: alsa-devel at alsa-project.org; dri-devel at lists.freedesktop.org; Deucher, Alexander; amd-gfx at lists.freedesktop.org
主题: Re: [PATCH] vgaswitchroo: set audio client id according to bound gpu client id
> > On Thu, Jun 28, 2018 at 2:22 AM, Jim Qu <Jim.Qu at amd.com> wrote:
> > > On modern laptop, there are more and more platforms
> > > have two GPUs, and each of them maybe have audio codec
> > > for HDMP/DP output. For some dGPU which is no output,
> > > audio codec usually is disabled.
> > >
> > > In currect HDA audio driver, it will set all codec as
> > > VGA_SWITCHEROO_DIS, so if system runtime pm is enabled,
> > > the audio which is binded to UMA will be suspended.
> Please explain what you mean by UMA here. Are you referring to
> dual GPU systems where both GPUs are by AMD? And the integrated
> GPU is incorrectly assigned VGA_SWITCHEROO_DIS?
> Starting with v4.17, the only reason the audio driver registers
> with vga_switcheroo is because it can be powered down if manual
> power control is used. However manual power control is not the
> default, it's primary use case nowadays is MacBook Pros, and
> there are no MacBook Pros with dual AMD GPUs. So I don't
> understand what real world use case you're trying to fix.
> Please explain.
Jim: Yeah, this a laptop which has two GPUs, iGPU has a HD audio for HDMI output. dGPU is headless which is only for offload render. This is a grapchis offloading solution for hybird GFX.
When our dGPU does suspend by runtime pm. amdgpu driver for dgpu will also call vgaswtichroo to power off its audio. vgaswitchroo driver will find audio codec by vgaswitchroo dgpu client id(VGA_SWITCHEROO_DIS).
Current HDA driver will register iGPU's audio client to vgaswitchroo as VGA_SWITCHEROO_DIS. so iGPU's audio has been powered off. It causes the issue that no sound on the HDMI device.
I think the issue should be observed on both Intel+AMD or AMD+AMD platform which has the same HW
configuration.
1.if dGPU has no audio codec. the issue should be always observed.
2.if both iGPU and dGPU has audio codecs, the issue should be random, it depends on the first audio found by vgaswitchroo driver is on iGPU or dGPU.
> > Newer dGPUs use PCI_CLASS_DISPLAY_OTHER rather than
> > PCI_CLASS_DISPLAY_VGA. Make sure we check for both when
> > checking for the dGPU in get_bound_vga()
> Unlike the other changes in your patch, this one would seem
> perfectly valid to me. However it's a separate issue, so
> please put it in a separate patch.
> Instead of adding a check for PCI_CLASS_DISPLAY_OTHER, I'd prefer
> you replacing the existing check for PCI_CLASS_DISPLAY_VGA with a
> check for PCI_BASE_CLASS_DISPLAY, like so:
> - if ((p->class >> 8) == PCI_CLASS_DISPLAY_VGA)
> + if ((p->class >> 16) == PCI_BASE_CLASS_DISPLAY)
Jim: That is fine, will update it.
Thanks,
Lukas
More information about the dri-devel
mailing list