From 53b77a8102cdb002461bbc8b7f52d8babb290aeb Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 23 Feb 2023 09:16:40 +0200 Subject: [PATCH] anv: remove 48bit address space checks All the supported platforms should have 36+ bits of virtual address space. Signed-off-by: Lionel Landwerlin Reviewed-by: Ivan Briano Part-of: --- src/intel/vulkan/anv_allocator.c | 3 +-- src/intel/vulkan/anv_device.c | 23 +++++------------------ src/intel/vulkan/anv_private.h | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c index f35b3e66b21..a32319aaf1d 100644 --- a/src/intel/vulkan/anv_allocator.c +++ b/src/intel/vulkan/anv_allocator.c @@ -1351,8 +1351,7 @@ anv_bo_alloc_flags_to_bo_flags(struct anv_device *device, uint64_t bo_flags = EXEC_OBJECT_PINNED; - if (!(alloc_flags & ANV_BO_ALLOC_32BIT_ADDRESS) && - pdevice->supports_48bit_addresses) + if (!(alloc_flags & ANV_BO_ALLOC_32BIT_ADDRESS)) bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS; if (((alloc_flags & ANV_BO_ALLOC_CAPTURE) || diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index f65eca62bb7..f7bfff478b5 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -828,18 +828,6 @@ anv_compute_sys_heap_size(struct anv_physical_device *device, */ available_ram = MIN2(available_ram, device->gtt_size * 3 / 4); - if (available_ram > (2ull << 30) && !device->supports_48bit_addresses) { - /* When running with an overridden PCI ID, we may get a GTT size from - * the kernel that is greater than 2 GiB but the execbuf check for 48bit - * address support can still fail. Just clamp the address space size to - * 2 GiB if we don't have 48-bit support. - */ - mesa_logw("%s:%d: The kernel reported a GTT size larger than 2 GiB but " - "not support for 48-bit addresses", - __FILE__, __LINE__); - available_ram = 2ull << 30; - } - return available_ram; } @@ -1324,11 +1312,11 @@ anv_physical_device_try_create(struct vk_instance *vk_instance, device->gtt_size = device->info.gtt_size ? device->info.gtt_size : device->info.aperture_bytes; - /* We only allow 48-bit addresses with softpin because knowing the actual - * address is required for the vertex cache flush workaround. - */ - device->supports_48bit_addresses = - device->gtt_size > (4ULL << 30 /* GiB */); + if (device->gtt_size < (4ULL << 30 /* GiB */)) { + vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER, + "GTT size too small: 0x%016"PRIu64, device->gtt_size); + goto fail_base; + } /* We currently only have the right bits for instructions in Gen12+. If the * kernel ever starts supporting that feature on previous generations, @@ -2949,7 +2937,6 @@ intel_aux_map_buffer_alloc(void *driver_ctx, uint32_t size) return NULL; struct anv_device *device = (struct anv_device*)driver_ctx; - assert(device->physical->supports_48bit_addresses); struct anv_state_pool *pool = &device->dynamic_state_pool; buf->state = anv_state_pool_alloc(pool, size, size); diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index e6f2d7c9789..ce533f98d86 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -913,7 +913,7 @@ struct anv_physical_device { struct anv_instance * instance; char path[20]; struct intel_device_info info; - bool supports_48bit_addresses; + bool video_decode_enabled; bool gpl_enabled;