venus: enable explicit modifiers for linux wsi
What does this MR do and why?
Enables Venus to stop forcing swapchain images (on linux) to allocate with DRM_FORMAT_MOD_LINEAR
.
On ChromeOS-like integrations (venus + virgl + sommelier + virtio-wl) this takes a bit of effort in various places:
- Ensure host compositor support for
zwp_linux_dmabuf_v1
version >= 3 (ver4 landed in Chrome/Exo with fixes in crrev/c/4047870) - Ensure VM compositor support for
zwp_linux_dmabuf_v1
version >= 3 (ver4 landed in sommelier in crrev/c/4903157) - (this MR): ensure VM libgbm + dri driver (virgl) supports explicit modifiers query via
gbm_bo_get_modifier()
; used in Vulkan WSI to Xwayland/Glamor handoff - (this MR): ensure
Vulkan WSIVenus can filter-out multi-planar format modifiers (for virgl, which doesn't support additional metadata planes and likely never will). - (this MR): ensure Venus indicates image format support for modifiers acquired by Vulkan WSI from compositor (drops a problematic
ALIAS_BIT
to workaround venus-protocol not serializing mesa-internal structs chained to query structs).
I've run the following tests:
dEQP-VK.wsi.* (DEQP_TARGET=x11_egl_glx)
Test run totals:
Passed: 81/23462 (0.3%)
Failed: 0/23462 (0.0%)
Not supported: 23381/23462 (99.7%)
Warnings: 0/23462 (0.0%)
Waived: 0/23462 (0.0%)
dEQP-VK.wsi.wayland.* (DEQP_TARGET=wayland)
Passed: 68/2869 (2.4%)
Failed: 0/2869 (0.0%)
Not supported: 2801/2869 (97.6%)
Warnings: 0/2869 (0.0%)
Waived: 0/2869 (0.0%)
and the following sample programs:
- vkcube (X11/Wayland)
- https://github.com/SaschaWillems/Vulkan (X11/Wayland)
- https://github.com/KhronosGroup/Vulkan-Samples (X11/Wayland)
- Portal 2 (with
-vulkan
) - Valheim (Native Linux w/ Vulkan)
- RDR2 (Proton w/ D3D11 via DXVK + Venus)
Fixes: #9352 (closed) ("venus: avoid forcing linear tiling for common wsi")