xwayland: Create a xwl_gbm context for each available GPU
Xwayland currently only creates one xwl_gbm
instance corresponding to the primary GPU. This is then used in glamor_pixmap_from_fds
to import buffers as part of creating a pixmap for a buffer. This is an issue because in multi-GPU PRIME environments we are starting to consider scenarios where we want to directly scan out clients running on the dGPU. Trying to import dGPU-specific buffers with scanout modifiers fails since the xwl_gbm
object is not created on the dGPU.
What most likely needs to happen is we need to create a xwl_gbm
(and associated context) for each GPU in the system. We could then probably use something like the new DRMSetDeviceInUse
request from DRI3 to look up the correct gbm context to import a buffer into while creating a pixmap.
This issue exists to document this problem and start a discussion on how to improve it. This is related to !818 (merged)