tests/gem_exec_params: change flags used in invalid-flags test
PATCH 1/1 tests/gem_exec_params: change flags used in invalid-flags test
From: Tim Gore <[email protected]>
The invalid-flags test in gem_exec_params uses (I915_EXEC_HANDLE_LUT << 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use (__I915_EXEC_UNKNOWN_FLAGS) instead. __I915_EXEC_UNKNOWN_FLAGS is defined in i915_drm.h as a mask of all the undefined flags.
--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/gem_exec_params.c +1 -1
@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by gem_exec_lut_handle */ igt_subtest("invalid-flag") { - execbuf.flags =I915_EXEC_RENDER | (I915_EXEC_HANDLE_LUT <<1 ); + execbuf.flags =I915_EXEC_RENDER | (__I915_EXEC_UNKNOWN_FLAGS);RUN_FAIL (EINVAL ); }
Signature · 6 lines
2.2.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 20 lines · On 12/01/15 14:09, [email protected] wrote:
From: Tim Gore <[email protected]>
The invalid-flags test in
gem_exec_paramsuses (I915_EXEC_HANDLE_LUT<< 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use (__I915_EXEC_UNKNOWN_FLAGS) instead.__I915_EXEC_UNKNOWN_FLAGSis defined ini915_drm.has a mask of all the undefined flags.Signed-off-by Tim Gore <[email protected]>--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_exec_params.c +0
-0
tests/gem_exec_params.c igt_main · line 185
Quoted 8 lines
tests/gem_exec_params.c +1
-1@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by gem_exec_lut_handle */ igt_subtest("invalid-flag") { - execbuf.flags =I915_EXEC_RENDER | (I915_EXEC_HANDLE_LUT <<1 ); + execbuf.flags =I915_EXEC_RENDER | (__I915_EXEC_UNKNOWN_FLAGS);RUN_FAIL (EINVAL ); }
Should we perhaps have a test that iterates over each bit in this mask one at a time (to check that EACH of them is correctly detected and rejected) as well as this one with ALL the unknown flag bits set?
.Dave.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 42 lines
-----Original Message-----
From: Gordon, David S
Sent: Monday, January 12, 2015 4:04 PM
To: Gore, Tim; [email protected]
Cc: Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 22 lines · On 12/01/15 14:09, [email protected] wrote:
From: Tim Gore <[email protected]>
The invalid-flags test in
gem_exec_paramsuses (I915_EXEC_HANDLE_LUT<< 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use (__I915_EXEC_UNKNOWN_FLAGS) instead.__I915_EXEC_UNKNOWN_FLAGSis defined ini915_drm.has a mask of all the undefined flags.Signed-off-by Tim Gore <[email protected]>--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_exec_params.c index renamed from tests/gem_exec_params.c +0
-0f63eda9..2a1c544 100644
tests/gem_exec_params.c +0
-0@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by
gem_exec_lut_handle*/tests/gem_exec_params.c
Quoted 2 lines
tests/gem_exec_params.c +0
-1igt_subtest("invalid-flag") { - execbuf.flags = I915_EXEC_RENDER |(
I915_EXEC_HANDLE_LUT<< 1);tests/gem_exec_params.c
Quoted 1 line
tests/gem_exec_params.c +1
-0+ execbuf.flags = I915_EXEC_RENDER |(
__I915_EXEC_UNKNOWN_FLAGS);tests/gem_exec_params.c igt_main · line 184
Quoted 3 lines
tests/gem_exec_params.c +0
-0RUN_FAIL (EINVAL ); }
Quoted 5 lines
Should we perhaps have a test that iterates over each bit in this mask one at a time (to check that EACH of them is correctly detected and rejected) as well as this one with ALL the unknown flag bits set?
.Dave.
Yes, I can do that if people like the idea.
Tim
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 42 lines · Tim
Quoted 42 lines
-----Original Message-----
From: Gordon, David S
Sent: Monday, January 12, 2015 4:04 PM
To: Gore, Tim; [email protected]
Cc: Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 22 lines · On 12/01/15 14:09, [email protected] wrote:
From: Tim Gore <[email protected]>
The invalid-flags test in
gem_exec_paramsuses (I915_EXEC_HANDLE_LUT<< 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use (__I915_EXEC_UNKNOWN_FLAGS) instead.__I915_EXEC_UNKNOWN_FLAGSis defined ini915_drm.has a mask of all the undefined flags.Signed-off-by Tim Gore <[email protected]>--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_exec_params.c index renamed from tests/gem_exec_params.c +0
-0f63eda9..2a1c544 100644
tests/gem_exec_params.c +0
-0@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by
gem_exec_lut_handle*/Quoted 2 lines
igt_subtest("invalid-flag"){
- execbuf.flags =I915_EXEC_RENDER|(
I915_EXEC_HANDLE_LUT<< 1);Quoted 1 line
+ execbuf.flags =
I915_EXEC_RENDER|(
__I915_EXEC_UNKNOWN_FLAGS);Quoted 3 lines
RUN_FAIL(EINVAL); }
Quoted 7 lines
Quoted 5 lines
Should we perhaps have a test that iterates over each bit in this mask one at a time (to check that EACH of them is correctly detected and rejected) as well as this one with ALL the unknown flag bits set?
.Dave.
Yes, I can do that if people like the idea.
Well the testcase should still fail if the kernel is accepting any flags - the idea is very much that every time you add a flag the test fails and will remind you to add the new testcases for the new flag. So any patch which makes LUT << 1 no longer fail the tests if it's not rejected is nacked by me.
Imo you should just carry an igt patch in the android version somewhere to adapt the testcase to your abi changes.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 65 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, January 12, 2015 11:26 PM
To: Gore, Tim
Cc: Gordon, David S; [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 10 lines · Tim
Quoted 10 lines
-----Original Message-----
From: Gordon, David S
Sent: Monday, January 12, 2015 4:04 PM
To: Gore, Tim; [email protected]
Cc: Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 7 lines
Quoted 7 lines · On 12/01/15 14:09, [email protected] wrote:
Quoted 6 lines
From: Tim Gore <[email protected]>
The invalid-flags test in
gem_exec_paramsuses (I915_EXEC_HANDLE_LUT<< 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use(
__I915_EXEC_UNKNOWN_FLAGS) instead.Quoted 26 lines
Quoted 26 lines
Quoted 17 lines
__I915_EXEC_UNKNOWN_FLAGSis defined ini915_drm.has a mask of all the undefined flags.Signed-off-by Tim Gore <[email protected]>--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_exec_params.c +0
-0index
f63eda9..2a1c544 100644tests/gem_exec_params.c +0
-0@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by
gem_exec_lut_handle*/Quoted 2 lines
igt_subtest("invalid-flag"){
- execbuf.flags =I915_EXEC_RENDER|(
I915_EXEC_HANDLE_LUT<< 1);Quoted 1 line
+ execbuf.flags =
I915_EXEC_RENDER|(
__I915_EXEC_UNKNOWN_FLAGS);Quoted 3 lines
RUN_FAIL(EINVAL); }Quoted 8 lines
Quoted 6 lines
Should we perhaps have a test that iterates over each bit in this mask one at a time (to check that EACH of them is correctly detected and
rejected) as well as this one with ALL the unknown flag bits set?.Dave.
Yes, I can do that if people like the idea.
Quoted 8 lines
Well the testcase should still fail if the kernel is accepting any flags - the idea is very much that every time you add a flag the test fails and will remind you to add the new testcases for the new flag. So any patch which makes LUT << 1 no longer fail the tests if it's not rejected is nacked by me.
Imo you should just carry an igt patch in the android version somewhere to adapt the testcase to your abi changes.
-Daniel
No, the patch uses __I915_EXEC_UNKNOWN_FLAGS, which is set in i915_drm.h, and hopefully Is maintained to be the set of all invalid flags. In the upstream version this is set to -(I915_EXEC_HANDLE_LUT<<1). In the android version it is set to -(I915_EXEC_ENABLE_WATCHDOG<<1)
So Using this macro should give you the right test in each case, rather than having a special Android test case that is separately maintained from the actual definition of the flags.
Tim
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 79 lines · Tim
Quoted 65 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, January 12, 2015 11:26 PM
To: Gore, Tim
Cc: Gordon, David S; [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 10 lines · Tim
Quoted 10 lines
-----Original Message-----
From: Gordon, David S
Sent: Monday, January 12, 2015 4:04 PM
To: Gore, Tim; [email protected]
Cc: Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 7 lines
Quoted 7 lines · On 12/01/15 14:09, [email protected] wrote:
Quoted 6 lines
From: Tim Gore <[email protected]>
The invalid-flags test in
gem_exec_paramsuses (I915_EXEC_HANDLE_LUT<< 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use(
__I915_EXEC_UNKNOWN_FLAGS) instead.Quoted 26 lines
Quoted 26 lines
Quoted 17 lines
__I915_EXEC_UNKNOWN_FLAGSis defined ini915_drm.has a mask of all the undefined flags.Signed-off-by Tim Gore <[email protected]>--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_exec_params.c +0
-0index
f63eda9..2a1c544 100644tests/gem_exec_params.c +0
-0@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by
gem_exec_lut_handle*/Quoted 2 lines
igt_subtest("invalid-flag"){
- execbuf.flags =I915_EXEC_RENDER|(
I915_EXEC_HANDLE_LUT<< 1);Quoted 1 line
+ execbuf.flags =
I915_EXEC_RENDER|(
__I915_EXEC_UNKNOWN_FLAGS);Quoted 3 lines
RUN_FAIL(EINVAL); }Quoted 8 lines
Quoted 6 lines
Should we perhaps have a test that iterates over each bit in this mask one at a time (to check that EACH of them is correctly detected and
rejected) as well as this one with ALL the unknown flag bits set?.Dave.
Yes, I can do that if people like the idea.
Quoted 8 lines
Well the testcase should still fail if the kernel is accepting any flags - the idea is very much that every time you add a flag the test fails and will remind you to add the new testcases for the new flag. So any patch which makes LUT << 1 no longer fail the tests if it's not rejected is nacked by me.
Imo you should just carry an igt patch in the android version somewhere to adapt the testcase to your abi changes.
-DanielNo, the patch uses
__I915_EXEC_UNKNOWN_FLAGS, which is set ini915_drm.h, and hopefully Is maintained to be the set of all invalid flags. In the upstream version this is set to(quoted diff) +0
-2-(I915_EXEC_HANDLE_LUT<<1). In the android version it is set to -(I915_EXEC_ENABLE_WATCHDOG<<1)
Quoted 2 lines
So Using this macro should give you the right test in each case, rather than having a special Android test case that is separately maintained from the actual definition of the flags.
Yeah I mixed things up a bit. But my point is that hardcoding the invalid flags forces you to update the testcase since when you add a new flag it fails. With your patch it gets magically fixed with a recompile, which makes it a lot easier for people to forget writing the new testcases.
It has the downside that the tests are specific to a given kernel branch/release, but that's why we started tagging them roughly in lockstep with the otc qa release testing. Definitely not a perfect approach, so ideas highly welcome.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 104 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Tuesday, January 13, 2015 10:20 PM
To: Gore, Tim
Cc: Daniel Vetter; Gordon, David S; [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 82 lines · Tim
Quoted 72 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, January 12, 2015 11:26 PM
To: Gore, Tim
Cc: Gordon, David S; [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 10 lines · Tim
Quoted 10 lines
-----Original Message-----
From: Gordon, David S
Sent: Monday, January 12, 2015 4:04 PM
To: Gore, Tim; [email protected]
Cc: Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params:
change flags used in invalid-flags testQuoted 8 lines
Quoted 8 lines · On 12/01/15 14:09, [email protected] wrote:
Quoted 7 lines
From: Tim Gore <[email protected]>
The invalid-flags test in
gem_exec_paramsuses (I915_EXEC_HANDLE_LUT<< 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use(
__I915_EXEC_UNKNOWN_FLAGS) instead.Quoted 26 lines
Quoted 26 lines
Quoted 17 lines
__I915_EXEC_UNKNOWN_FLAGSis defined ini915_drm.has a mask of all the undefined flags.Signed-off-by Tim Gore <[email protected]>--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_exec_params.c +0
-0index
f63eda9..2a1c544 100644tests/gem_exec_params.c +0
-0@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by
gem_exec_lut_handle*/Quoted 2 lines
igt_subtest("invalid-flag"){
- execbuf.flags =I915_EXEC_RENDER|(
I915_EXEC_HANDLE_LUT<< 1);Quoted 1 line
+ execbuf.flags =
I915_EXEC_RENDER|(
__I915_EXEC_UNKNOWN_FLAGS);Quoted 3 lines
RUN_FAIL(EINVAL); }Quoted 8 lines
Quoted 6 lines
Should we perhaps have a test that iterates over each bit in this mask one at a time (to check that EACH of them is correctly detected and
rejected) as well as this one with ALL the unknown flag bits set?.Dave.
Yes, I can do that if people like the idea.
Well the testcase should still fail if the kernel is accepting any flags - the idea is very much that every time you add a flag the test fails and will remind you to add the new testcases for the new flag. So any patch which makes LUT <<
1 no longer fail the tests if it's not rejected is nacked by me.Quoted 3 lines
Imo you should just carry an igt patch in the android version somewhere to adapt the testcase to your abi changes. -Daniel
No, the patch uses
__I915_EXEC_UNKNOWN_FLAGS, which is set ini915_drm.h, and hopefully Is maintained to be the set of all invalid flags. In the upstream version this is set to(quoted diff) +0
-2-(I915_EXEC_HANDLE_LUT<<1). In the android version it is set to -(I915_EXEC_ENABLE_WATCHDOG<<1)Quoted 2 lines
So Using this macro should give you the right test in each case, rather than having a special Android test case that is separately maintained
from the actual definition of the flags.
Yeah I mixed things up a bit. But my point is that hardcoding the invalid flags forces you to update the testcase since when you add a new flag it fails. With your patch it gets magically fixed with a recompile, which makes it a lot easier for people to forget writing the new testcases.
Quoted 6 lines
It has the downside that the tests are specific to a given kernel branch/release, but that's why we started tagging them roughly in lockstep with the otc qa release testing. Definitely not a perfect approach, so ideas highly welcome.
-Daniel
--
I appreciate that you want people to write test cases, but this only catches features that involve adding a new flag, for this ioctl. This is an important subset but cant really substitute for a more comprehensive mechanism. It is of course possible to carry an android / intel specific patch, but lots of people here work straight off the freedesktop repository to ensure they stay up to date. My preference would be for the version of igt in the android tree to diverge as little as possible.
Tim
Quoted 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 80 lines · Daniel Vetter
Quoted 79 lines · Tim
Quoted 65 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, January 12, 2015 11:26 PM
To: Gore, Tim
Cc: Gordon, David S; [email protected]; Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 10 lines · Tim
Quoted 10 lines
-----Original Message-----
From: Gordon, David S
Sent: Monday, January 12, 2015 4:04 PM
To: Gore, Tim; [email protected]
Cc: Wood, Thomas
Subject: Re: [Intel-gfx] [PATCH i-g-t] tests/gem_exec_params: change flags used in invalid-flags testQuoted 7 lines
Quoted 7 lines · On 12/01/15 14:09, [email protected] wrote:
Quoted 6 lines
From: Tim Gore <[email protected]>
The invalid-flags test in
gem_exec_paramsuses (I915_EXEC_HANDLE_LUT<< 1) as an invalid flag, but this is no longer invalid for recent android versions, and may not be invalid in Linux in the future. So I have changed this test to use(
__I915_EXEC_UNKNOWN_FLAGS) instead.Quoted 26 lines
Quoted 26 lines
Quoted 17 lines
__I915_EXEC_UNKNOWN_FLAGSis defined ini915_drm.has a mask of all the undefined flags.Signed-off-by Tim Gore <[email protected]>--- tests/gem_exec_params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/gem_exec_params.c +0
-0index
f63eda9..2a1c544 100644tests/gem_exec_params.c +0
-0@@ -179,7 +179,7 @@ igt_main/* HANDLE_LUT and NO_RELOC are already exercised by
gem_exec_lut_handle*/Quoted 2 lines
igt_subtest("invalid-flag"){
- execbuf.flags =I915_EXEC_RENDER|(
I915_EXEC_HANDLE_LUT<< 1);Quoted 1 line
+ execbuf.flags =
I915_EXEC_RENDER|(
__I915_EXEC_UNKNOWN_FLAGS);Quoted 3 lines
RUN_FAIL(EINVAL); }Quoted 8 lines
Quoted 6 lines
Should we perhaps have a test that iterates over each bit in this mask one at a time (to check that EACH of them is correctly detected and
rejected) as well as this one with ALL the unknown flag bits set?.Dave.
Yes, I can do that if people like the idea.
Quoted 8 lines
Well the testcase should still fail if the kernel is accepting any flags - the idea is very much that every time you add a flag the test fails and will remind you to add the new testcases for the new flag. So any patch which makes LUT << 1 no longer fail the tests if it's not rejected is nacked by me.
Imo you should just carry an igt patch in the android version somewhere to adapt the testcase to your abi changes.
-DanielNo, the patch uses
__I915_EXEC_UNKNOWN_FLAGS, which is set ini915_drm.h, and hopefully Is maintained to be the set of all invalid flags. In the upstream version this is set to(quoted diff) +0
-2-(I915_EXEC_HANDLE_LUT<<1). In the android version it is set to -(I915_EXEC_ENABLE_WATCHDOG<<1)
Quoted 7 lines
Quoted 2 lines
So Using this macro should give you the right test in each case, rather than having a special Android test case that is separately maintained from the actual definition of the flags.
Yeah I mixed things up a bit. But my point is that hardcoding the invalid flags forces you to update the testcase since when you add a new flag it fails. With your patch it gets magically fixed with a recompile, which makes it a lot easier for people to forget writing the new testcases.
Hardcoding the flag /doesn't/ necessarily detect that you've forgotten to update the testcases. For example, suppose you hardcoded it as bit 17, which is the lowest invalid bit in your kernel. I've added a new kernel feature which makes bit 17 a valid flag, but only on GEN7, on the BSD ring, and in a batch containing an odd number of DWords. Your test will find that bit 17 *is* still an invalid flag, unless it happens to use exactly the combination of options that make it valid.
*Proving* that setting a bit that should cause a request to be rejected /always/ does so is therefore a combinatorially infeasible problem.
.Dave.
Quoted 5 lines
It has the downside that the tests are specific to a given kernel branch/release, but that's why we started tagging them roughly in lockstep with the otc qa release testing. Definitely not a perfect approach, so ideas highly welcome.
-Daniel
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx