[alsa-devel] [PATCH 0/2] HD-audio HDMI regression fixes with VGA-switcheroo
Hi,
this is a series of patches to fix the regressions of HD-audio HDMI on D-GPUs in 3.5-rc1 due to the support of VGA-switcheroo audio clients.
The first patch adds a new helper function to vga-switcheroo and the second just uses that instead of an open code.
Dave, if the first patch is OK, I'm going to apply it though sound tree. Let me know if any problem is found.
Joerg, could you check whether this doesn't break your setup, too?
thanks,
Takashi
Add vga_switcheroo_get_client_state() to get the current state of the client. This is necessary to determine the proper initial state of audio clients in HD-audio driver.
Signed-off-by: Takashi Iwai tiwai@suse.de --- drivers/gpu/vga/vga_switcheroo.c | 13 +++++++++++++ include/linux/vga_switcheroo.h | 9 +++++++++ 2 files changed, 22 insertions(+)
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 38f9534..eb4f64f 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -190,6 +190,19 @@ find_active_client(struct list_head *head) return NULL; }
+int vga_switcheroo_get_client_state(struct pci_dev *pdev) +{ + struct vga_switcheroo_client *client; + + client = find_client_from_pci(&vgasr_priv.clients, pdev); + if (!client) + return VGA_SWITCHEROO_NOT_FOUND; + if (!vgasr_priv.active) + return VGA_SWITCHEROO_INIT; + return client->pwr_state; +} +EXPORT_SYMBOL(vga_switcheroo_get_client_state); + void vga_switcheroo_unregister_client(struct pci_dev *pdev) { struct vga_switcheroo_client *client; diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h index b455c7c..661fb7a 100644 --- a/include/linux/vga_switcheroo.h +++ b/include/linux/vga_switcheroo.h @@ -12,6 +12,9 @@ enum vga_switcheroo_state { VGA_SWITCHEROO_OFF, VGA_SWITCHEROO_ON, + /* below are referred only from vga_switcheroo_get_client_state() */ + VGA_SWITCHEROO_INIT, + VGA_SWITCHEROO_NOT_FOUND, };
enum vga_switcheroo_client_id { @@ -50,6 +53,8 @@ void vga_switcheroo_unregister_handler(void);
int vga_switcheroo_process_delayed_switch(void);
+int vga_switcheroo_get_client_state(struct pci_dev *dev); + #else
static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {} @@ -62,5 +67,9 @@ static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev, int id, bool active) { return 0; } static inline void vga_switcheroo_unregister_handler(void) {} static inline int vga_switcheroo_process_delayed_switch(void) { return 0; } +static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { + return VGA_SWITCHEROO_CLIENT_ON; +} +
#endif
On Thu, Jun 7, 2012 at 11:15 AM, Takashi Iwai tiwai@suse.de wrote:
Add vga_switcheroo_get_client_state() to get the current state of the client. This is necessary to determine the proper initial state of audio clients in HD-audio driver.
Signed-off-by: Takashi Iwai tiwai@suse.de
Acked-by: Dave Airlie airlied@redhat.com
Feel free to merge it via sound tree.
Dave.
At Fri, 8 Jun 2012 09:42:58 +0100, Dave Airlie wrote:
On Thu, Jun 7, 2012 at 11:15 AM, Takashi Iwai tiwai@suse.de wrote:
Add vga_switcheroo_get_client_state() to get the current state of the client. This is necessary to determine the proper initial state of audio clients in HD-audio driver.
Signed-off-by: Takashi Iwai tiwai@suse.de
Acked-by: Dave Airlie airlied@redhat.com
Feel free to merge it via sound tree.
Thanks!
Takashi
When VGA-switcheroo is built in but unused on systems with multiple graphics cards, the initializations of non-default graphics cards are skipped and never enabled (because the switcheroo is activated only when the controller supports). The current behavior is for avoiding the system lockup by accessing the disabled GPU, but due to the recent change in VGA-switcheroo, it determines the state simply by checking with the default VGA device. This is the culprit.
Now with the new vga_switcheroo_get_client_state(), we can know the initial state of the bound GPU, thus can determine the initial audio client state more correctly.
Signed-off-by: Takashi Iwai tiwai@suse.de --- sound/pci/hda/hda_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 2b6392b..5f0375f 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2670,7 +2670,7 @@ static bool __devinit check_hdmi_disabled(struct pci_dev *pci) struct pci_dev *p = get_bound_vga(pci);
if (p) { - if (vga_default_device() && p != vga_default_device()) + if (vga_switcheroo_get_client_state(p) == VGA_SWITCHEROO_OFF) vga_inactive = true; pci_dev_put(p); }
participants (2)
-
Dave Airlie
-
Takashi Iwai