aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-04-26 17:12:24 -0700
committerKenneth Graunke <[email protected]>2019-05-03 19:48:37 -0700
commit21062e21d9612aa2c7b27de4131ed11e9f175fb4 (patch)
tree5cba7ffb873f143c450f216536c169bd093faa5c /src
parent8cd71f399e73c5d87e9162cc74da76e317a9f41f (diff)
iris: Fix 4GB memory zone heap sizes.
The STATE_BASE_ADDRESS "Size" fields can only hold 0xfffff in pages, and 0xfffff * 4096 = 4294963200, which is 1 page shy of 4GB. So we can't use the top page.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_bufmgr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index 6f53f214caa..c38b960c5dd 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -1670,14 +1670,17 @@ iris_bufmgr_init(struct gen_device_info *devinfo, int fd)
STATIC_ASSERT(IRIS_MEMZONE_SHADER_START == 0ull);
const uint64_t _4GB = 1ull << 32;
+ /* The STATE_BASE_ADDRESS size field can only hold 1 page shy of 4GB */
+ const uint64_t _4GB_minus_1 = _4GB - PAGE_SIZE;
+
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_SHADER],
- PAGE_SIZE, _4GB - PAGE_SIZE);
+ PAGE_SIZE, _4GB_minus_1 - PAGE_SIZE);
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_SURFACE],
IRIS_MEMZONE_SURFACE_START,
- _4GB - IRIS_MAX_BINDERS * IRIS_BINDER_SIZE);
+ _4GB_minus_1 - IRIS_MAX_BINDERS * IRIS_BINDER_SIZE);
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_DYNAMIC],
IRIS_MEMZONE_DYNAMIC_START + IRIS_BORDER_COLOR_POOL_SIZE,
- _4GB - IRIS_BORDER_COLOR_POOL_SIZE);
+ _4GB_minus_1 - IRIS_BORDER_COLOR_POOL_SIZE);
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_OTHER],
IRIS_MEMZONE_OTHER_START,
gtt_size - IRIS_MEMZONE_OTHER_START);