<div dir="ltr">Hello, Kenneth.<div>Looks like you are expert in memory management for i965.</div><div>Could you, please, point me if that idea of patch is correct and what could i improve?</div><div><br></div><div>Seems its better somehow to bind it to I915_GTT_PAGE_SIZE... right?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 24, 2018 at 2:50 PM, Sergii Romantsov <span dir="ltr"><<a href="mailto:sergii.romantsov@gmail.com" target="_blank">sergii.romantsov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Kernel (for ppgtt) requires memory address to be<br>
aligned to page size (4096).<br>
Added such alignment for buffers marked with EXEC_OBJECT_PINNED.<br>
<br>
</span>-v2: added marking that also fixes initial commit 01058a552294<br>
<span class=""><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=106997" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=106997</a><br>
Fixes: a363bb2cd0e2 (i965: Allocate VMA in userspace for full-PPGTT systems.)<br>
</span>Fixes: 01058a552294 (i965: Add virtual memory allocator infrastructure to brw_bufmgr.)<br>
<div class="HOEnZb"><div class="h5">Signed-off-by: Sergii Romantsov <<a href="mailto:sergii.romantsov@globallogic.com">sergii.romantsov@globallogic.<wbr>com</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_<wbr>bufmgr.c | 6 +++---<br>
1 file changed, 3 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c b/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c<br>
index 09d45e3..8383735 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_bufmgr.c<br>
@@ -643,7 +643,7 @@ retry:<br>
bo->kflags = bufmgr->initial_kflags;<br>
<br>
if ((bo->kflags & EXEC_OBJECT_PINNED) && bo->gtt_offset == 0ull) {<br>
- bo->gtt_offset = vma_alloc(bufmgr, memzone, bo->size, 1);<br>
+ bo->gtt_offset = vma_alloc(bufmgr, memzone, bo->size, 4096);<br>
<br>
if (bo->gtt_offset == 0ull)<br>
goto err_free;<br>
@@ -784,7 +784,7 @@ brw_bo_gem_create_from_name(<wbr>struct brw_bufmgr *bufmgr,<br>
bo->kflags = bufmgr->initial_kflags;<br>
<br>
if (bo->kflags & EXEC_OBJECT_PINNED)<br>
- bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 1);<br>
+ bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 4096);<br>
<br>
_mesa_hash_table_insert(<wbr>bufmgr->handle_table, &bo->gem_handle, bo);<br>
_mesa_hash_table_insert(<wbr>bufmgr->name_table, &bo->global_name, bo);<br>
@@ -1424,7 +1424,7 @@ brw_bo_gem_create_from_prime_<wbr>internal(struct brw_bufmgr *bufmgr, int prime_fd,<br>
<br>
if (bo->kflags & EXEC_OBJECT_PINNED) {<br>
assert(bo->size > 0);<br>
- bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 1);<br>
+ bo->gtt_offset = vma_alloc(bufmgr, BRW_MEMZONE_OTHER, bo->size, 4096);<br>
}<br>
<br>
if (tiling_mode < 0) {<br>
-- <br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Sergii Romantsov<br></div><div dir="ltr"><div style="margin:0px;padding:0px;color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-size:14px">GlobalLogic Inc.<br><a href="http://www.globallogic.com/" rel="nofollow" style="color:rgb(0,82,204)" target="_blank">www.globallogic.com</a><br></div></div></div></div></div></div>
</div>