[Mesa-dev] [PATCH 12/16] anv: Make supports_48bit_addresses a heap property

Nanley Chery nanleychery at gmail.com
Tue May 23 22:21:31 UTC 2017


On Thu, May 18, 2017 at 02:00:59PM -0700, Jason Ekstrand wrote:
> ---
>  src/intel/vulkan/anv_device.c  |  6 ++++--
>  src/intel/vulkan/anv_private.h | 11 ++++++++++-
>  2 files changed, 14 insertions(+), 3 deletions(-)
> 

This patch is
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>

> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index 9444ff8..bb02378 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -149,9 +149,10 @@ anv_physical_device_init_heaps(struct anv_physical_device *device, int fd)
>     }
>  
>     device->memory.heap_count = 1;
> -   device->memory.heaps[0] = (VkMemoryHeap) {
> +   device->memory.heaps[0] = (struct anv_memory_heap) {
>        .size = heap_size,
>        .flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT,
> +      .supports_48bit_addresses = device->supports_48bit_addresses,
>     };
>  
>     return VK_SUCCESS;
> @@ -1530,7 +1531,8 @@ VkResult anv_AllocateMemory(
>           goto fail;
>     }
>  
> -   if (pdevice->supports_48bit_addresses)
> +   assert(mem->type->heapIndex < pdevice->memory.heap_count);
> +   if (pdevice->memory.heaps[mem->type->heapIndex].supports_48bit_addresses)
>        mem->bo->flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
>  
>     if (pdevice->has_exec_async)
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
> index de52c5b..a095d4d 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -649,6 +649,15 @@ struct anv_memory_type {
>     VkBufferUsageFlags      valid_buffer_usage;
>  };
>  
> +struct anv_memory_heap {
> +   /* Standard bits passed on to the client */
> +   VkDeviceSize      size;
> +   VkMemoryHeapFlags flags;
> +
> +   /* Driver-internal book-keeping */
> +   bool              supports_48bit_addresses;
> +};
> +
>  struct anv_physical_device {
>      VK_LOADER_DATA                              _loader_data;
>  
> @@ -678,7 +687,7 @@ struct anv_physical_device {
>        uint32_t                                  type_count;
>        struct anv_memory_type                    types[VK_MAX_MEMORY_TYPES];
>        uint32_t                                  heap_count;
> -      VkMemoryHeap                              heaps[VK_MAX_MEMORY_HEAPS];
> +      struct anv_memory_heap                    heaps[VK_MAX_MEMORY_HEAPS];
>      } memory;
>  
>      uint8_t                                     pipeline_cache_uuid[VK_UUID_SIZE];
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list