diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index b6877295d46..65125cda36a 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -48,6 +48,8 @@ #include #endif +uint64_t os_page_size = 4096; + static int tu_device_get_cache_uuid(struct tu_physical_device *device, void *uuid) { @@ -1063,7 +1065,6 @@ tu_get_properties(struct tu_physical_device *pdevice, sizeof(props->shaderModuleIdentifierAlgorithmUUID)); /* VK_EXT_map_memory_placed */ - uint64_t os_page_size = 4096; os_get_page_size(&os_page_size); props->minPlacedMemoryMapAlignment = os_page_size, @@ -2265,7 +2266,7 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice, if (physical_device->has_set_iova) { mtx_init(&device->vma_mutex, mtx_plain); util_vma_heap_init(&device->vma, physical_device->va_start, - ROUND_DOWN_TO(physical_device->va_size, 4096)); + ROUND_DOWN_TO(physical_device->va_size, os_page_size)); } if (TU_DEBUG(BOS)) diff --git a/src/freedreno/vulkan/tu_device.h b/src/freedreno/vulkan/tu_device.h index e6096063714..fed89ab37b0 100644 --- a/src/freedreno/vulkan/tu_device.h +++ b/src/freedreno/vulkan/tu_device.h @@ -70,6 +70,8 @@ enum tu_kgsl_dma_type TU_KGSL_DMA_TYPE_DMAHEAP, }; +extern uint64_t os_page_size; + struct tu_physical_device { struct vk_physical_device vk; diff --git a/src/freedreno/vulkan/tu_knl_drm.cc b/src/freedreno/vulkan/tu_knl_drm.cc index c3eabed2ffc..9dfb0dab3e8 100644 --- a/src/freedreno/vulkan/tu_knl_drm.cc +++ b/src/freedreno/vulkan/tu_knl_drm.cc @@ -34,11 +34,11 @@ tu_allocate_userspace_iova(struct tu_device *dev, * them from the other end of the address space. */ dev->vma.alloc_high = true; - *iova = util_vma_heap_alloc(&dev->vma, size, 0x1000); + *iova = util_vma_heap_alloc(&dev->vma, size, os_page_size); } } else { dev->vma.alloc_high = false; - *iova = util_vma_heap_alloc(&dev->vma, size, 0x1000); + *iova = util_vma_heap_alloc(&dev->vma, size, os_page_size); } if (!*iova)