This was setting the LINEAR modifier if neither the
X server nor the driver supported modifiers.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106180
Fixes: c80c08e226 "vulkan/wsi/x11: Add support for DRI3 v1.2"
CC: 18.1 <mesa-stable@lists.freedesktop.org>
Tested-by: Abel Garcia Dorta <mercuriete@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
VkResult
wsi_create_prime_image(const struct wsi_swapchain *chain,
const VkSwapchainCreateInfoKHR *pCreateInfo,
+ bool use_modifier,
struct wsi_image *image)
{
const struct wsi_device *wsi = chain->wsi;
if (result != VK_SUCCESS)
goto fail;
- image->drm_modifier = DRM_FORMAT_MOD_LINEAR;
+ image->drm_modifier = use_modifier ? DRM_FORMAT_MOD_LINEAR : DRM_FORMAT_MOD_INVALID;
image->num_planes = 1;
image->sizes[0] = linear_size;
image->row_pitches[0] = linear_stride;
VkResult
wsi_create_prime_image(const struct wsi_swapchain *chain,
const VkSwapchainCreateInfoKHR *pCreateInfo,
+ bool use_modifier,
struct wsi_image *image);
void
uint32_t bpp = 32;
if (chain->base.use_prime_blit) {
- result = wsi_create_prime_image(&chain->base, pCreateInfo, &image->base);
+ bool use_modifier = num_tranches > 0;
+ result = wsi_create_prime_image(&chain->base, pCreateInfo, use_modifier, &image->base);
} else {
result = wsi_create_native_image(&chain->base, pCreateInfo,
num_tranches, num_modifiers, modifiers,