<div dir="ltr"><div><div><div><div><div>Quick update:<br><br></div>Just having "device pci 01.0 on end" in the devicetree results in the following powertop measurements:<br></div>26W after boot, 21W with power savings applied, 20W at maximum power savings<br><br>So just declaring the nvidia makes things much worse, even without really using the dGPU for anything. (there are no nvidia modules, to make sure it would not interfere with the measurements)<br><br></div><div>Since it was in D0, I tried setting the Nvidia gpu in D3 state</div><div>setpci -s 01:00.0 CAP_PM+4.b<br>08<br>setpci -s 01:00.0 CAP_PM+4.b=0b<br><br></div><div>It didn't help with the power. To confirm whether disabling the Nvidia pcie interface results in this +4W in maximal power savings, I completed src/drivers/lenovo/hybrid_graphics.c with the PCI ID from my card. I could return to 17W with all power savings applied.<br><br></div><div>So I'm back to trying to find a way to turn off the power completely with the EC, and hoping this is where the extra 8W come from.<br><br>After some googling I found ec_access, but I don't know which register to write to.</div></div><div><br></div>In case anyone is interested, here are the pci devices, of course ASPM is already enabled (root: 0xB0 : 0x43, peripheral: 0x88 : 0x4B) and I am not using the dGPU for anything at all.<br><br>$ cat /sys/devices/pci0000:00/0000:<wbr>00:01.0/0000:01:00.0/power/<wbr>runtime_status<br>suspended<br>$ cat /sys/devices/pci0000:00/0000:<wbr>00:01.0/0000:01:00.1/power/<wbr>runtime_status<br>active<br><br>$ lspci -s  00:01.0 -xxx<br><br>00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09<br>)<br>00: 86 80 51 01 07 04 10 00 09 00 04 06 10 00 81 00<br>10: 00 00 00 00 00 00 00 00 00 01 01 00 20 20 00 20<br>20: 00 f0 00 f1 01 c0 f1 d1 00 00 00 00 00 00 00 00<br>30: 00 00 00 00 88 00 00 00 00 00 00 00 0b 01 03 00<br>40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a<br>80: 01 90 03 c8 08 00 00 00 0d 80 00 00 86 80 00 00<br>90: 05 a0 01 00 d8 02 e0 fe 00 00 00 00 00 00 00 00<br>a0: 10 00 42 01 01 80 00 00 00 00 00 00 03 ad 61 02<br>b0: 43 00 02 51 00 00 04 00 00 00 48 00 08 00 00 00<br>c0: 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 00 00<br>d0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>f0: 00 00 00 00 00 00 01 00 00 00 00 00 01 00 10 00<br> <br>#    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f<br><br>$ lspci -d 10de:0dfa -xxx <br>01:00.0 VGA compatible controller: NVIDIA Corporation GF108GLM [Quadro 1000M] (rev a1)<br>00: de 10 fa 0d 03 00 10 00 a1 00 00 03 10 00 80 00<br>10: 00 00 00 f0 0c 00 00 c0 00 00 00 00 0c 00 00 d0<br>20: 00 00 00 00 01 20 00 00 00 00 00 00 00 00 00 00<br>30: 00 00 00 f1 60 00 00 00 00 00 00 00 0b 01 00 00<br>40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>50: 00 00 00 00 01 00 00 00 ce d6 23 00 00 00 00 00<br>60: 01 68 03 00 08 00 00 00 05 78 80 00 00 00 00 00<br>70: 00 00 00 00 00 00 00 00 10 b4 02 00 a0 8d 00 00<br>80: 10 28 00 00 02 2d 05 00 4b 01 02 11 00 00 00 00<br>90: 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00<br>a0: 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00<br>b0: 00 00 00 00 09 00 14 01 00 00 00 00 00 00 00 00<br>c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br><br>#    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f<br><br># 78 contains 10, on 88 : 4b<br><br>$ lspci -d 10de:0bea -xxx <br><br>01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio Controller (rev a1)<br>00: de 10 ea 0b 06 00 18 00 a1 00 03 04 10 00 80 00<br>10: 00 00 08 f1 00 00 00 00 00 00 00 00 00 00 00 00<br>20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>30: 00 00 00 00 60 00 00 00 00 00 00 00 0b 02 00 00<br>40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>50: 00 00 00 00 00 00 00 00 ce d6 23 00 00 00 00 00<br>60: 01 68 03 00 08 00 00 00 05 78 80 00 00 00 00 00<br>70: 00 00 00 00 00 00 00 00 10 00 02 00 a0 8d 00 00<br>80: 10 28 00 00 02 2d 05 00 4b 01 02 11 00 00 00 00<br>90: 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00<br>a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br><br></div>Charlotte<br><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 18, 2016 at 4:04 PM, Charlotte Plusplus <span dir="ltr"><<a href="mailto:pluspluscharlotte@gmail.com" target="_blank">pluspluscharlotte@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hello<br><br></div>Super interesting, I didn't know all that!<br><br>Currently, I have only set in devicetree:<br><br>device pci 00.0 on end # host bridge<br>device pci 01.0 off end # NVidia<br>device pci 02.0 on end # Intel<br></div><div><br></div><div>and in my nvram options I have:<br>hybrid_graphics_mode = Integrated Only<br><br></div>I assumed that would be sufficient to turn off the power for the dGPU until I figure out a way to make it work. I will enable the NVidia and do more power tests.<br><br></div>After reading hybrid_graphics.c, I understand a bit more, but I also have more questions:<br></div><div> - can I add register "pcie_hotplug_map" = "{ 0, 1, 0}" to make the NVidia removable?<br>(so that the operating system will not freak out when the NVidia disappears from the PCI bus if I find a way to control the power by talking to the EC and send <br>
GFXCORE_ON_D + the other signal for the VRAM)<br></div><div><br></div> - can you change the connection of the displayport? Based on the specsheets, it is connected to the dGPU, while the internal display is connected to the iGPU. If is it possible to control the muxes for the internal display, I suppose it is possible for the other displays as well. (I have just tested and I do not have any video on the displayport, and xrandr does not detect anything)<br><br> - there seem to be some missing IDs in pci_device_ids_nvidia : cf <a href="http://envytools.readthedocs.io/en/latest/hw/pciid.html" target="_blank">http://envytools.readthedocs.<wbr>io/en/latest/hw/pciid.html</a> which agrees with the W530 : 0x0ffb, so I will  propose a patch:<br>                0x0dfa, /* Nvidia NVS Quadro 1000m Lenovo W520 */<br>                0x0ffb, /* Nvidia NVS Quadro K1000m Lenovo W530 */                           <br>                0x0ffc, /* Nvidia NVS Quadro K2000m Lenovo W530 */<br><br></div><div>It may also be the reason why the Nvidia is still getting power, as Iru noted that hybrid_graphics should turn off the power. I will test that separately.<br><br><div>- until I can find a better solution, I am thinking of letting the Nvidia show on on the PCIe bus and then sending  
commands to get in into advanced sleep  - like on <a href="https://wireless.wiki.kernel.org/en/users/documentation/aspm" target="_blank">https://wireless.wiki.kernel.<wbr>org/en/users/documentation/<wbr>aspm</a><br><br></div><div>It should be possible as the w530 lspci -v shows:<br></div><div>        Capabilities: [60] Power Management version 3<br>                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-<wbr>)<br>                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-<br></div><div><br></div><div>Would you have a better idea?<br><br></div>Thanks<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Charlotte<br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 18, 2016 at 4:52 AM, Felix Held <span dir="ltr"><<a href="mailto:felix-coreboot@felixheld.de" target="_blank">felix-coreboot@felixheld.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don't know if Charlotte has added the ID of the dGPU to src/drivers/lenovo/hybrid_grap<wbr>hics.c. Does the dGPU consume power after hybrid_graphics.c disable the dGPU?<br>
</blockquote></span>
OPTIMUS_ENABLE is a PCH GPIO and controls the muxes that select if the internal display is connected to the iGPU or the dGPU; that's done in hybrid_graphics.c.<br>
GFXCORE_ON_D (and another signal that controls the power supply of the VRAM) are driven by the Thinker-1 chip; those switch on/off the power supply of the GPU. So to really disable the GPU you probably have to ask the EC to make that chip turn off the voltage for the GPU and VRAM.<div class="m_716253321887735877HOEnZb"><div class="m_716253321887735877h5"><br>
<br>
Regards<br>
Felix<br>
<br>
-- <br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://www.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://www.coreboot.org/mailm<wbr>an/listinfo/coreboot</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>