diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index dc7b6694b52..c2aaf0ccf34 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -233,7 +233,7 @@ resource_create(struct pipe_screen *pscreen, .scanout = true, }; - if (templ->bind & PIPE_BIND_SCANOUT) + if (screen->needs_mesa_wsi && (templ->bind & PIPE_BIND_SCANOUT)) ici.pNext = &image_wsi_info; VkResult result = vkCreateImage(screen->dev, &ici, NULL, &res->image); @@ -285,7 +285,7 @@ resource_create(struct pipe_screen *pscreen, NULL, }; - if (templ->bind & PIPE_BIND_SCANOUT) { + if (screen->needs_mesa_wsi && (templ->bind & PIPE_BIND_SCANOUT)) { memory_wsi_info.implicit_sync = true; memory_wsi_info.pNext = mai.pNext; diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index 5ee02be415a..21cbca40cc4 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -1068,6 +1068,16 @@ zink_internal_setup_moltenvk(struct zink_screen *screen) } #endif // MVK_VERSION +static void +check_device_needs_mesa_wsi(struct zink_screen *screen) +{ + /* Raspberry Pi 4 V3DV driver */ + if (screen->info.props.vendorID == 0x14E4 && + screen->info.props.deviceID == 42) { + screen->needs_mesa_wsi = true; + } +} + static struct pipe_screen * zink_internal_create_screen(struct sw_winsys *winsys, int fd, const struct pipe_screen_config *config) { @@ -1100,6 +1110,11 @@ zink_internal_create_screen(struct sw_winsys *winsys, int fd, const struct pipe_ goto fail; } + /* Some Vulkan implementations have special requirements for WSI + * allocations. + */ + check_device_needs_mesa_wsi(screen); + #if defined(MVK_VERSION) zink_internal_setup_moltenvk(screen); #endif diff --git a/src/gallium/drivers/zink/zink_screen.h b/src/gallium/drivers/zink/zink_screen.h index ed27159a234..d6ba712d6f3 100644 --- a/src/gallium/drivers/zink/zink_screen.h +++ b/src/gallium/drivers/zink/zink_screen.h @@ -67,6 +67,9 @@ struct zink_screen { uint32_t loader_version; bool have_physical_device_prop2_ext; bool have_debug_utils_ext; + + bool needs_mesa_wsi; + #if defined(MVK_VERSION) bool have_moltenvk; #endif