Skip to content

zink: fix xwayland crash when using cards that do not support modifiers

Scott Moreau requested to merge oreaus/mesa:xwayland-no-modifiers into main

What does this MR do and why?

zink: fix xwayland crash when using cards that do not support modifiers

Xwayland was crashing on cards that do not support modifiers because zink_resource_from_handle() returned early if EXT_image_drm_format_modifier was not available. Open this path and bind to dmabuf only when there is support for EXT_image_drm_format_modifier, or if the modifier format is DRM_FORMAT_MOD_INVALID. Otherwise, we choose ZINK_BIND_VIDEO. This way, xwayland with no modifier support uses VK_IMAGE_TILING_OPTIMAL for tiling while compositors get VK_IMAGE_TILING_LINEAR. If modifiers are supported, VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT is used. This should preserve the path for the modifiers case while allowing xwayland to create buffers in the no modifiers case.

Fixes glxgears and the like for #9875.

Requires !25379 (merged) to make xcalc and friends show up.

Edited by Scott Moreau

Merge request reports

Loading