In this mode of use, the discrete GPU automatically powers up and down at the discretion of the driver's runtime pm. On muxed machines, the user may still influence the muxer state by way of the debugfs interface, however the ON and OFF commands become a no-op for the discrete GPU.
This mode is the default on Nvidia HybridPower/Optimus and ATI PowerXpress. Specifying nouveau.runpm=0, radeon.runpm=0 or amdgpu.runpm=0 on the kernel command line disables it.
When the driver decides to power up or down, it notifies vga_switcheroo
thereof so that it can (a) power the audio device on the GPU up or down,
and (b) update its internal power state representation for the device.
This is achieved by vga_switcheroo_set_dynamic_switch
.
After the GPU has been suspended, the handler needs to be called to cut
power to the GPU. Likewise it needs to reinstate power before the GPU
can resume. This is achieved by vga_switcheroo_init_domain_pm_ops
,
which augments the GPU's suspend/resume functions by the requisite
calls to the handler.
When the audio device resumes, the GPU needs to be woken. This is achieved
by vga_switcheroo_init_domain_pm_optimus_hdmi_audio
, which augments the
audio device's resume function.
On muxed machines, if the mux is initially switched to the discrete GPU, the user ends up with a black screen when the GPU powers down after boot. As a workaround, the mux is forced to the integrated GPU on runtime suspend, cf. https://bugs.freedesktop.org/show_bug.cgi?id=75917