public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: nishit.sharma@intel.com
To: igt-dev@lists.freedesktop.org, priyanka.dandamudi@intel.com
Subject: [PATCH i-g-t 2/3] tests/intel/xe_exec_store: Enforce per-instruction copy limit for MEM_COPY
Date: Fri, 20 Feb 2026 09:30:40 +0000	[thread overview]
Message-ID: <20260220093041.1911492-3-nishit.sharma@intel.com> (raw)
In-Reply-To: <20260220093041.1911492-1-nishit.sharma@intel.com>

From: Nishit Sharma <nishit.sharma@intel.com>

In this test the copy limit for MEM_COPY instruction is enforced to max
data for linear mode.

Signed-off-by: Nishit Sharma <nishit.sharma@intel.com>
---
 tests/intel/xe_exec_store.c | 38 +++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/tests/intel/xe_exec_store.c b/tests/intel/xe_exec_store.c
index 989d9e6b9..5930f16e5 100644
--- a/tests/intel/xe_exec_store.c
+++ b/tests/intel/xe_exec_store.c
@@ -28,6 +28,7 @@
 
 #define STORE 0
 #define COND_BATCH 1
+#define MAX_DATA_WRITE ((size_t)(262143)) //Maximum data MEM_COPY operate for linear mode
 
 struct data {
 	uint32_t batch[16];
@@ -437,13 +438,17 @@ static void mem_transection_ordering(int fd, size_t bo_size, bool fence)
 	int count = 3; // src, bounce, dest, batch
 	int i, b = 0;
 	uint64_t offset[count];
+	uint64_t dst_offset;
+	uint64_t src_offset;
 	uint32_t exec_queues, vm, syncobjs;
 	uint32_t bo[count], *bo_map[count];
 	uint64_t ahnd;
 	uint32_t *batch_map;
 	int src_idx = 0, dst_idx = 1;
+	size_t bytes_written, size;
 
-	bo_size = xe_bb_size(fd, bo_size);
+	bo_size = ALIGN(bo_size, xe_get_default_alignment(fd));
+	bytes_written = bo_size;
 	vm = xe_vm_create(fd, 0, 0);
 	ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_SIMPLE);
 	exec_queues = xe_exec_queue_create(fd, vm, &inst, 0);
@@ -467,16 +472,25 @@ static void mem_transection_ordering(int fd, size_t bo_size, bool fence)
 	for (i = 0; i < bo_size; i++)
 		((uint8_t *)bo_map[src_idx])[i] = i % bo_size;
 
-	batch_map[b++] = MEM_COPY_CMD;
-	batch_map[b++] = bo_size - 1;// src # of bytes
-	batch_map[b++] = 0; //src height
-	batch_map[b++] = -1; // src pitch
-	batch_map[b++] = -1; // dist pitch
-	batch_map[b++] = offset[src_idx];
-	batch_map[b++] = offset[src_idx]  >> 32;
-	batch_map[b++] = offset[dst_idx];
-	batch_map[b++] = offset[dst_idx]  >> 32;
-	batch_map[b++] = intel_get_uc_mocs_index(fd) << 25 | intel_get_uc_mocs_index(fd);
+	dst_offset = offset[dst_idx];
+	src_offset = offset[src_idx];
+	while (bo_size) {
+		size = min(MAX_DATA_WRITE, bo_size);
+		batch_map[b++] = MEM_COPY_CMD;
+		batch_map[b++] = size - 1;// src # of bytes
+		batch_map[b++] = 0; //src height
+		batch_map[b++] = -1; // src pitch
+		batch_map[b++] = -1; // dist pitch
+		batch_map[b++] = src_offset;
+		batch_map[b++] = src_offset  >> 32;
+		batch_map[b++] = dst_offset;
+		batch_map[b++] = dst_offset  >> 32;
+		batch_map[b++] = intel_get_uc_mocs_index(fd) << 25 | intel_get_uc_mocs_index(fd);
+
+		src_offset += size;
+		dst_offset += size;
+		bo_size -= size;
+	}
 	if (fence)
 		batch_map[b++] = MI_MEM_FENCE | MI_WRITE_FENCE;
 
@@ -489,7 +503,7 @@ static void mem_transection_ordering(int fd, size_t bo_size, bool fence)
 	igt_assert(syncobj_wait(fd, &syncobjs, 1, INT64_MAX, 0, NULL));
 
 	if (fence) {
-		igt_assert(memcmp(bo_map[src_idx], bo_map[dst_idx], bo_size) == 0);
+		igt_assert(memcmp(bo_map[src_idx], bo_map[dst_idx], bytes_written) == 0);
 	} else {
 		bool detected_out_of_order = false;
 
-- 
2.34.1


  parent reply	other threads:[~2026-02-20  9:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20  9:30 [PATCH i-g-t 0/3] Add memory write ordering verification nishit.sharma
2026-02-20  9:30 ` [PATCH i-g-t 1/3] tests/intel/xe_exec_store: Validate PCIe6 relax ordering nishit.sharma
2026-02-24  4:25   ` Dandamudi, Priyanka
2026-02-20  9:30 ` nishit.sharma [this message]
2026-02-20  9:30 ` [PATCH i-g-t 3/3] tests/intel/xe_exec_store: Extending test scope for PCIE6 " nishit.sharma
2026-02-24  4:26   ` Dandamudi, Priyanka
2026-02-20 10:06 ` ✓ Xe.CI.BAT: success for Add memory write ordering verification Patchwork
2026-02-20 10:23 ` ✓ i915.CI.BAT: " Patchwork
2026-02-20 12:26 ` ✓ i915.CI.Full: " Patchwork
2026-02-20 21:44 ` ✗ Xe.CI.FULL: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260220093041.1911492-3-nishit.sharma@intel.com \
    --to=nishit.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=priyanka.dandamudi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox