mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Andreas Heider <andreas@meetr.de>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	Arun Raghavan <arun.raghavan@collabora.co.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] apple-gmux: Restore switch registers on suspend/resume
Date: Sun, 29 Jul 2012 23:44:49 +0100	[thread overview]
Message-ID: <1343601889.2487.3.camel@shinybook.infradead.org> (raw)
In-Reply-To: <5014EA3B.4010305@meetr.de>

[-- Attachment #1: Type: text/plain, Size: 1683 bytes --]

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 #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

  parent reply	other threads:[~2012-07-29 22:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-10  3:39 Arun Raghavan
2012-07-10 13:35 ` Seth Forshee
2012-07-10 16:05 ` Matthew Garrett
2012-07-10 16:35   ` Seth Forshee
2012-07-11  0:25     ` Andreas Heider
2012-07-29  0:42       ` David Woodhouse
2012-07-29  1:18         ` David Woodhouse
2012-07-29  7:46           ` Andreas Heider
2012-07-29 19:05             ` David Woodhouse
2012-07-29 19:34               ` Andreas Heider
2012-07-29 22:44             ` David Woodhouse [this message]
2012-07-30 14:05               ` Seth Forshee
2012-07-29 19:39           ` Matthew Garrett
2012-07-29 20:33             ` David Woodhouse
2012-07-29 20:52             ` David Woodhouse
2012-07-29 20:59               ` Matthew Garrett
2012-07-31 15:18                 ` Seth Forshee
2012-07-31 17:07                   ` Seth Forshee
2012-08-01 15:35                   ` David Woodhouse
2012-08-01 15:59                     ` Seth Forshee
2012-08-01 16:06                       ` Andreas Heider
2012-08-01 19:41                       ` David Woodhouse
2012-08-01 19:52                         ` Seth Forshee
2012-08-01 19:43                       ` David Woodhouse
2012-08-01 19:52                         ` Matthew Garrett
2012-08-01 19:56                         ` Seth Forshee
2012-08-01 19:56                         ` Andreas Heider

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=1343601889.2487.3.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=andreas@meetr.de \
    --cc=arun.raghavan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.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

Powered by JetHome