Log in

No account? Create an account

July 2017
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

airlied [userpic]
working t410s intel/nvidia basic switching

git repo:
branch: drm-nvidia-switch

So I have a T410s with an LVDS panel and switchable graphics between intel and nvidia. I've gotten the basic switching support just like we have on the intel/amd combination.

The code is a start towards generic nvidia/nvidia and intel/nvidia switching but its missing some bits. The MUX switch on some GPUs relies on passing a parameter to the WMI function that we aren't passing, luckily the lenovo doesn't need this parameter at the moment so it works fine. Other laptops in this range may require the parameter.

I'll try and get some more info on the magic value we need to pass on other systems to make it work better, other systems like the Sony Vaios have a number of muxable outputs listed in a table, that the intel acpi code prints out at drm.debug=0x4. Again the lenovo doesn't have this table.

Other issues:
once switched and powered off the Intel, we get log spam from the IPS driver about the MCP limits.
nouveau gets a 1024x768 console since we can't detect the LVDS panel at startup.

also, this only works with open source drivers, i915 and nouveau.


Keep up the good work. I hope you get this on Vaios too. Do you need an ACPI dump of a VZ11? (NV/i915 switchable graphics)

the current tree has a commented out output_id from a VAIO that might work.

need to get some testing on Vaios done.

Proprietary nvidia support

Its probably been asked before but I have only run across your blog today, is there nvidia proprietary driver support on your mind for the future?

Would be a great help since nouveau doesn't help with any 3D acceleration, VDPAU which is kinda one of the strong points of nvidia in linux :)

Re: Proprietary nvidia support

Nothing to do with me, I don't do binary hacking, and I don't have nvidia source code access. So really asking the wrong person.

It might be possible for someone to write a small stub driver that hooks into this stuff and switches to the nvidia card, then loads the binary driver afterwards, but I don't think I'll be looking into it too much.

Re: Proprietary nvidia support

Thanks for that! makes sense!

Switchable graphics

Would this work with laptops that have both intel and nvidia graphics, but don't already have optimus? I'm thinking of my t410, which has 2 gpus, but can only use the nvidia one, even under windows. I think the chipset is the exact same as the t410s as well. Thanks.

Re: Switchable graphics

If the BIOS doesn't provide a way and Windows doesn't provide a way, then nothing Linux can do about it. If your ACPI DSDT has the MXDS method then maybe it could be made work, but generally I don't think you can do anything unless the hw is enabled in the bios for hybrid or optimus.


Tried your code in a Vostro 3700 with Arch Linux.... When i do 'echo "DIS" > switch', all i got was a blank screen. But if i telnet the laptop, and 'cat switch', i got this:

0:IGD: :Off:0000:00:02.0

I tried to run X to see if the video would show up, but the screen was still blank... But my Xorg.0.log show that everything was ok, except that no output was detected:

