Module: Mesa
Branch: main
Commit: 0e9affd2676bc65be0270d7198b38ac7d80a1739
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e9affd2676bc65be0270d7198b38ac7d80a1739

Author: Yiwei Zhang <[email protected]>
Date:   Tue Jul 18 18:27:40 2023 +0000

venus: reduce to use 4K mem suballoc align on platforms known to fit

This is a workaround for low ram arm devices before fixing:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/9351

Test: patch to prior higher limit 16384 and run
      dEQP-VK.api.object_management.max_concurrent.query_pool

Signed-off-by: Yiwei Zhang <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24219>

---

 src/virtio/vulkan/vn_device_memory.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/virtio/vulkan/vn_device_memory.c 
b/src/virtio/vulkan/vn_device_memory.c
index ad789fdaf03..39789b18699 100644
--- a/src/virtio/vulkan/vn_device_memory.c
+++ b/src/virtio/vulkan/vn_device_memory.c
@@ -153,12 +153,15 @@ vn_device_memory_pool_suballocate(struct vn_device *dev,
                                   uint32_t mem_type_index)
 {
    const VkDeviceSize pool_size = 16 * 1024 * 1024;
-   /* XXX We don't know the alignment requirement.  Use 64K because some GPUs
-    * have 64K pages.  It is also required by newer Intel GPUs.  But really we
-    * should require kernel 5.12+, where there is no KVM memslot limit, and
-    * remove this whole thing.
+   /* TODO fix https://gitlab.freedesktop.org/mesa/mesa/-/issues/9351
+    * Before that, we use 64K default alignment because some GPUs have 64K
+    * pages. It is also required by newer Intel GPUs. Meanwhile, use prior 4K
+    * align on implementations known to fit.
     */
-   const VkDeviceSize pool_align = 64 * 1024;
+   const VkDeviceSize pool_align =
+      dev->physical_device->renderer_driver_id == VK_DRIVER_ID_ARM_PROPRIETARY
+         ? 4096
+         : 64 * 1024;
    struct vn_device_memory_pool *pool = &dev->memory_pools[mem_type_index];
 
    assert(mem->size <= pool_size);

Reply via email to