[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5014EA3B.4010305@meetr.de>
Date: Sun, 29 Jul 2012 09:46:03 +0200
From: Andreas Heider <andreas@...tr.de>
To: David Woodhouse <dwmw2@...radead.org>
CC: Matthew Garrett <mjg59@...f.ucam.org>,
Arun Raghavan <arun.raghavan@...labora.co.uk>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] apple-gmux: Restore switch registers on suspend/resume
Am 29.07.12 03:18, schrieb David Woodhouse:
> On Sun, 2012-07-29 at 01:42 +0100, David Woodhouse wrote:
>> If I don't hack it to switch the mux to IGD at boot time, I never manage
>> to get a sane picture out of the Intel device after switching to it.
>> It's late now, but I'll try to get a proper debug log of the working and
>> failing cases tomorrow.
>
> From the hacked kernel (after fixing vga_switcheroo_enable() not to do:
> event.info = client->fb_info;
> fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event);
> if client->fb_info is NULL)...
>
> http://david.woodhou.se/dmesg-boot-to-IGD (blank screen)
> http://david.woodhou.se/dmesg-boot-to-IGD-and-switch-to-DIS (works)
> http://david.woodhou.se/dmesg-boot-to-IGD-and-switch-to-DIS-and-back-to-IGD (works)
>
> Without switching to IGD at startup...
>
> http://david.woodhou.se/dmesg-boot-to-DIS (works)
> http://david.woodhou.se/dmesg-boot-to-DIS-then-switch-to-IGD (blank)
>
The general problem, at least for the case of booting to DIS and then
switching to IGD, is that the mode for the internal display isn't
correct, so it stays black.
It could get the right mode via DDC but this line is muxed as well.
0x728 controls the DDC mux, writing 1 lets the IGD access it, 2 is the DIS.
So what happens in dmesg-boot-to-DIS is that the intel card can't get
the mode via DDC and falls back to the garbage mode from VBT.
Interestingly, there is a intel VBT on your MBP8,3, but it doesn't
contain the right modes. On my MBP6,2 there isn't a VBT at all and it
disables LVDS altogether if 0x728 isn't switched at boot.
Manually switching the mux is a bit messy, so I'm not too surprised that
it's blank in dmesg-boot-to-IGD.
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.
This leaves the problem of how to get i915 the right mode. Generally,
there are two options:
- Find a way so it gets the right mode when it initializes the LVDS.
This could be done by switching the DDC mux during lvds intialization.
See lock_ddc.patch for a crude prototype that works on my laptop if I'm
lucky and apple_gmux gets loaded before i915 and nouveau doesn't try to
use DDC at the same time.
Another way would be to get the right EDID without mux switching by
querying either the DIS driver or EFI (if you boot into the rEFIt shell
you can verify it's there, see http://andreas.meetr.de/efi/log/edid.txt,
to get it search for EdidDiscovered/EdidActive and dump it with dmem).
But to use this, we need a way to know which display this corresponds to
and I'm not sure how to do that.
- Make vga_switcheroo reprobe handle this. This would mean that we start
with a possibly broken mode and resize it once the mux get's switched
through vga_switcheroo. I'm not sure if thats a good idea.
I'd love to get any input on this, this is the main problem that's
keeping apple_gmux switching from working really well.
Andreas
View attachment "lock_ddc.patch" of type "text/plain" (3281 bytes)
Powered by blists - more mailing lists