Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/5] lib/xe/ioctl: introduce xe_bb_size() helper
@ 2024-01-24 18:07 Matthew Auld
  2024-01-24 18:07 ` [PATCH i-g-t 2/5] tests/intel/xe: account for prefetch Matthew Auld
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Matthew Auld @ 2024-01-24 18:07 UTC (permalink / raw)
  To: igt-dev

We have a number of tests open coding this, plus some tests lacking any
handling for the prefetch size, leading to CAT errors due to overfetch
hitting an invalid page. End goal is to fix all the tests that are
missing the overfetch handling first, using the new helper, and then
convert all the places that were open coding this.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 lib/xe/xe_ioctl.c | 6 ++++++
 lib/xe/xe_ioctl.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
index d3f9905ee..da2a7af51 100644
--- a/lib/xe/xe_ioctl.c
+++ b/lib/xe/xe_ioctl.c
@@ -51,6 +51,12 @@ uint32_t xe_cs_prefetch_size(int fd)
 	return 4096;
 }
 
+uint64_t xe_bb_size(int fd, uint64_t reqsize)
+{
+	return ALIGN(reqsize + xe_cs_prefetch_size(fd),
+	             xe_get_default_alignment(fd));
+}
+
 uint32_t xe_vm_create(int fd, uint32_t flags, uint64_t ext)
 {
 	struct drm_xe_vm_create create = {
diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
index 03932561d..2b30f1d98 100644
--- a/lib/xe/xe_ioctl.h
+++ b/lib/xe/xe_ioctl.h
@@ -18,6 +18,7 @@
 #define DRM_XE_UFENCE_WAIT_MASK_U64    0xffffffffffffffffu
 
 uint32_t xe_cs_prefetch_size(int fd);
+uint64_t xe_bb_size(int fd, uint64_t reqsize);
 uint32_t xe_vm_create(int fd, uint32_t flags, uint64_t ext);
 int  __xe_vm_bind(int fd, uint32_t vm, uint32_t exec_queue, uint32_t bo,
 		  uint64_t offset, uint64_t addr, uint64_t size, uint32_t op,
-- 
2.43.0


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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-24 18:07 [PATCH i-g-t 1/5] lib/xe/ioctl: introduce xe_bb_size() helper Matthew Auld
2024-01-24 18:07 ` [PATCH i-g-t 2/5] tests/intel/xe: account for prefetch Matthew Auld
2024-01-25  6:12   ` Zbigniew Kempczyński
2024-01-24 18:07 ` [PATCH i-g-t 3/5] benchmarks/gem_wsim: use xe_bb_size() helper Matthew Auld
2024-01-25  6:12   ` Zbigniew Kempczyński
2024-01-24 18:07 ` [PATCH i-g-t 4/5] lib/igt_fb: " Matthew Auld
2024-01-25  6:12   ` Zbigniew Kempczyński
2024-01-24 18:07 ` [PATCH i-g-t 5/5] tests/intel/xe: " Matthew Auld
2024-01-25  6:15   ` Zbigniew Kempczyński
2024-01-24 18:51 ` ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/5] lib/xe/ioctl: introduce " Patchwork
2024-01-24 19:02 ` ✓ CI.xeBAT: success " Patchwork
2024-01-25  6:06 ` [PATCH i-g-t 1/5] " Zbigniew Kempczyński

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