Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] tests/intel/xe_copy_basic: account for prefetch
@ 2024-01-23 18:33 Matthew Auld
  2024-01-23 18:33 ` [PATCH i-g-t 2/2] lib/intel_blt: use BYTE_COPY mode on xe2 Matthew Auld
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Matthew Auld @ 2024-01-23 18:33 UTC (permalink / raw)
  To: igt-dev

Xe2 expects an extra page after the batch to avoid prefetch hitting an
invalid page. Not doing so can result in CAT errors.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/intel/xe_copy_basic.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/intel/xe_copy_basic.c b/tests/intel/xe_copy_basic.c
index 1bde876cd..3ae5a7291 100644
--- a/tests/intel/xe_copy_basic.c
+++ b/tests/intel/xe_copy_basic.c
@@ -44,7 +44,7 @@ mem_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_ctx_t *ct
 	 uint32_t size, uint32_t width, uint32_t height, uint32_t region)
 {
 	struct blt_mem_data mem = {};
-	uint64_t bb_size = xe_get_default_alignment(fd);
+	uint64_t bb_size;
 	uint64_t ahnd = intel_allocator_open_full(fd, ctx->vm, 0, 0,
 						  INTEL_ALLOCATOR_SIMPLE,
 						  ALLOC_STRATEGY_LOW_TO_HIGH, 0);
@@ -53,6 +53,8 @@ mem_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_ctx_t *ct
 	uint32_t bb;
 	int result;
 
+	bb_size = ALIGN(SZ_4K + xe_cs_prefetch_size(fd),
+			xe_get_default_alignment(fd));
 	bb = xe_bo_create(fd, 0, bb_size, region, 0);
 
 	blt_mem_init(fd, &mem);
@@ -97,7 +99,7 @@ mem_set(int fd, uint32_t dst_handle, const intel_ctx_t *ctx, uint32_t size,
 	uint32_t width, uint32_t height, uint8_t fill_data, uint32_t region)
 {
 	struct blt_mem_data mem = {};
-	uint64_t bb_size = xe_get_default_alignment(fd);
+	uint64_t bb_size;
 	uint64_t ahnd = intel_allocator_open_full(fd, ctx->vm, 0, 0,
 						  INTEL_ALLOCATOR_SIMPLE,
 						  ALLOC_STRATEGY_LOW_TO_HIGH, 0);
@@ -105,6 +107,8 @@ mem_set(int fd, uint32_t dst_handle, const intel_ctx_t *ctx, uint32_t size,
 	uint32_t bb;
 	uint8_t *result;
 
+	bb_size = ALIGN(SZ_4K + xe_cs_prefetch_size(fd),
+			xe_get_default_alignment(fd));
 	bb = xe_bo_create(fd, 0, bb_size, region, 0);
 	blt_mem_init(fd, &mem);
 	blt_set_mem_object(&mem.dst, dst_handle, size, 0, width, height, region,
-- 
2.43.0


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

end of thread, other threads:[~2024-01-25  6:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 18:33 [PATCH i-g-t 1/2] tests/intel/xe_copy_basic: account for prefetch Matthew Auld
2024-01-23 18:33 ` [PATCH i-g-t 2/2] lib/intel_blt: use BYTE_COPY mode on xe2 Matthew Auld
2024-01-24  4:56   ` Zbigniew Kempczyński
2024-01-24  8:37     ` Matthew Auld
2024-01-25  6:04       ` Zbigniew Kempczyński
2024-01-23 19:30 ` ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/intel/xe_copy_basic: account for prefetch Patchwork
2024-01-23 19:55 ` ✓ CI.xeBAT: " Patchwork
2024-01-24  4:45 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-01-24  4:48 ` [PATCH i-g-t 1/2] " Zbigniew Kempczyński
2024-01-24  8:42   ` Matthew Auld

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