public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3] tests/prime_vgem: Skip basic-read/write subtests if not supported
Date: Tue, 26 Nov 2019 15:45:34 +0100	[thread overview]
Message-ID: <20191126144534.23510-1-janusz.krzysztofik@linux.intel.com> (raw)

As we've agreed that using I915_GEM_PREAD/PWRITE IOCTLs on dma-buf
objects doesn't make much sense, we are not going to extend their
handlers in the i915 driver with new processing paths required for them
to work correctly with dma-buf objects on future hardware with no
mappable aperture.  When running on that kind of hardware, just skip
subtests which use those IOCTLs.

v2: Examine pread/pwrite ABI, not mmap ABI (Chris)
v3: Don't use "no mappable GGTT" wording in commit message (Chris)

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/ioctl_wrappers.c | 2 +-
 lib/ioctl_wrappers.h | 1 +
 tests/prime_vgem.c   | 6 ++++++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 628f8b83..78b92bd2 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -356,7 +356,7 @@ void gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64
 	igt_assert_eq(__gem_write(fd, handle, offset, buf, length), 0);
 }
 
-static int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length)
+int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length)
 {
 	struct drm_i915_gem_pread gem_pread;
 	int err;
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index f2412d78..97f278ed 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -69,6 +69,7 @@ uint32_t gem_open(int fd, uint32_t name);
 void gem_close(int fd, uint32_t handle);
 int __gem_write(int fd, uint32_t handle, uint64_t offset, const void *buf, uint64_t length);
 void gem_write(int fd, uint32_t handle, uint64_t offset,  const void *buf, uint64_t length);
+int __gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length);
 void gem_read(int fd, uint32_t handle, uint64_t offset, void *buf, uint64_t length);
 int __gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write);
 void gem_set_domain(int fd, uint32_t handle, uint32_t read, uint32_t write);
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 04cc913d..6595818c 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -46,6 +46,8 @@ static void test_read(int vgem, int i915)
 	handle = prime_fd_to_handle(i915, dmabuf);
 	close(dmabuf);
 
+	igt_skip_on(__gem_read(i915, handle, 0, &i, sizeof(i)));
+
 	ptr = vgem_mmap(vgem, &scratch, PROT_WRITE);
 	for (i = 0; i < 1024; i++)
 		ptr[1024*i] = i;
@@ -81,6 +83,8 @@ static void test_fence_read(int i915, int vgem)
 	handle = prime_fd_to_handle(i915, dmabuf);
 	close(dmabuf);
 
+	igt_skip_on(__gem_read(i915, handle, 0, &i, sizeof(i)));
+
 	igt_fork(child, 1) {
 		close(master[0]);
 		close(slave[1]);
@@ -191,6 +195,8 @@ static void test_write(int vgem, int i915)
 	handle = prime_fd_to_handle(i915, dmabuf);
 	close(dmabuf);
 
+	igt_skip_on(__gem_write(i915, handle, 0, &i, sizeof(i)));
+
 	ptr = vgem_mmap(vgem, &scratch, PROT_READ);
 	gem_close(vgem, scratch.handle);
 
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-11-26 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 14:45 Janusz Krzysztofik [this message]
2019-11-26 16:00 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/prime_vgem: Skip basic-read/write subtests if not supported Patchwork
2019-11-27  2:14 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-11-28  8:50   ` Janusz Krzysztofik

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=20191126144534.23510-1-janusz.krzysztofik@linux.intel.com \
    --to=janusz.krzysztofik@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.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