kms_addfb_basic: Require fb modifiers for unused field tests
PATCH 1/1 kms_addfb_basic: Require fb modifiers for unused field tests
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.
--- tests/kms_addfb_basic.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
tests/kms_addfb_basic.c +14 -5
@@ -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 ; }
Signature · 6 lines
2.4.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 gem_storedw_loop: Skip test if device doesn't have requested ring
The VEBOX ring is not available in generations before Haswell, so make tests that use it skip instead of fail in previous gens.
--- tests/gem_storedw_loop.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
tests/gem_storedw_loop.c +6 -2
@@ -166,11 +166,15 @@ igt_main }for (i =0 ; i <ARRAY_SIZE (rings); i++) { - igt_subtest_f("basic-%s", rings[i].name) + igt_subtest_f("basic-%s", rings[i].name) { +gem_require_ring (fd, rings[i].id);store_test (rings[i].id,16 *1024 ); + } - igt_subtest_f("long-%s", rings[i].name) + igt_subtest_f("long-%s", rings[i].name) { +gem_require_ring (fd, rings[i].id);store_test (rings[i].id,1024 *1024 ); + } }close (fd);
Signature · 6 lines
2.4.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 21 lines · Ander Conselvan de Oliveira
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 <[email protected]>--- tests/kms_addfb_basic.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)tests/kms_addfb_basic.c +1
-0@@ -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 );
tests/kms_addfb_basic.c static void invalid_tests(int fd) · line 64
Quoted 5 lines
tests/kms_addfb_basic.c +1
-1@@ -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 );
Missing igt_require_fb_modifiers()? Maybe this needs to be placed in a separate subtest to prevent unrelated tests failing or skipping?
Quoted 46 lines
tests/kms_addfb_basic.c +12
-5igt_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
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 24 lines · Thomas Wood
Quoted 22 lines · Ander Conselvan de Oliveira
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 <[email protected]>--- tests/kms_addfb_basic.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)tests/kms_addfb_basic.c +1
-0@@ -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)
Quoted 7 lines
tests/kms_addfb_basic.c static void invalid_tests(int fd) · line 64
Quoted 4 lines
tests/kms_addfb_basic.c +1
-1f.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 );Missing
igt_require_fb_modifiers()? Maybe this needs to be placed in a separate subtest to prevent unrelated tests failing or skipping?
Looks like I was too trigger-happy with my search and replace. That one doesn't need the LOCAL_ version. I'll re-spin and also update the commit message based on our IRC discussion.
Thanks,
Ander
Quoted 48 lines
Quoted 48 lines
tests/kms_addfb_basic.c +12
-5igt_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
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 kms_addfb_basic: Require fb modifiers for unused field tests
In reply to Thomas WoodThe drm core doesn't check unused fields of ADDFB2 for pre-FB_MODIFIERS userspace, so use igt_require_fb_modifiers(). Also, the size of the ioctl changed with the addition of the modifiers, so it is necessary to use the LOCAL_ version of it, otherwise some data may get truncated.
v2: Improve commit message. (Thomas)
Remove one spurious change to use LOCAL_DRM_IOCTL_ADDFB2. (Thomas)
--- tests/kms_addfb_basic.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
tests/kms_addfb_basic.c +14 -4
@@ -63,30 +63,40 @@ static void invalid_tests(int fd) f.fb_id =0 ; } + f.flags =LOCAL_DRM_MODE_FB_MODIFIERS ; + 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 ; }
Signature · 6 lines
2.4.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx