[PATCH i-g-t v3] lib/intel_batchbuffer: Implicitly increase requested bb size for xe
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Mon Jan 22 15:16:41 UTC 2024
Due to batch prefetching on xe driver lets add implicitly additional size
to user requested batch size. Such should protect the user from being
affected by CAT errors when hw will touch offsets after user requested
batch size.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Matthew Auld <matthew.auld at intel.com>
---
v2: use xe_cs_prefetch_size() instead explicit 4K (Matt)
v3: drop 'if' conditional and increase size unconditionally for all
xe devices (Matt)
---
lib/intel_batchbuffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 85023f9e6f..61ab42df72 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -959,7 +959,7 @@ __intel_bb_create(int fd, uint32_t ctx, uint32_t vm, const intel_ctx_cfg_t *cfg,
alignment = xe_get_default_alignment(fd);
ibb->alignment = alignment;
- size = ALIGN(size, ibb->alignment);
+ size = ALIGN(size + xe_cs_prefetch_size(fd), ibb->alignment);
ibb->handle = xe_bo_create(fd, 0, size, vram_if_possible(fd, 0),
DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM);
--
2.34.1
More information about the igt-dev
mailing list