[Mesa-dev] [PATCH] vulkan/wsi: Fix OOM behavior with prime images.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Tue Feb 6 14:47:04 UTC 2018


Fixes: d50937f137 "vulkan/wsi: Implement prime in a completely generic way"
---
 src/vulkan/wsi/wsi_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index e9e43e1204..90ed07b785 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -429,8 +429,10 @@ wsi_create_prime_image(const struct wsi_swapchain *chain,
       vk_zalloc(&chain->alloc,
                 sizeof(VkCommandBuffer) * wsi->queue_family_count, 8,
                 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
-   if (!image->prime.blit_cmd_buffers)
+   if (!image->prime.blit_cmd_buffers) {
+      result = VK_ERROR_OUT_OF_HOST_MEMORY;
       goto fail;
+   }
 
    for (uint32_t i = 0; i < wsi->queue_family_count; i++) {
       const VkCommandBufferAllocateInfo cmd_buffer_info = {
-- 
2.16.1



More information about the mesa-dev mailing list