Skip to content

venus: enable explicit modifiers for linux wsi

Ryan Neph requested to merge ryanneph/mesa:venus-modifiers into main

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:

  1. Ensure host compositor support for zwp_linux_dmabuf_v1 version >= 3 (ver4 landed in Chrome/Exo with fixes in crrev/c/4047870)
  2. Ensure VM compositor support for zwp_linux_dmabuf_v1 version >= 3 (ver4 landed in sommelier in crrev/c/4903157)
  3. (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
  4. (this MR): ensure Vulkan WSI Venus can filter-out multi-planar format modifiers (for virgl, which doesn't support additional metadata planes and likely never will).
  5. (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:

Fixes: #9352 (closed) ("venus: avoid forcing linear tiling for common wsi")

Edited by Ryan Neph

Merge request reports