From: jimqu <jimqu-5C7GfCeVMHo@public.gmane.org>
To: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/2] vgaswitchreoo: set audio client id in vgaswitchreoo enable function
Date: Mon, 16 Jul 2018 22:45:54 +0800 [thread overview]
Message-ID: <d2c79b0c-4507-9ea2-12fb-b86fcc6de3fe@amd.com> (raw)
In-Reply-To: <20180716140246.GA12334-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
在 2018/7/16 22:02, Lukas Wunner 写道:
> On Sat, Jul 14, 2018 at 02:15:24PM +0800, jimqu wrote:
>> ??? 2018/7/13 17:27, Lukas Wunner ??????:
>>> On Fri, Jul 13, 2018 at 04:06:02PM +0800, Jim Qu 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, the audio which is binded to UMA
>>>> will be suspended if user use debugfs to contorl power
>>>>
>>>> In HDA driver side, it is difficult to know which GPU
>>>> the audio has binded to. So set the bound gpu pci dev
>>>> to vgaswitchroo, the correct audio id will be set in
>>>> vgaswitchreoo enable function.
>>>>
>>>> Signed-off-by: Jim Qu <Jim.Qu@amd.com>
>>> The approach you've taken in this patch won't work if the HDA controller
>>> is bound to a driver after both GPUs have already been bound to a driver
>>> and the handler has already been registered.
>>>
>>> That's because vga_switcheroo_enable() is run when two GPUs have registered
>>> as clients and the handler has also registered. If the HDA controller is
>>> probed afterwards, its ID will be stuck at VGA_SWITCHEROO_UNKNOWN_ID.
>> In genernic speaking, there are two cases , a. audio client is the third
>> client. b. audio client is not the third client.
>>
>> if audio is third client. vga_switcheroo_ready() is true,
>> vga_switcheroo_enable() can be called in audio client register fuction.
>> if audio is not the third client, vga_switcheroo_enable() will be called in
>> the second GFX client register.
>> In vga_switcheroo_enable() , the first list loop will set two GPU clients'
>> id, and the second list loop will select audio client, set id by its bound
>> gpu pci dev.
> No, if audio is the third client, vga_switcheroo_ready() is *not* true
> because vgasr_priv.active is true. This is set to true once the two
> GPUs and the handler have registered. If the audio device registers
> afterwards, vga_switcheroo_enable() will already have been called.
> It's never called twice because it sets vgasr_priv.active = true.
>
> As a result, the audio device is stuck at VGA_SWITCHEROO_UNKNOWN_ID.
Indeed, I almost ignore the vgasr_priv.active, since I added amdgpu to
blacklist, audio is always the first client. :).
not so bad, Let me rework the patch tomorrow.
Thanks
JimQu
> Thanks,
>
> Lukas
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-07-16 14:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 8:06 [PATCH 1/2] ALSA: HDA: use PCI_BASE_CLASS_DISPLAY to cover more display adapters Jim Qu
2018-07-13 8:06 ` [PATCH 2/2] vgaswitchreoo: set audio client id in vgaswitchreoo enable function Jim Qu
[not found] ` <1531469162-6472-2-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
2018-07-13 8:46 ` [alsa-devel] " Takashi Iwai
[not found] ` <s5hmuuv8qvp.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-07-13 15:25 ` jimqu
2018-07-13 16:38 ` Takashi Iwai
[not found] ` <s5hbmbbm6q9.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-07-13 16:51 ` [alsa-devel] " jimqu
2018-07-13 9:27 ` Lukas Wunner
[not found] ` <20180713092742.GA4013-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2018-07-13 15:34 ` jimqu
2018-07-14 6:15 ` jimqu
2018-07-16 14:02 ` Lukas Wunner
[not found] ` <20180716140246.GA12334-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2018-07-16 14:45 ` jimqu [this message]
[not found] ` <1531469162-6472-1-git-send-email-Jim.Qu-5C7GfCeVMHo@public.gmane.org>
2018-07-13 8:31 ` [PATCH 1/2] ALSA: HDA: use PCI_BASE_CLASS_DISPLAY to cover more display adapters Lukas Wunner
2018-07-13 8:33 ` [alsa-devel] " Takashi Iwai
[not found] ` <s5ho9fb8rh9.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-07-13 9:28 ` Qu, Jim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d2c79b0c-4507-9ea2-12fb-b86fcc6de3fe@amd.com \
--to=jimqu-5c7gfcevmho@public.gmane.org \
--cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).