[PATCH] vgaswitchroo: set audio client id according to bound gpu client id

Lukas Wunner lukas at wunner.de
Fri Jun 29 08:06:34 UTC 2018


> 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.


> > 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)

Thanks,

Lukas


More information about the dri-devel mailing list