Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v3] lib/intel_batchbuffer: Implicitly increase requested bb size for xe
@ 2024-01-22 15:16 Zbigniew Kempczyński
  2024-01-22 15:18 ` Matthew Auld
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Zbigniew Kempczyński @ 2024-01-22 15:16 UTC (permalink / raw)
  To: igt-dev; +Cc: Matthew Auld

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@intel.com>
Cc: Matthew Auld <matthew.auld@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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-23  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-22 15:16 [PATCH i-g-t v3] lib/intel_batchbuffer: Implicitly increase requested bb size for xe Zbigniew Kempczyński
2024-01-22 15:18 ` Matthew Auld
2024-01-22 20:42 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-01-22 20:48 ` ✓ CI.xeBAT: " Patchwork
2024-01-23  9:32 ` ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox