Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Dugast <francois.dugast@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Francois Dugast <francois.dugast@intel.com>
Subject: [PATCH i-g-t 3/5] lib/intel_blt: Use blt_mem_copy() to stress copy functions
Date: Wed,  5 Mar 2025 10:06:13 +0100	[thread overview]
Message-ID: <20250305090743.16894-4-francois.dugast@intel.com> (raw)
In-Reply-To: <20250305090743.16894-1-francois.dugast@intel.com>

The new blt_mem_copy() argument ncopies is handed over to the
underlying function blt_bo_copy() which actually runs the copy, so
that the caller of blt_mem_copy() can use a higher level function
to stress the hardware copy function.

Signed-off-by: Francois Dugast <francois.dugast@intel.com>
---
 lib/intel_blt.c             | 5 +++--
 lib/intel_blt.h             | 2 +-
 tests/intel/xe_copy_basic.c | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 315a2e145..5cdf1ea8d 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -1917,11 +1917,12 @@ int blt_mem_copy(int fd, const intel_ctx_t *ctx,
  * @width: width
  * @height: height
  * @region: memory region
+ * @ncopies: how many times copy is run, > 1 can be used to stress the copy function
  *
  * Copy BO with mem blit from @src_handle into @dst_handle.
  */
 void blt_bo_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_ctx_t *ctx,
-		 uint32_t size, uint32_t width, uint32_t height, uint32_t region)
+		 uint32_t size, uint32_t width, uint32_t height, uint32_t region, int ncopies)
 {
 	struct blt_mem_data mem = {};
 	uint64_t bb_size = xe_bb_size(fd, SZ_4K);
@@ -1948,7 +1949,7 @@ void blt_bo_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_c
 	blt_set_batch(&mem.bb, bb, bb_size, region);
 	igt_assert(mem.src.width == mem.dst.width);
 
-	blt_mem_copy(fd, ctx, NULL, ahnd, &mem, 1);
+	blt_mem_copy(fd, ctx, NULL, ahnd, &mem, ncopies);
 	result = memcmp(mem.src.ptr, mem.dst.ptr, mem.src.size);
 
 	intel_allocator_bind(ahnd, 0, 0);
diff --git a/lib/intel_blt.h b/lib/intel_blt.h
index 217cade02..86681f1dd 100644
--- a/lib/intel_blt.h
+++ b/lib/intel_blt.h
@@ -273,7 +273,7 @@ int blt_mem_copy(int fd, const intel_ctx_t *ctx,
 			 int ncopies);
 
 void blt_bo_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_ctx_t *ctx,
-		 uint32_t size, uint32_t width, uint32_t height, uint32_t region);
+		 uint32_t size, uint32_t width, uint32_t height, uint32_t region, int ncopies);
 
 int blt_mem_set(int fd, const intel_ctx_t *ctx,
 			const struct intel_execution_engine2 *e, uint64_t ahnd,
diff --git a/tests/intel/xe_copy_basic.c b/tests/intel/xe_copy_basic.c
index 458106b0b..20926cbb7 100644
--- a/tests/intel/xe_copy_basic.c
+++ b/tests/intel/xe_copy_basic.c
@@ -44,7 +44,7 @@ static void
 mem_copy(int fd, uint32_t src_handle, uint32_t dst_handle, const intel_ctx_t *ctx,
 	 uint32_t size, uint32_t width, uint32_t height, uint32_t region)
 {
-	blt_bo_copy(fd, src_handle, dst_handle, ctx, size, width, height, region);
+	blt_bo_copy(fd, src_handle, dst_handle, ctx, size, width, height, region, 1);
 }
 
 /**
-- 
2.43.0


  parent reply	other threads:[~2025-03-05  9:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05  9:06 [PATCH i-g-t 0/5] Stress copy engines during render Francois Dugast
2025-03-05  9:06 ` [PATCH i-g-t 1/5] lib/intel_blt: Promote blt_bo_copy() Francois Dugast
2025-03-19 12:41   ` Thomas Hellström
2025-03-19 19:15     ` Zbigniew Kempczyński
2025-03-05  9:06 ` [PATCH i-g-t 2/5] lib/intel_blt: Allow forcing multiple runs in blt_mem_copy() Francois Dugast
2025-03-19 12:42   ` Thomas Hellström
2025-03-05  9:06 ` Francois Dugast [this message]
2025-03-19 12:46   ` [PATCH i-g-t 3/5] lib/intel_blt: Use blt_mem_copy() to stress copy functions Thomas Hellström
2025-03-19 19:21     ` Zbigniew Kempczyński
2025-03-05  9:06 ` [PATCH i-g-t 4/5] tests/intel/xe_render_copy: Expose render duration Francois Dugast
2025-03-19 12:48   ` Thomas Hellström
2025-03-05  9:06 ` [PATCH i-g-t 5/5] tests/intel/xe_render_copy: Render under copy stress Francois Dugast
2025-03-06  4:30 ` ✓ Xe.CI.BAT: success for Stress copy engines during render (rev2) Patchwork
2025-03-06  4:47 ` ✓ i915.CI.BAT: " Patchwork
2025-03-06  7:00 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-06 10:38 ` ✗ Xe.CI.Full: " Patchwork
2025-03-11  7:31 ` ✓ Xe.CI.BAT: success for Stress copy engines during render (rev3) Patchwork
2025-03-11  8:04 ` ✓ i915.CI.BAT: " Patchwork
2025-03-11  9:24 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-12  1:06 ` ✗ Xe.CI.Full: " Patchwork
2025-03-12 22:53 ` ✗ Xe.CI.BAT: failure for Stress copy engines during render (rev4) Patchwork
2025-03-12 23:04 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-12 23:46 ` ✓ i915.CI.Full: " Patchwork
2025-03-13 14:39 ` ✗ Xe.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-03-05 13:57 [PATCH i-g-t 0/5] Stress copy engines during render Francois Dugast
2025-03-05 13:57 ` [PATCH i-g-t 3/5] lib/intel_blt: Use blt_mem_copy() to stress copy functions Francois Dugast

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=20250305090743.16894-4-francois.dugast@intel.com \
    --to=francois.dugast@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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