<p>Evgeny Zinoviev <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://review.coreboot.org/28380">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">[WIP] Nvidia Optimus support for ThinkPads<br><br>Based on siro's work #23041.<br>Tested on ThinkPad W530.<br><br>Enables dual graphics mode for T420, T420s, T520, T430, T430s, T530<br>mainboards, adds ACPI code for dGPU power management.<br><br>What works (tested on 4.16.13-gentoo kernel):<br>- power management via _PS0 and _DSM + _PS3 ACPI calls<br>- nouveau driver (with a workaround, see below)<br>- bumblebee (from the "develop" branch)<br>- bbswitch<br><br>Known problems:<br>- `lspci -s 01:00.0 -vv` turns dGPU on if it was off before. Not sure why it<br>  happens (probably it calls _PS0 at some point) or whether it should<br>  happen.<br><br>- nouveau driver unloading (`rmmod` or `modprobe -r`) does not work well: it<br>  crashes in nouveau_backlight_exit (invalid pointer). The current hack is<br>  to comment out these lines in drivers/gpu/drm/nouveau/nouveau_backlight.c,<br>  function  `nouveau_backlight_exit`:<br><br>  list_for_each_entry(connector, &drm->bl_connectors, head) {<br>    if (connector->id >= 0)<br>      ida_simple_remove(&bl_ida, connector->id);<br>    }<br><br>  Need to debug why it happens.<br><br>- VGA ROM for Nvidia GPU is not loaded from BIOS (i.e. coreboot). Need<br>  to debug and fix this too. (Or maybe I'm just doing it wrong.) The current<br>  workaround is to load it from a file.<br><br>  To do this automatically, create a new file in /etc/modprobe.d with this<br>  line:<br><br>  options nouveau config=NvBios=pci10de-0ffc.rom<br><br>  where "pci10de-0ffc.rom" is a file in /lib/firmware directory<br>  (the path is relative to /lib/firmware). VGA ROM has to be extracted<br>  from vendor UEFI dump, GUID is 9781FA9D-5A3B-431A-AD59-2748C9A170EC.<br><br>Not tested yet:<br>- nvidia proprietary driver<br><br>Change-Id: I277808d6c1d8bd6e0a267a53f25471597698f8d5<br>Signed-off-by: Evgeny Zinoviev <me@ch1p.com><br>---<br>A src/drivers/lenovo/hybrid_graphics/acpi/gpu.asl<br>A src/drivers/nvidia/optimus/acpi/optimus.asl<br>A src/ec/lenovo/pmh7/acpi/pmh7.asl<br>M src/mainboard/lenovo/t420/acpi/ec.asl<br>M src/mainboard/lenovo/t420/cmos.layout<br>M src/mainboard/lenovo/t420/dsdt.asl<br>M src/mainboard/lenovo/t420/romstage.c<br>M src/mainboard/lenovo/t420s/acpi/ec.asl<br>M src/mainboard/lenovo/t420s/cmos.layout<br>M src/mainboard/lenovo/t420s/dsdt.asl<br>M src/mainboard/lenovo/t420s/romstage.c<br>M src/mainboard/lenovo/t430/acpi/ec.asl<br>M src/mainboard/lenovo/t430/cmos.layout<br>M src/mainboard/lenovo/t430/devicetree.cb<br>M src/mainboard/lenovo/t430/dsdt.asl<br>M src/mainboard/lenovo/t430/romstage.c<br>M src/mainboard/lenovo/t430s/Kconfig<br>M src/mainboard/lenovo/t430s/Makefile.inc<br>M src/mainboard/lenovo/t430s/acpi/ec.asl<br>M src/mainboard/lenovo/t430s/cmos.default<br>M src/mainboard/lenovo/t430s/cmos.layout<br>M src/mainboard/lenovo/t430s/devicetree.cb<br>M src/mainboard/lenovo/t430s/dsdt.asl<br>M src/mainboard/lenovo/t430s/romstage.c<br>M src/mainboard/lenovo/t520/acpi/ec.asl<br>M src/mainboard/lenovo/t520/dsdt.asl<br>M src/mainboard/lenovo/t520/romstage.c<br>M src/mainboard/lenovo/t530/acpi/ec.asl<br>M src/mainboard/lenovo/t530/cmos.layout<br>M src/mainboard/lenovo/t530/dsdt.asl<br>M src/mainboard/lenovo/t530/romstage.c<br>M src/mainboard/lenovo/t530/variants/t530/devicetree.cb<br>M src/mainboard/lenovo/t530/variants/w530/devicetree.cb<br>M src/northbridge/intel/sandybridge/acpi/peg.asl<br>34 files changed, 427 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/28380/3</pre><p>To view, visit <a href="https://review.coreboot.org/28380">change 28380</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/28380"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I277808d6c1d8bd6e0a267a53f25471597698f8d5 </div>
<div style="display:none"> Gerrit-Change-Number: 28380 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Evgeny Zinoviev <me@ch1p.com> </div>
<div style="display:none"> Gerrit-Reviewer: Evgeny Zinoviev <me@ch1p.com> </div>
<div style="display:none"> Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org> </div>
<div style="display:none"> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> </div>