[Intel-gfx] [PATCH i-g-t] kms_addfb_basic: Require fb modifiers for unused field tests

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Thu Aug 20 07:43:30 PDT 2015


The drm core doesn't check unused fields of ADDFB2 for pre-FB_MODIFIERS
userspace, so require that and use the local version of the defines.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
---
 tests/kms_addfb_basic.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c
index f10e12b..732d6dc 100644
--- a/tests/kms_addfb_basic.c
+++ b/tests/kms_addfb_basic.c
@@ -51,6 +51,7 @@ static void invalid_tests(int fd)
 	f.height = 512;
 	f.pixel_format = DRM_FORMAT_XRGB8888;
 	f.pitches[0] = 512*4;
+	f.flags = LOCAL_DRM_MODE_FB_MODIFIERS;
 
 	igt_fixture {
 		gem_bo = gem_create(fd, 1024*1024*4);
@@ -60,35 +61,43 @@ static void invalid_tests(int fd)
 
 		f.handles[0] = gem_bo;
 
-		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0);
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0);
 		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0);
 		f.fb_id = 0;
 	}
 
 	igt_subtest("unused-handle") {
+		igt_require_fb_modifiers(fd);
+
 		f.handles[1] = gem_bo_small;
-		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
 			   errno == EINVAL);
 		f.handles[1] = 0;
 	}
 
 	igt_subtest("unused-pitches") {
+		igt_require_fb_modifiers(fd);
+
 		f.pitches[1] = 512;
-		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
 			   errno == EINVAL);
 		f.pitches[1] = 0;
 	}
 
 	igt_subtest("unused-offsets") {
+		igt_require_fb_modifiers(fd);
+
 		f.offsets[1] = 512;
-		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
 			   errno == EINVAL);
 		f.offsets[1] = 0;
 	}
 
 	igt_subtest("unused-modifier") {
+		igt_require_fb_modifiers(fd);
+
 		f.modifier[1] =  LOCAL_I915_FORMAT_MOD_X_TILED;
-		igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
+		igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == -1 &&
 			   errno == EINVAL);
 		f.modifier[1] = 0;
 	}
-- 
2.4.3



More information about the Intel-gfx mailing list