Allow toggling runtime suspend if there are displays attached
Describe the problem
Some background, I have 2 GPUs and am using VFIO
to run gaming VMs on the better one (RX 590).
The system boots with both GPUs bound to the amdgpu
driver, and BIOS is configured to display on the second GPU.
This causes the RX 590 to enter a low power state (I assume BACO).
To launch the VM i run virsh nodedev-detach
on the GPU and start the VM.
The benefit of doing this instead of assigning the GPU to the VFIO
driver from boot is that the GPU is in a low power state when the VM is off.
Commit f95af4a drm/amdgpu: don't runtime suspend if there are displays attached (v3)
prevents the GPU from going to sleep if a monitor is connected. To my understanding this is the intended functionality of this commit.
My issue is that in this setup a monitor is always connected as when the VM launches I switch monitor inputs to the RX 590.
Describe the new feature behavior
The only solution to this I can think of is adding a module parameter to allow toggling between suspending if a monitor is connected and not suspending.
Using git I created a simple patch that reverts the commit, and have been using it for some time, the GPU does go to sleep with it reverted. So i assume this is the only commit that's causing the issue.
I apologize for the long explanation and very specific issue I've encountered.