Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH i-g-t 03/17] lib/ioctl: gem_ prefix for igt_require_mmap_wc
Date: Tue, 10 Feb 2015 19:05:46 +0100	[thread overview]
Message-ID: <1423591560-9471-3-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1423591560-9471-1-git-send-email-daniel.vetter@ffwll.ch>

We stick to the overall prefix even for magic require functions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/ioctl_wrappers.h        | 11 ++++++++++-
 tests/gem_concurrent_blit.c |  4 ++--
 tests/gem_fence_upload.c    |  2 +-
 tests/gem_mmap_wc.c         | 16 ++++++++--------
 tests/gem_tiled_wc.c        |  2 +-
 5 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index a1017ecd3767..8d8fa46d1942 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -65,7 +65,16 @@ void *gem_mmap__cpu(int fd, uint32_t handle, int offset, int size, int prot);
 
 bool gem_mmap__has_wc(int fd);
 void *gem_mmap__wc(int fd, uint32_t handle, int offset, int size, int prot);
-#define igt_require_mmap_wc(x) igt_require(gem_mmap__has_wc(x))
+
+/**
+ * gem_require_mmap_wc:
+ * @fd: open i915 drm file descriptor
+ *
+ * Feature test macro to query whether direct (i.e. cpu access path, bypassing
+ * the gtt) write-combine memory mappings are available. Automatically skips
+ * through igt_require() if not.
+ */
+#define gem_require_mmap_wc(x) igt_require(gem_mmap__has_wc(x))
 
 /**
  * gem_mmap:
diff --git a/tests/gem_concurrent_blit.c b/tests/gem_concurrent_blit.c
index 245ad4581783..cec6ea49f95c 100644
--- a/tests/gem_concurrent_blit.c
+++ b/tests/gem_concurrent_blit.c
@@ -174,7 +174,7 @@ wc_create_bo(drm_intel_bufmgr *bufmgr, int width, int height)
 {
 	drm_intel_bo *bo;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	bo = unmapped_create_bo(bufmgr, width, height);
 	bo->virtual = gem_mmap__wc(fd, bo->handle, 0, bo->size, PROT_READ | PROT_WRITE);
@@ -696,7 +696,7 @@ static void gtt_require(void)
 static void wc_require(void)
 {
 	bit17_require();
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 }
 
 static void bcs_require(void)
diff --git a/tests/gem_fence_upload.c b/tests/gem_fence_upload.c
index 81f797b4ba86..9595bc822e59 100644
--- a/tests/gem_fence_upload.c
+++ b/tests/gem_fence_upload.c
@@ -345,7 +345,7 @@ static void wc_contention(void)
 	double linear[2], tiled[2];
 
 	fd = drm_open_any();
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	num_fences = gem_available_fences(fd);
 	igt_require(num_fences > 0);
diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c
index 87916b6e81c0..73a97d556927 100644
--- a/tests/gem_mmap_wc.c
+++ b/tests/gem_mmap_wc.c
@@ -130,7 +130,7 @@ test_copy(int fd)
 {
 	void *src, *dst;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	/* copy from a fresh src to fresh dst to force pagefault on both */
 	src = create_pointer(fd);
@@ -180,7 +180,7 @@ test_read_write2(int fd, enum test_read_write order)
 	void *r, *w;
 	volatile uint32_t val = 0;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	handle = gem_create(fd, OBJECT_SIZE);
 	set_domain(fd, handle);
@@ -210,7 +210,7 @@ test_write(int fd)
 	void *src;
 	uint32_t dst;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	/* copy from a fresh src to fresh dst to force pagefault on both */
 	src = create_pointer(fd);
@@ -229,7 +229,7 @@ test_write_gtt(int fd)
 	char *dst_gtt;
 	void *src;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	dst = gem_create(fd, OBJECT_SIZE);
 	set_domain(fd, dst);
