diff --git a/.pick_status.json b/.pick_status.json index ef5765c5369..e294fe5c1ea 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7164,7 +7164,7 @@ "description": "tu: Fix issues with 16k (or larger) page sizes", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "63904240f21b192a5fb1e79046a2c351fbd98ace", "notes": null diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index 84c6c7dc967..c2db2c7ad8f 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -42,6 +42,8 @@ #include "tu_tracepoints.h" #include "tu_wsi.h" +uint64_t os_page_size = 4096; + static int tu_device_get_cache_uuid(struct tu_physical_device *device, void *uuid) { @@ -1005,6 +1007,10 @@ tu_get_properties(struct tu_physical_device *pdevice, vk_shaderModuleIdentifierAlgorithmUUID, sizeof(props->shaderModuleIdentifierAlgorithmUUID)); + /* [Eric] backport note: this call is present on main but not in 24.1, and + * is required in this commit to initialise os_page_size correctly */ + os_get_page_size(&os_page_size); + /* VK_EXT_multi_draw */ props->maxMultiDrawCount = 2048; @@ -2212,7 +2218,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 22d8d6fdd19..10de69500b9 100644 --- a/src/freedreno/vulkan/tu_device.h +++ b/src/freedreno/vulkan/tu_device.h @@ -63,6 +63,8 @@ struct tu_memory_heap { alignas(8) VkDeviceSize used; }; +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 c0970d26a0e..7546a360387 100644 --- a/src/freedreno/vulkan/tu_knl_drm.cc +++ b/src/freedreno/vulkan/tu_knl_drm.cc @@ -130,11 +130,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)