backend/drm: multi-GPU direct scanout
When running in multi-GPU mode, we should be able to support direct scan-out of buffers on secondary GPUs.
A few notes:
- Currently in wlroots we disable everything except LINEAR for multi-GPU imports. We should fix it (especially if the buffer is local -- but we can't know that before-hand) but there are some annoying corner-cases when one side doesn't support modifiers. Commit d71ed635 ("backend/drm: force linear layout for multi-GPU buffers") contains more information.
- Chase down the
if (drm->parent)
checks in drm_connector_check and drm_connector_commit. Make sure we never blit any buffer in the test-only case. - Make secondary DRM backends return the correct DRM FD in get_drm_fd. We couldn't do this previously because of our wlr_output impl, but this should be possible now that wlr_output_init_render has been added.
- Currently secondary DRM backends will return renderer formats/modifiers in get_primary_formats, but we'd like to return KMS formats/modifiers to allow direct scan-out. Maybe we need to lift up the multi-GPU copy machinery from the DRM backend to wlr_output…
- Make sure the fallback copy still works fine with the following test matrices: both GPUs lack support for modifiers, primary GPU supports modifiers but secondary GPU doesn't, primary GPU doesn't support modifiers but secondary GPU does, and both GPUs supports modifiers. Make sure there's no performance regression for these cases (e.g. cross-device test-only commits don't generate blits). We had some annoying related bugs in the past.
cc @ashafer
Edited by Simon Ser