All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 2/3] tests: Use gem_available_fences()
Date: Tue,  9 Apr 2013 15:25:38 +0300	[thread overview]
Message-ID: <1365510339-10576-3-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1365510339-10576-1-git-send-email-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

lib/drmtest.c provides gem_available_fences(). Use it where
appropriate.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/gem_fence_thrash.c       | 8 ++------
 tests/gem_fenced_exec_thrash.c | 8 ++------
 tests/gem_stress.c             | 8 ++------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 01fd0f6..e1cfc4e 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -169,19 +169,15 @@ static int run_test(int threads_per_fence, void *f, int tiling,
 		    int surfaces_per_thread)
 {
 	struct test t;
-	drm_i915_getparam_t gp;
 	pthread_t *threads;
 	int n, num_fences, num_threads;
-	int ret;
 
 	t.fd = drm_open_any();
 	t.tiling = tiling;
 	t.num_surfaces = surfaces_per_thread;
 
-	gp.param = I915_PARAM_NUM_FENCES_AVAIL;
-	gp.value = &num_fences;
-	ret = ioctl(t.fd, DRM_IOCTL_I915_GETPARAM, &gp);
-	assert (ret == 0);
+	num_fences = gem_available_fences(t.fd);
+	assert (num_fences > 0);
 
 	num_threads = threads_per_fence * num_fences;
 
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index b17eba2..ca88c53 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -88,13 +88,9 @@ batch_create (int fd)
 
 static int get_num_fences(int fd)
 {
-	drm_i915_getparam_t gp;
-	int ret, val;
+	int val;
 
-	gp.param = I915_PARAM_NUM_FENCES_AVAIL;
-	gp.value = &val;
-	ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
-	assert (ret == 0);
+	val = gem_available_fences(fd);
 
 	printf ("total %d fences\n", val);
 	assert(val > 4);
diff --git a/tests/gem_stress.c b/tests/gem_stress.c
index 54597af..9b31a69 100644
--- a/tests/gem_stress.c
+++ b/tests/gem_stress.c
@@ -605,13 +605,9 @@ static void copy_tiles(unsigned *permutation)
 
 static int get_num_fences(void)
 {
-	drm_i915_getparam_t gp;
-	int ret, val;
+	int val;
 
-	gp.param = I915_PARAM_NUM_FENCES_AVAIL;
-	gp.value = &val;
-	ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
-	assert (ret == 0);
+	val = gem_available_fences(drm_fd);
 
 	printf ("total %d fences\n", val);
 	assert(val > 4);
-- 
1.8.1.5

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

  parent reply	other threads:[~2013-04-09 12:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 12:25 [PATCH i-g-t 0/3] Fence register stuff ville.syrjala
2013-04-09 12:25 ` [PATCH i-g-t 1/3] tests/gem_fenced_exec_thrash: Increase MAX_FENCES to 32 ville.syrjala
2013-04-09 13:05   ` Chris Wilson
2013-04-11 17:43     ` [PATCH] tests/gem_fenced_exec_thrash: Test with > max fences ville.syrjala
2013-04-11 18:22       ` Daniel Vetter
2013-04-09 12:25 ` ville.syrjala [this message]
2013-04-09 12:25 ` [PATCH i-g-t 3/3] tests/gem_tiling_max_stride: Add a test for max fence stride ville.syrjala
2013-04-09 13:06   ` Chris Wilson
2013-04-09 13:41     ` [PATCH i-g-t v2] " ville.syrjala
2013-04-09 13:51       ` Chris Wilson
2013-04-09 14:45         ` [PATCH i-g-t v4] " ville.syrjala
2013-04-09 18:06           ` Chris Wilson
2013-04-09 18:21             ` 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=1365510339-10576-3-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.