[ 1606.781] (--) NOUVEAU(0): Chipset: "NVIDIA NVa5"
[ 1606.781] (==) NOUVEAU(0): Depth 24, (--) framebuffer bpp 32
[ 1606.781] (==) NOUVEAU(0): RGB weight 888
[ 1606.781] (==) NOUVEAU(0): Default visual is TrueColor
[ 1606.781] (==) NOUVEAU(0): Using HW cursor
[ 1606.790] (II) NOUVEAU(0): Output LVDS-2 using monitor section Monitor0
[ 1606.889] (II) NOUVEAU(0): Output VGA-2 has no monitor section
[ 1606.897] (II) NOUVEAU(0): Output HDMI-2 has no monitor section
[ 1606.905] (II) NOUVEAU(0): EDID for output LVDS-2
[ 1607.003] (II) NOUVEAU(0): EDID for output VGA-2
[ 1607.011] (II) NOUVEAU(0): EDID for output HDMI-2
[ 1607.011] (II) NOUVEAU(0): Output LVDS-2 disconnected
[ 1607.011] (II) NOUVEAU(0): Output VGA-2 disconnected
[ 1607.012] (II) NOUVEAU(0): Output HDMI-2 disconnected
[ 1607.012] (WW) NOUVEAU(0): No outputs definitely connected, trying again...
[ 1607.012] (II) NOUVEAU(0): Output LVDS-2 disconnected
[ 1607.012] (II) NOUVEAU(0): Output VGA-2 disconnected
[ 1607.012] (II) NOUVEAU(0): Output HDMI-2 disconnected
[ 1607.012] (WW) NOUVEAU(0): Unable to find connected outputs - setting 1024x768 initial framebuffer
[ 1607.012] (II) NOUVEAU(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
[ 1607.012] (--) NOUVEAU(0): Virtual size is 1024x768 (pitch 1024)
[ 1607.012] (**) NOUVEAU(0): Mode "1024x768": 63.5 MHz (scaled from 0.0 MHz), 47.8 kHz, 59.9 Hz
[ 1607.012] (II) NOUVEAU(0): Modeline "1024x768"x59.9 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync (47.8 kHz)
[ 1607.012] (==) NOUVEAU(0): DPI set to (96, 96)

So, looks like you're very close to make our laptops working... Thank you for your hard work and keep going!

can you boot with drm.debug=4 and send me a dmesg, from a boot to runlevel 3, and a echo DIS


Here we go: http://pastebin.com/Av0TVEvL

If you need anything eles, just ask...


I tried your patches with a Sony Vaio VPCZ11C5E (Intel/NV 330M), with the commented out output_id.

Switching basically works, the corresponding LEDs light up, but there are issues with getting the eDP-attached Panel to work correctly (black screen, backlight on).

Here is the dmesg drm.debug=4 output: http://pastey.net/143806
Booted with i915 and nouveau blacklisted, manually loaded i915 and then nouveau. At 'echo DIS > switch' the screen flickers and stays black with backlight on.
I started X to get some xrandr output:
xrandr: http://pastey.net/143807
xorg.log: http://pastey.net/143809
xrandr from a "normal" boot with just the nvidia card: http://pastey.net/143808

When switching back with 'echo IGD > switch' (not in the posted logs), the display stays black with backlight on, just as before. This is the same condition as in a recent suspend bug (see https://bugs.freedesktop.org/show_bug.cgi?id=30738) and in fact the display does come up again and works after a suspend.


cool, that looks similar to the problem I was seeing when we were hacking on jbarnes vaio, we should probably file a bug somewhere to track this down, maybe bugzilla.kernel.org against Drivers-Video DRI(others)

missing switch

For some reason I don't get /sys/kernel/debug/vgaswitcheroo
I've mounted debugfs, I have compiled the latest snapshot with CONFIG_VGA_SWITCHEROO=y and I've loaded nouveau and i915 kernel modules.

This is on a Samsung QX310.

I noticed this logging:

[ 0.618677] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[ 0.618782] vgaarb: loaded
[ 0.618838] vgaarb: bridge control possible 0000:00:02.0
[ 22.697756] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem

Based on my poor reading, it would seem that vgaarb isn't finding the nvidia chip.

00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller
01:00.0 3D controller: nVidia Corporation GT218 [GeForce 310M] (rev a2)

nouveau 515224 0
ttm 55790 1 nouveau
drm_kms_helper 29839 2 nouveau,i915
drm 173662 5 nouveau,ttm,i915,drm_kms_helper
i2c_algo_bit 4728 2 nouveau,i915
video 11701 2 nouveau,i915
mxm_wmi 1203 1 nouveau

Re: missing switch

appears we can't find a BIOS for the nvidia GPU, probably need to send me a copy of the bios, you can find me email address in a few places or guess it ;-)

Re: missing switch

Just sent you a mail.



I have a Dell XPS 15 coming in a couple weeks with Optimus capability. How can I help you further your project?

well if has a mux, testing this code would help, if not it'll be up to getting the PRIME code working and tested, which probably means updating it all to master of all the repos.

Save us! ;-)

I can get an Optimus-enabled (or is it "-crippled"?) ThinkPad T510 for a good price, but I'm a Linux-only user and this whole thing leaves me puzzled. Would you actually recommend buying such notebooks for now (I'm fine with patching kernels and such)? I just don't want to pay for something I cannot use at all.

Keep on rocking!

Re: Save us! ;-)

I'd probably not buy an optimus laptop primarily because the binary drivers won't work on it (unless someone sorts this out), and mostly people seem to want to run those drivers.

Though I did just buy an optimus laptop as my office laptop but it was mainly so I could work on writing this code.

Though the switchable technology on the IBM might be good enough to run the binary driver if you set the BIOS option.

Re: Save us! ;-)

I actually found a T510 user that was able to run the BLOB when setting the BIOS to discrete graphics. :) I guess if the BIOS only allows you to turn Optimus on and off, then you are out of luck.

Nvidia Optimus

I thought Nvidia Optimus doesn't do output multiplexing anymore but rely on the second, integrated graphics card to drive the attached screens?
Or is this already using the PRIME method with memory copying into the internal graphic cards video memory?

Re: Nvidia Optimus

Yeah Optimus doesn't have the multiplexing support but a lot of optimus laptops still have the multiplexer hw and acpi tables. Mainly laptops where the BIOS has the integrated/discrete/optimus options for the user to pick.

I'm currently working on dynamic switching and X server support (slowly in between everything else) then I'll probably work my way back to PRIME support.

Nice to know that there's someone actively working and making progress on this!

Thank you very much for your effort

I have a lenovo notebook with OPTIMUS solution, but it's not a thinkpad but an ideapad z360.

Do you think this might work for me as well?
(If this weren't my working computer I would try right ahead, but before I do that I wanted to know...)