Re: [PATCH] apple-gmux: Restore switch registers on suspend/resume

From: David Woodhouse
Date: Sun Jul 29 2012 - 18:45:14 EST


On Sun, 2012-07-29 at 09:46 +0200, Andreas Heider wrote:
> The gmux code you're using is a bit outdated, but if you use
> git://kernel.ubuntu.com/sforshee/linux.git gmux-switcheroo and connect
> an external display (I tested it with a DP one) you should be able to
> boot to DIS and switch to the IGD and get output on the external display.

Matthew's version has changes to the core vga_switcheroo code too, to
add the ->client_active() method which lets it pick the right client at
init time. I'll let you work out how to merge the two, but in the
meantime here's what I needed to do to Matthew's one to make it work...

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 321d17c..e2149e6 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -108,6 +108,7 @@ static void vga_switcheroo_enable(void)
ret = vgasr_priv.handler->get_client_id(client->pdev);
if (ret < 0)
return;
+ client->id = ret;

if (vgasr_priv.handler->client_active) {
active = vgasr_priv.handler->client_active(client->id);
@@ -117,7 +118,7 @@ static void vga_switcheroo_enable(void)
* but the client itself doesn't, update state
*/

- if (active && !client->active) {
+ if (active && !client->active && client->fb_info) {
struct fb_event event;
event.info = client->fb_info;
fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event);
@@ -125,8 +126,6 @@ static void vga_switcheroo_enable(void)

client->active = active;
}
-
- client->id = ret;
}
vga_switcheroo_debugfs_init(&vgasr_priv);
vgasr_priv.active = true;


--
dwmw2

Attachment: smime.p7s
Description: S/MIME cryptographic signature