intel/ppgtt: memory address alignment

Submitted by Sergii Romantsov on July 23, 2018, 11:53 a.m.

Details

Message ID 1532346835-14203-1-git-send-email-sergii.romantsov@globallogic.com
State New
Headers show
Series "intel/ppgtt: memory address alignment" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Sergii Romantsov July 23, 2018, 11:53 a.m.
Kernel (for ppgtt) requires memory address to be
aligned to page size (4096).
Added such alignment for buffers marked with EXEC_OBJECT_PINNED.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106997
Fixes: a363bb2cd0e2 (i965: Allocate VMA in userspace for full-PPGTT systems.)
Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
---
 src/mesa/drivers/dri/i965/brw_bufmgr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c
index 09d45e3..8383735 100644
--- a/src/mesa/drivers/dri/i965/brw_bufmgr.c
+++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c
@@ -643,7 +643,7 @@  retry:
    bo->kflags = bufmgr->initial_kflags;
 
    if ((bo->kflags & EXEC_OBJECT_PINNED) && bo->gtt_offset == 0ull) {
-      bo->gtt_offset = vma_alloc(bufmgr, memzone, bo->size, 1);
+      bo->gtt_offset = vma_alloc(bufmgr, memzone, bo->size, 4096);
 
       if (bo->gtt_offset == 0ull)
          goto err_free;
@@ -784,7 +784,7 @@  brw_bo_gem_create_from_name(struct brw_bufmgr *bufmgr,
    bo->kflags = bufmgr->initial_kflags;
 
    if (bo->kflags & EXEC_OBJECT_PINNED)
-      bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 1);
+      bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 4096);
 
    _mesa_hash_table_insert(bufmgr->handle_table, &bo->gem_handle, bo);
    _mesa_hash_table_insert(bufmgr->name_table, &bo->global_name, bo);
@@ -1424,7 +1424,7 @@  brw_bo_gem_create_from_prime_internal(struct brw_bufmgr *bufmgr, int prime_fd,
 
    if (bo->kflags & EXEC_OBJECT_PINNED) {
       assert(bo->size > 0);
-      bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 1);
+      bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 4096);
    }
 
    if (tiling_mode < 0) {