summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi
diff options
context:
space:
mode:
Diffstat (limited to 'src/vulkan/wsi')
-rw-r--r--src/vulkan/wsi/wsi_common.c3
-rw-r--r--src/vulkan/wsi/wsi_common_private.h1
-rw-r--r--src/vulkan/wsi/wsi_common_x11.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index fe262b4968d..87e508ddf85 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -442,6 +442,7 @@ fail:
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;
@@ -626,7 +627,7 @@ wsi_create_prime_image(const struct wsi_swapchain *chain,
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;
diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h
index b608119b969..90941c8201b 100644
--- a/src/vulkan/wsi/wsi_common_private.h
+++ b/src/vulkan/wsi/wsi_common_private.h
@@ -89,6 +89,7 @@ wsi_create_native_image(const struct wsi_swapchain *chain,
VkResult
wsi_create_prime_image(const struct wsi_swapchain *chain,
const VkSwapchainCreateInfoKHR *pCreateInfo,
+ bool use_modifier,
struct wsi_image *image);
void
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 3a00caddfb9..62739b99125 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -1043,7 +1043,8 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
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,