radv/wsi: drop allocate memory special case
authorDave Airlie <airlied@redhat.com>
Thu, 16 Nov 2017 01:03:22 +0000 (11:03 +1000)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 Dec 2017 18:04:19 +0000 (10:04 -0800)
Just check if image has scanout flag set

v2 (Jason Ekstrand):
 - Rebase
 - Also drop the now unused radv_mem_flag_bits enum

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_private.h

index f4320275b356a53521fa287c10a639b729836caf..1b7cd355938516794506d18ba7407c447ac959fb 100644 (file)
@@ -2126,13 +2126,11 @@ bool radv_get_memory_fd(struct radv_device *device,
                                         pFD);
 }
 
-VkResult radv_alloc_memory(VkDevice                        _device,
-                          const VkMemoryAllocateInfo*     pAllocateInfo,
-                          const VkAllocationCallbacks*    pAllocator,
-                          enum radv_mem_flags_bits        mem_flags,
-                          VkDeviceMemory*                 pMem)
+static VkResult radv_alloc_memory(struct radv_device *device,
+                                 const VkMemoryAllocateInfo*     pAllocateInfo,
+                                 const VkAllocationCallbacks*    pAllocator,
+                                 VkDeviceMemory*                 pMem)
 {
-       RADV_FROM_HANDLE(radv_device, device, _device);
        struct radv_device_memory *mem;
        VkResult result;
        enum radeon_bo_domain domain;
@@ -2202,9 +2200,6 @@ VkResult radv_alloc_memory(VkDevice                        _device,
        if (mem_type_index == RADV_MEM_TYPE_GTT_WRITE_COMBINE)
                flags |= RADEON_FLAG_GTT_WC;
 
-       if (mem_flags & RADV_MEM_IMPLICIT_SYNC)
-               flags |= RADEON_FLAG_IMPLICIT_SYNC;
-
        if (!dedicate_info && !import_info)
                flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
 
@@ -2233,7 +2228,8 @@ VkResult radv_AllocateMemory(
        const VkAllocationCallbacks*                pAllocator,
        VkDeviceMemory*                             pMem)
 {
-       return radv_alloc_memory(_device, pAllocateInfo, pAllocator, 0, pMem);
+       RADV_FROM_HANDLE(radv_device, device, _device);
+       return radv_alloc_memory(device, pAllocateInfo, pAllocator, pMem);
 }
 
 void radv_FreeMemory(
index 88ddaf5b9b6375e42e056ac74a6c1faf7d16c77e..67c2011107613ec44b81a3f23bc8c88837a8840a 100644 (file)
@@ -106,11 +106,6 @@ enum radv_mem_type {
        RADV_MEM_TYPE_COUNT
 };
 
-enum radv_mem_flags_bits {
-       /* enable implicit synchronization when accessing the underlying bo */
-       RADV_MEM_IMPLICIT_SYNC = 1 << 0,
-};
-
 #define radv_printflike(a, b) __attribute__((__format__(__printf__, a, b)))
 
 static inline uint32_t
@@ -988,11 +983,6 @@ void radv_cmd_buffer_trace_emit(struct radv_cmd_buffer *cmd_buffer);
 bool radv_get_memory_fd(struct radv_device *device,
                        struct radv_device_memory *memory,
                        int *pFD);
-VkResult radv_alloc_memory(VkDevice _device,
-                          const VkMemoryAllocateInfo* pAllocateInfo,
-                          const VkAllocationCallbacks* pAllocator,
-                          enum radv_mem_flags_bits flags,
-                          VkDeviceMemory* pMem);
 
 /*
  * Takes x,y,z as exact numbers of invocations, instead of blocks.