From: Matthew Auld <matthew.auld@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t v2 1/7] lib/xe/ioctl: introduce xe_bb_size() helper
Date: Thu, 25 Jan 2024 10:56:39 +0000 [thread overview]
Message-ID: <20240125105646.313561-1-matthew.auld@intel.com> (raw)
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>
Reviewed-by: 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
next reply other threads:[~2024-01-25 10:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 10:56 Matthew Auld [this message]
2024-01-25 10:56 ` [PATCH i-g-t v2 2/7] lib/xe_spin: account for prefetch Matthew Auld
2024-01-26 6:20 ` Zbigniew Kempczyński
2024-01-25 10:56 ` [PATCH i-g-t v2 3/7] tests/intel/xe: " Matthew Auld
2024-01-25 10:56 ` [PATCH i-g-t v2 4/7] benchmarks/gem_wsim: use xe_bb_size() helper Matthew Auld
2024-01-25 10:56 ` [PATCH i-g-t v2 5/7] lib/igt_fb: " Matthew Auld
2024-01-25 10:56 ` [PATCH i-g-t v2 6/7] tests/intel/xe: " Matthew Auld
2024-01-25 10:56 ` [PATCH i-g-t v2 7/7] lib/intel_blt: use BYTE_COPY mode on xe2 Matthew Auld
2024-01-25 11:43 ` ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v2,1/7] lib/xe/ioctl: introduce xe_bb_size() helper Patchwork
2024-01-26 10:06 ` Kamil Konieczny
2024-01-29 7:16 ` Illipilli, TejasreeX
2024-01-25 12:05 ` ✓ CI.xeBAT: success " Patchwork
2024-01-29 7:14 ` ✓ Fi.CI.BAT: " Patchwork
2024-01-29 8:36 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-01-29 10:05 ` Kamil Konieczny
2024-02-01 8:14 ` Illipilli, TejasreeX
2024-02-01 5:51 ` ✓ Fi.CI.IGT: success " 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=20240125105646.313561-1-matthew.auld@intel.com \
--to=matthew.auld@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