[Mesa-dev] [PATCH 04/12] anv: Exclude state objects from being placed above 4G

Chris Wilson chris at chris-wilson.co.uk
Sun May 14 23:38:48 UTC 2017


Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/intel/vulkan/anv_allocator.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c
index dc9b55b4a6..e316b421f4 100644
--- a/src/intel/vulkan/anv_allocator.c
+++ b/src/intel/vulkan/anv_allocator.c
@@ -1135,8 +1135,6 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
 
    uint32_t size = per_thread_scratch * max_threads[stage];
 
-   anv_bo_init_new(&bo->bo, device, size, ANV_BO_DEFAULT_FLAGS);
-
    /* Even though the Scratch base pointers in 3DSTATE_*S are 64 bits, they
     * are still relative to the general state base address.  When we emit
     * STATE_BASE_ADDRESS, we set general state base address to 0 and the size
@@ -1154,7 +1152,8 @@ anv_scratch_pool_alloc(struct anv_device *device, struct anv_scratch_pool *pool,
     *
     * so nothing will ever touch the top page.
     */
-   bo->bo.flags &= ~EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
+   anv_bo_init_new(&bo->bo, device, size,
+                   ANV_BO_DEFAULT_FLAGS & ~EXEC_OBJECT_SUPPORTS_48B_ADDRESS);
 
    /* Set the exists last because it may be read by other threads */
    __sync_synchronize();
-- 
2.11.0



More information about the mesa-dev mailing list