Mesa (main): venus: use 64KB alignment for suballocations

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 11 21:34:22 UTC 2022


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

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Fri Feb 11 12:53:44 2022 -0800

venus: use 64KB alignment for suballocations

TGL CCS surface addresses must be aligned to 64KB.

Reviewed-by: Yiwei Zhang <zzyiwei at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15001>

---

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

diff --git a/src/virtio/vulkan/vn_device_memory.c b/src/virtio/vulkan/vn_device_memory.c
index 2c7e2dc942b..2d9c9b92c33 100644
--- a/src/virtio/vulkan/vn_device_memory.c
+++ b/src/virtio/vulkan/vn_device_memory.c
@@ -155,10 +155,12 @@ 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.  We should probably use 64K
-    * because some GPUs have 64K pages.
+   /* 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.
     */
-   const VkDeviceSize pool_align = 4096;
+   const VkDeviceSize pool_align = 64 * 1024;
    struct vn_device_memory_pool *pool = &dev->memory_pools[mem_type_index];
 
    assert(mem->size <= pool_size);



More information about the mesa-commit mailing list