All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] tests/gem_mmap_wc: SKIP if the Kernel is too old for the getparam flag
@ 2015-08-04 19:53 Paulo Zanoni
  2015-08-05  8:33 ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Paulo Zanoni @ 2015-08-04 19:53 UTC (permalink / raw)
  To: intel-gfx

If the Kernel is too old, getparam will return -EINVAL. Just SKIP on
this case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89739
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 tests/gem_mmap_wc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c
index 6e43465..f9d001a 100644
--- a/tests/gem_mmap_wc.c
+++ b/tests/gem_mmap_wc.c
@@ -93,6 +93,7 @@ test_invalid_flags(int fd)
 	struct local_i915_gem_mmap_v2 arg;
 	uint64_t flag = I915_MMAP_WC;
 	int val = -1;
+	int rc;
 
 	memset(&arg, 0, sizeof(arg));
 	arg.handle = gem_create(fd, 4096);
@@ -104,7 +105,9 @@ test_invalid_flags(int fd)
 	gp.value = &val;
 
 	/* Do we have the new mmap_ioctl? */
-	do_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+	rc = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+	igt_skip_on(rc == -1 && errno == EINVAL);
+	igt_assert(rc == 0);
 
 	if (val >= 1) {
 		/*
-- 
2.4.6

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

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

* Re: [PATCH igt] tests/gem_mmap_wc: SKIP if the Kernel is too old for the getparam flag
  2015-08-04 19:53 [PATCH igt] tests/gem_mmap_wc: SKIP if the Kernel is too old for the getparam flag Paulo Zanoni
@ 2015-08-05  8:33 ` Chris Wilson
  2015-08-05 17:59   ` [PATCH igt] tests/gem_mmap_wc: don't fail " Paulo Zanoni
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2015-08-05  8:33 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx

On Tue, Aug 04, 2015 at 04:53:11PM -0300, Paulo Zanoni wrote:
> If the Kernel is too old, getparam will return -EINVAL. Just SKIP on
> this case.

Nope. Just replace do_ioctl() with drmIoctl. Better would be to actually
do a gem_get_param().
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH igt] tests/gem_mmap_wc: don't fail if the Kernel is too old for the getparam flag
  2015-08-05  8:33 ` Chris Wilson
@ 2015-08-05 17:59   ` Paulo Zanoni
  2015-08-05 18:45     ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Paulo Zanoni @ 2015-08-05 17:59 UTC (permalink / raw)
  To: intel-gfx

Just don't check the drmIoctl() return code: the "if (val)" should be
enough to prevent any problems.

v2: Don't SKIP, just proceed (Chris).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89739
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 tests/gem_mmap_wc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c
index 6e43465..0a5326e 100644
--- a/tests/gem_mmap_wc.c
+++ b/tests/gem_mmap_wc.c
@@ -104,7 +104,7 @@ test_invalid_flags(int fd)
 	gp.value = &val;
 
 	/* Do we have the new mmap_ioctl? */
-	do_ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
+	drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
 
 	if (val >= 1) {
 		/*
-- 
2.4.6

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

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

* Re: [PATCH igt] tests/gem_mmap_wc: don't fail if the Kernel is too old for the getparam flag
  2015-08-05 17:59   ` [PATCH igt] tests/gem_mmap_wc: don't fail " Paulo Zanoni
@ 2015-08-05 18:45     ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2015-08-05 18:45 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx

On Wed, Aug 05, 2015 at 02:59:28PM -0300, Paulo Zanoni wrote:
> Just don't check the drmIoctl() return code: the "if (val)" should be
> enough to prevent any problems.
> 
> v2: Don't SKIP, just proceed (Chris).
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89739
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-08-05 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-04 19:53 [PATCH igt] tests/gem_mmap_wc: SKIP if the Kernel is too old for the getparam flag Paulo Zanoni
2015-08-05  8:33 ` Chris Wilson
2015-08-05 17:59   ` [PATCH igt] tests/gem_mmap_wc: don't fail " Paulo Zanoni
2015-08-05 18:45     ` Chris Wilson

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.