[PATCH i-g-t v7 5/6] lib/xe/xe_util: Align obj size before bind/unbind

Akshata Jahagirdar akshata.jahagirdar at intel.com
Fri Dec 15 21:09:46 UTC 2023


Alter the range to default_alignment before vm bind/unbind operation to
align the buffer object size with page size.

Signed-off-by: Akshata Jahagirdar <akshata.jahagirdar at intel.com>
---
 lib/xe/xe_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/xe/xe_util.c b/lib/xe/xe_util.c
index ba8eece71..6321a5729 100644
--- a/lib/xe/xe_util.c
+++ b/lib/xe/xe_util.c
@@ -148,7 +148,7 @@ static struct drm_xe_vm_bind_op *xe_alloc_bind_ops(int xe,
 		ops->flags = flags;
 		ops->obj_offset = 0;
 		ops->addr = obj->offset;
-		ops->range = obj->size;
+		ops->range = ALIGN(obj->size, 4096);
 		ops->prefetch_mem_region_instance = 0;
 		if (obj->pat_index == DEFAULT_PAT_INDEX)
 			ops->pat_index = intel_get_pat_idx_wb(xe);
-- 
2.34.1



More information about the igt-dev mailing list