Hello
Super interesting, I didn't know all that!
Currently, I have only set in devicetree:
device pci 00.0 on end # host bridge
device pci 01.0 off end # NVidia
device pci 02.0 on end # Intel
and in my nvram options I have:
hybrid_graphics_mode = Integrated Only
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.
After reading hybrid_graphics.c, I understand a bit more, but I also have more questions:
- can I add register "pcie_hotplug_map" = "{ 0, 1, 0}" to make the NVidia removable?
(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
GFXCORE_ON_D + the other signal for the VRAM)
- 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)
- there seem to be some missing IDs in pci_device_ids_nvidia : cf
http://envytools.readthedocs.io/en/latest/hw/pciid.html which agrees with the W530 : 0x0ffb, so I will propose a patch:
0x0dfa, /* Nvidia NVS Quadro 1000m Lenovo W520 */
0x0ffb, /* Nvidia NVS Quadro K1000m Lenovo W530 */
0x0ffc, /* Nvidia NVS Quadro K2000m Lenovo W530 */
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.
It should be possible as the w530 lspci -v shows:
Capabilities: [60] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Would you have a better idea?
Thanks