@@ -253,7 +253,7 @@ test_read(int fd)
 	void *dst;
 	uint32_t src;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	/* copy from a fresh src to fresh dst to force pagefault on both */
 	dst = create_pointer(fd);
@@ -271,7 +271,7 @@ test_write_cpu_read_wc(int fd)
 	uint32_t handle;
 	uint32_t *src, *dst;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	handle = gem_create(fd, OBJECT_SIZE);
 
@@ -296,7 +296,7 @@ test_write_gtt_read_wc(int fd)
 	uint32_t handle;
 	uint32_t *src, *dst;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	handle = gem_create(fd, OBJECT_SIZE);
 	set_domain(fd, handle);
@@ -390,7 +390,7 @@ test_fault_concurrent(int fd)
 	struct thread_fault_concurrent thread[64];
 	int n;
 
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	for (n = 0; n < 32; n++) {
 		ptr[n] = create_pointer(fd);
diff --git a/tests/gem_tiled_wc.c b/tests/gem_tiled_wc.c
index f705378173d7..b0f7a655a17a 100644
--- a/tests/gem_tiled_wc.c
+++ b/tests/gem_tiled_wc.c
@@ -136,7 +136,7 @@ igt_simple_main
 	uint32_t handle;
 
 	fd = drm_open_any();
-	igt_require_mmap_wc(fd);
+	gem_require_mmap_wc(fd);
 
 	handle = create_bo(fd);
 	get_tiling(fd, handle, &tiling, &swizzle);
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-02-10 18:04 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 18:05 [PATCH i-g-t 01/17] lib/gt: api polish for igt_can_hang_ring Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 02/17] lib/ioctl: api polish for gem_context_has_param Daniel Vetter
2015-02-10 18:05 ` Daniel Vetter [this message]
2015-02-10 21:58   ` [PATCH i-g-t 03/17] lib/ioctl: gem_ prefix for igt_require_mmap_wc Chris Wilson
2015-02-11  8:37     ` Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 04/17] igt/ioctls: doc for gem_mmap Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 05/17] lib/ioctls: make gem_context_set/get_param infallible Daniel Vetter
2015-02-10 21:54   ` Chris Wilson
2015-02-11  8:42     ` Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 06/17] lib/ioctl: Add gem_context_destroy helpers Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 07/17] tests/gem_ctx_*: Use helpers Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 08/17] tests/gem_reset_stat: Use new ctx helpers Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 09/17] lib/ioctl: Document ctx param functions Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 10/17] tests: Add gem_ctx_param_basic Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 11/17] tests: Add invalid pad tests for ctx create/destroy Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 12/17] tests/gem_ppgtt: Start rcs before bcs for context tests Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 13/17] tests: Align subtest with naming convention Daniel Vetter
2015-02-10 21:53   ` Chris Wilson
2015-02-11  8:44     ` Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 14/17] lib/igt_aux: s/swap/igt_swap/ Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 15/17] tests/gem_wait: Adjust makefile Daniel Vetter
2015-02-10 18:05 ` [PATCH i-g-t 16/17] doc: Consolidate naming conventions into docbook Daniel Vetter
2015-02-10 18:06 ` [PATCH i-g-t 17/17] lib/igt_gt: Document and consolidate Daniel Vetter
2015-02-10 21:36 ` [PATCH i-g-t 01/17] lib/gt: api polish for igt_can_hang_ring Chris Wilson
2015-02-10 21:56   ` Daniel Vetter
2015-02-10 21:59   ` [PATCH i-g-t] lib/chipset: Cache devid Daniel Vetter
2015-02-10 22:28     ` Chris Wilson
2015-02-10 22:37       ` Daniel Vetter
2015-02-10 22:39         ` Daniel Vetter
2015-02-10 22:45           ` Daniel Vetter
2015-02-10 22:50             ` Chris Wilson
2015-02-11  8:49               ` Daniel Vetter

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=1423591560-9471-3-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@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