Skip to contentSkip to conversation

tests/prime_mmap: Encapsulate check_for_dma_buf_mmap() in igt_fixture.

PATCH In review Marius Vlad 3 participants 4 messages Feb 12, 2016 – Feb 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/prime_mmap: Encapsulate check_for_dma_buf_mmap() in igt_fixture.

This unbreaks distcheck target that in turn runs each test with --list-subtests.

---
 tests/prime_mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/prime_mmap.c +1 -1
index 29a0cfd..1ea61c2 100644
@@ -504,10 +504,10 @@ igt_main
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
+		igt_skip_on((check_for_dma_buf_mmap() != 0));
 		errno = 0;
 	}
 
-	igt_skip_on((check_for_dma_buf_mmap() != 0));
 
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
 		igt_subtest(tests[i].name)
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

I'm not sure this actually fix the root problem. With or without your patch applied, I'm seeing the following in lib/tests/test-suite.log:

../../tests/prime_mmap:
Checking invalid option handling...
Checking valid option handling...
Checking subtest enumeration...
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Test assertion failure function gem_create, file ../../lib/ioctl_wrappers.c:501:
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0 (prime_mmap:24023) ioctl-wrappers-CRITICAL: Last errno: 25, Inappropriate ioctl for device
(prime_mmap:24023) ioctl-wrappers-CRITICAL: error: -1 != 0
Test prime_mmap failed.
**** DEBUG ****
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Test assertion failure function gem_create, file ../../lib/ioctl_wrappers.c:501:
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0 (prime_mmap:24023) ioctl-wrappers-CRITICAL: Last errno: 25, Inappropriate ioctl for device
(prime_mmap:24023) ioctl-wrappers-CRITICAL: error: -1 != 0
**** END ****
prime_mmap: ../../lib/igt_core.c:1014: igt_fail: Assertion `!test_with_subtests || in_fixture' failed.
Received signal SIGABRT.
Aborted (core dumped)

Tiago

Quoted 14 lines · Marius Vlad

This unbreaks distcheck target that in turn runs each test with --list-subtests.

---
  tests/prime_mmap.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/prime_mmap.c +0 -0
index 29a0cfd..1ea61c2 100644
@@ -504,10 +504,10 @@ igt_main
 

tests/prime_mmap.c igt_main · line 513

Quoted 10 lines
tests/prime_mmap.c +1 -1
  	igt_fixture {
  		fd = drm_open_driver(DRIVER_INTEL);
+		igt_skip_on((check_for_dma_buf_mmap() != 0));
  		errno = 0;
  	}
 
-	igt_skip_on((check_for_dma_buf_mmap() != 0));
 
  	for (i = 0; i < ARRAY_SIZE(tests); i++) {
  		igt_subtest(tests[i].name)

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

#2 lore raw

Hi,

I'm positive it does. Are you sure you've re-compiled? (check or distcheck targets do not re-compile the tests).

Quoted 55 lines · Tiago Vignatti

I'm not sure this actually fix the root problem. With or without your patch applied, I'm seeing the following in lib/tests/test-suite.log:

../../tests/prime_mmap:
Checking invalid option handling...
Checking valid option handling...
Checking subtest enumeration...
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Test assertion failure function gem_create, file ../../lib/ioctl_wrappers.c:501:
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0 (prime_mmap:24023) ioctl-wrappers-CRITICAL: Last errno: 25, Inappropriate ioctl for device
(prime_mmap:24023) ioctl-wrappers-CRITICAL: error: -1 != 0
Test prime_mmap failed.
**** DEBUG ****
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Test assertion failure function gem_create, file ../../lib/ioctl_wrappers.c:501:
(prime_mmap:24023) ioctl-wrappers-CRITICAL: Failed assertion: drmIoctl((fd), ((((2U|1U) << (((0+8)+8)+14)) | ((('d')) << (0+8)) | (((0x40 + 0x1b)) << 0) | ((((sizeof(struct drm_i915_gem_create)))) << ((0+8)+8)))), (&create)) == 0 (prime_mmap:24023) ioctl-wrappers-CRITICAL: Last errno: 25, Inappropriate ioctl for device
(prime_mmap:24023) ioctl-wrappers-CRITICAL: error: -1 != 0
**** END ****
prime_mmap: ../../lib/igt_core.c:1014: igt_fail: Assertion `!test_with_subtests || in_fixture' failed.
Received signal SIGABRT.
Aborted (core dumped)

Tiago

Quoted 21 lines · Marius Vlad

This unbreaks distcheck target that in turn runs each test with --list-subtests.

---
 tests/prime_mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/prime_mmap.c +1 -1
index 29a0cfd..1ea61c2 100644
@@ -504,10 +504,10 @@ igt_main
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
+		igt_skip_on((check_for_dma_buf_mmap() != 0));
 		errno = 0;
 	}
 
-	igt_skip_on((check_for_dma_buf_mmap() != 0));
 
Quoted 8 lines

tests/prime_mmap.c igt_main · line 513

Quoted 3 lines
tests/prime_mmap.c +0 -0
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
 		igt_subtest(tests[i].name)

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

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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Marius Vlad
Quoted 12 lines · Marius Vlad

This unbreaks distcheck target that in turn runs each test with --list-subtests.

---
 tests/prime_mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/prime_mmap.c +0 -0
index 29a0cfd..1ea61c2 100644

tests/prime_mmap.c igt_main · line 510

Quoted 8 lines
tests/prime_mmap.c +1 -1
@@ -504,10 +504,10 @@ igt_main
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
+		igt_skip_on((check_for_dma_buf_mmap() != 0));
 		errno = 0;
 	}
 
-	igt_skip_on((check_for_dma_buf_mmap() != 0));

Definitely need to put anythign that looks at the hw/driver into igt_fixture.

Quoted 10 lines
tests/prime_mmap.c +0 -0
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
 		igt_subtest(tests[i].name)
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx