On Tue, 5 Sep 2023 03:57:15 +0800
Sui Jingfeng <sui.jingfeng@xxxxxxxxx> wrote:
From: Sui Jingfeng <suijingfeng@xxxxxxxxxxx>In all my previous experiments with VGA routing and IGD I found that
On a machine with multiple GPUs, a Linux user has no control over which
one is primary at boot time. This series tries to solve above mentioned
problem by introduced the ->be_primary() function stub. The specific
device drivers can provide an implementation to hook up with this stub by
calling the vga_client_register() function.
Once the driver bound the device successfully, VGAARB will call back to
the device driver. To query if the device drivers want to be primary or
not. Device drivers can just pass NULL if have no such needs.
Please note that:
1) The ARM64, Loongarch, Mips servers have a lot PCIe slot, and I would
like to mount at least three video cards.
2) Typically, those non-86 machines don't have a good UEFI firmware
support, which doesn't support select primary GPU as firmware stage.
Even on x86, there are old UEFI firmwares which already made undesired
decision for you.
3) This series is attempt to solve the remain problems at the driver level,
while another series[1] of me is target to solve the majority of the
problems at device level.
Tested (limited) on x86 with four video card mounted, Intel UHD Graphics
630 is the default boot VGA, successfully override by ast2400 with
ast.modeset=10 append at the kernel cmd line.
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630]
IGD can't actually release VGA routing and Intel confirmed the hardware
doesn't have the ability to do so. It will always be primary from a
VGA routing perspective. Was this actually tested with non-UEFI?
I suspect it might only work in UEFI mode where we probably don't
actually have a dependency on VGA routing. This is essentially why
vfio requires UEFI ROMs when assigning GPUs to VMs, VGA routing is too
broken to use on Intel systems with IGD. Thanks,
Alex