device_selection: Add support for opening multiple devices
why we need this
kms_prime
tests in which we export FB from one GPU to another
requirements
API to open 2 different devices, whatever they are, without having to rely on haxes similar to the one above. Support for IGT device filters (https://lists.freedesktop.org/archives/igt-dev/2019-December/018174.html).
I would like to be able to specify 2 devices using filters, e.g.:
IGT_DEVICE="pci:vendor=Intel,card=0;pci:vendor=Intel,card=1"
and exercise prime in both (if supported) directions
current state of affairs
kms_prime
is very basic and works only because:
/*
* Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system
* with vgem as well as a supported driver, you can end up with a
* near-100% skip rate if you don't explicitly specify the device,
* depending on device-load ordering.
*/
#define DRIVER_ANY ~(DRIVER_VGEM)
And then we are able to open one device with DRIVER_ANY
and another one with DRIVER_VGEM
.
Because of this kms_prime
is limited to exporting buffers between a single GPU and vgem only in a single direction.