anv: Add anv_memregion structure

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9324>
This commit is contained in:
Sagar Ghuge 2020-03-31 18:23:25 -07:00 committed by Jordan Justen
parent a41c3ed384
commit 835c257f64
2 changed files with 12 additions and 0 deletions

View File

@ -719,6 +719,10 @@ anv_physical_device_try_create(struct anv_instance *instance,
device->has_context_priority = anv_gem_has_context_priority(fd);
/* Initialize memory regions struct to 0. */
memset(&device->vram, 0, sizeof(device->vram));
memset(&device->sys, 0, sizeof(device->sys));
result = anv_physical_device_init_heaps(device, fd);
if (result != VK_SUCCESS)
goto fail_base;

View File

@ -964,6 +964,12 @@ struct anv_memory_heap {
* Align it to 64 bits to make atomic operations faster on 32 bit platforms.
*/
VkDeviceSize used __attribute__ ((aligned (8)));
bool is_local_mem;
};
struct anv_memregion {
uint64_t size;
};
struct anv_physical_device {
@ -1059,6 +1065,8 @@ struct anv_physical_device {
struct anv_memory_heap heaps[VK_MAX_MEMORY_HEAPS];
} memory;
struct anv_memregion vram;
struct anv_memregion sys;
uint8_t driver_build_sha1[20];
uint8_t pipeline_cache_uuid[VK_UUID_SIZE];
uint8_t driver_uuid[VK_UUID_SIZE];