Mesa (staging/19.0): anv: leave the top 4Gb of the high heap VMA unused

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 24 22:27:37 UTC 2019


Module: Mesa
Branch: staging/19.0
Commit: 08f3ce4c7df427f54bc9711d0194a3f22237730a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=08f3ce4c7df427f54bc9711d0194a3f22237730a

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Fri Apr 12 11:05:33 2019 +0100

anv: leave the top 4Gb of the high heap VMA unused

In 628c9ca9089789 I forgot to apply the same -4Gb of the high address
of the high heap VMA. This was previously computed in the
HIGH_HEAP_MAX_ADDRESS.

Many thanks to James for pointing this out.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reported-by: Xiong, James <james.xiong at intel.com>
Fixes: 628c9ca9089789 ("anv: store heap address bounds when initializing physical device")
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
(cherry picked from commit 9e7b0988d6e98690eb8902e477b51713a6ef9cae)

---

 src/intel/vulkan/anv_device.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 6236074c43e..99b512a0387 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -150,7 +150,11 @@ anv_physical_device_init_heaps(struct anv_physical_device *device, int fd)
       device->memory.heap_count = 2;
       device->memory.heaps[0] = (struct anv_memory_heap) {
          .vma_start = HIGH_HEAP_MIN_ADDRESS,
-         .vma_size = gtt_size - HIGH_HEAP_MIN_ADDRESS,
+         /* Leave the last 4GiB out of the high vma range, so that no state
+          * base address + size can overflow 48 bits. For more information see
+          * the comment about Wa32bitGeneralStateOffset in anv_allocator.c
+          */
+         .vma_size = gtt_size - (1ull << 32) - HIGH_HEAP_MIN_ADDRESS,
          .size = heap_size_48bit,
          .flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT,
          .supports_48bit_addresses = true,
@@ -1817,10 +1821,6 @@ VkResult anv_CreateDevice(
       util_vma_heap_init(&device->vma_lo, low_heap->vma_start, low_heap->vma_size);
       device->vma_lo_available = low_heap->size;
 
-      /* Leave the last 4GiB out of the high vma range, so that no state base
-       * address + size can overflow 48 bits. For more information see the
-       * comment about Wa32bitGeneralStateOffset in anv_allocator.c
-       */
       struct anv_memory_heap *high_heap =
          &physical_device->memory.heaps[0];
       util_vma_heap_init(&device->vma_hi, high_heap->vma_start, high_heap->vma_size);




More information about the mesa-commit mailing list