Skip to contentSkip to conversation

tests/drv_getparams: Skip instead of fail on EINVAL

PATCH In review [email protected] 2 participants 4 messages Mar 24, 2015 – Apr 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/drv_getparams: Skip instead of fail on EINVAL

From: Jeff McGee <[email protected]>

Avoid failing on older kernels where the GETPARAM interfaces don't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89669

---
 tests/drv_getparams.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
tests/drv_getparams.c +4 -6
index f383662..1861fb8 100644
@@ -77,6 +77,7 @@ subslice_total(void)
 	int ret;
 
 	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
+	igt_skip_on_f(ret == -EINVAL, "Interface not supported by kernel\n");
 
 	if (ret) {
 		/*
@@ -93,9 +94,7 @@ subslice_total(void)
 		 * fail them if we are here.
 		*/
 		} else {
-			igt_assert_neq(ret, EINVAL); /* request not recognized? */
-			igt_assert_neq(ret, ENODEV); /* device not supported? */
-			igt_assert_eq(ret, 0); /* other error? */
+			igt_assert_eq(ret, 0);
 		}
 	} else {
 		/*
@@ -115,6 +114,7 @@ eu_total(void)
 	int ret;
 
 	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
+	igt_skip_on_f(ret == -EINVAL, "Interface not supported by kernel\n");
 
 	if (ret) {
 		/*
@@ -131,9 +131,7 @@ eu_total(void)
 		 * fail them if we are here.
 		*/
 		} else {
-			igt_assert_neq(ret, EINVAL); /* request not recognized? */
-			igt_assert_neq(ret, ENODEV); /* device not supported? */
-			igt_assert_eq(ret, 0); /* other error? */
+			igt_assert_eq(ret, 0);
 		}
 	} else {
 		/*
Signature · 6 lines
2.3.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#1 lore raw
Quoted 8 lines · On Tue, Mar 24, 2015 at 11:30:57AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

Avoid failing on older kernels where the GETPARAM interfaces don't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89669

---

This is very simple. Can we merge it?
-Jeff

Quoted 48 lines
 tests/drv_getparams.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
tests/drv_getparams.c +4 -6
index f383662..1861fb8 100644
@@ -77,6 +77,7 @@ subslice_total(void)
 	int ret;
 
 	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
+	igt_skip_on_f(ret == -EINVAL, "Interface not supported by kernel\n");
 
 	if (ret) {
 		/*
@@ -93,9 +94,7 @@ subslice_total(void)
 		 * fail them if we are here.
 		*/
 		} else {
-			igt_assert_neq(ret, EINVAL); /* request not recognized? */
-			igt_assert_neq(ret, ENODEV); /* device not supported? */
-			igt_assert_eq(ret, 0); /* other error? */
+			igt_assert_eq(ret, 0);
 		}
 	} else {
 		/*
@@ -115,6 +114,7 @@ eu_total(void)
 	int ret;
 
 	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
+	igt_skip_on_f(ret == -EINVAL, "Interface not supported by kernel\n");
 
 	if (ret) {
 		/*
@@ -131,9 +131,7 @@ eu_total(void)
 		 * fail them if we are here.
 		*/
 		} else {
-			igt_assert_neq(ret, EINVAL); /* request not recognized? */
-			igt_assert_neq(ret, ENODEV); /* device not supported? */
-			igt_assert_eq(ret, 0); /* other error? */
+			igt_assert_eq(ret, 0);
 		}
 	} else {
 		/*
Signature · 1 line
2.3.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 11 lines · Jeff McGee
Quoted 8 lines · On Tue, Mar 24, 2015 at 11:30:57AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

Avoid failing on older kernels where the GETPARAM interfaces don't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89669

---

This is very simple. Can we merge it?

I did one week ago, simply forgot to send out the confirmation mail. My mo for checking for merged patches is to use

$ git pull --rebase

and see what's left (or something similar). At least git is a lot better at tracking than me ;-)
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#3 lore raw
Quoted 13 lines · Daniel Vetter
Quoted 11 lines · Jeff McGee
Quoted 8 lines · On Tue, Mar 24, 2015 at 11:30:57AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

Avoid failing on older kernels where the GETPARAM interfaces don't exist.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89669

---

This is very simple. Can we merge it?

Quoted 8 lines

I did one week ago, simply forgot to send out the confirmation mail. My mo for checking for merged patches is to use

$ git pull --rebase

and see what's left (or something similar). At least git is a lot better at tracking than me ;-)
-Daniel

Oops. Yeah, you've spoiled me with the confirmation mail. I'll double check in the code from here on. Thanks
-Jeff
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx