tests/kms_getfb: Test we reject CCS buffers
PATCH 1/1 tests/kms_getfb: Test we reject CCS buffers
The getfb ioctl only supports returning a single buffer handle (mirroring addfb), which means it should refuse to return us back CCS buffers.
This is enforced by the kernel as of b24791fe00f8.
--- tests/kms_getfb.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
tests/kms_getfb.c +45 -0
@@ -40,6 +40,38 @@#include "drm.h" #include "drm_fourcc.h" +static void get_ccs_fb (int fd,struct drm_mode_fb_cmd2 *ret) +{ +struct drm_mode_fb_cmd2 add = { + .width =1024 , + .height =1024 , + .pixel_format =DRM_FORMAT_XRGB8888 , + .flags =DRM_MODE_FB_MODIFIERS , + .modifier = { +I915_FORMAT_MOD_Y_TILED_CCS , +I915_FORMAT_MOD_Y_TILED_CCS , + }, + }; +int size; + +/* An explanation of the magic numbers can be found in kms_ccs.c. */ + add.pitches[0 ] =ALIGN (add.width *4 ,128 ); + add.offsets[1 ] = add.pitches[0 ] *ALIGN (add.height,32 ); + add.pitches[1 ] =ALIGN (ALIGN (add.width *4 ,32 ) /32 ,128 ); + + size = add.offsets[1 ]; + size += add.pitches[1 ] *ALIGN (ALIGN (add.height,16 ) /16 ,32 ); + + add.handles[0 ] =gem_create (fd, size); +igt_assert (add.handles[0 ]); + add.handles[1 ] = add.handles[0 ]; + +if (drmIoctl (fd,DRM_IOCTL_MODE_ADDFB2 , &add) ==0 ) + *ret = add; +else +gem_close (fd, add.handles[0 ]); +} +static void test_handle_input (int fd) {struct drm_mode_fb_cmd2 add = {};
@@ -135,6 +167,19 @@ static void test_duplicate_handles(int fd)gem_close (fd, get2.handle); } + igt_subtest("getfb-reject-ccs") { +struct drm_mode_fb_cmd2 add_ccs = { }; +struct drm_mode_fb_cmd get = { }; + +get_ccs_fb (fd, &add_ccs); +igt_require (add_ccs.handles[0 ] !=0 ); + get.fb_id = add_ccs.fb_id; +do_ioctl_err (fd,DRM_IOCTL_MODE_GETFB , &get,EINVAL ); + +do_ioctl (fd,DRM_IOCTL_MODE_RMFB , &add_ccs.fb_id); +gem_close (fd, add_ccs.handles[0 ]); + } + igt_fixture {do_ioctl (fd,DRM_IOCTL_MODE_RMFB , &add.fb_id);gem_close (fd, add.handles[0 ]);
Signature · 6 lines
2.16.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 7 lines · Daniel Stone
The getfb ioctl only supports returning a single buffer handle (mirroring addfb), which means it should refuse to return us back CCS buffers.
This is enforced by the kernel as of
b24791fe00f8.Signed-off-by Daniel Stone <[email protected]>
Quoted 74 lines
--- tests/kms_getfb.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)tests/kms_getfb.c +45
-0@@ -40,6 +40,38 @@#include "drm.h" #include "drm_fourcc.h" +static void get_ccs_fb (int fd,struct drm_mode_fb_cmd2 *ret) +{ +struct drm_mode_fb_cmd2 add = { + .width =1024 , + .height =1024 , + .pixel_format =DRM_FORMAT_XRGB8888 , + .flags =DRM_MODE_FB_MODIFIERS , + .modifier = { +I915_FORMAT_MOD_Y_TILED_CCS , +I915_FORMAT_MOD_Y_TILED_CCS , + }, + }; +int size; + +/* An explanation of the magic numbers can be found in kms_ccs.c. */ + add.pitches[0 ] =ALIGN (add.width *4 ,128 ); + add.offsets[1 ] = add.pitches[0 ] *ALIGN (add.height,32 ); + add.pitches[1 ] =ALIGN (ALIGN (add.width *4 ,32 ) /32 ,128 ); + + size = add.offsets[1 ]; + size += add.pitches[1 ] *ALIGN (ALIGN (add.height,16 ) /16 ,32 ); + + add.handles[0 ] =gem_create (fd, size); +igt_assert (add.handles[0 ]); + add.handles[1 ] = add.handles[0 ]; + +if (drmIoctl (fd,DRM_IOCTL_MODE_ADDFB2 , &add) ==0 ) + *ret = add; +else +gem_close (fd, add.handles[0 ]); +} +static void test_handle_input (int fd) {struct drm_mode_fb_cmd2 add = {};@@ -135,6 +167,19 @@ static void test_duplicate_handles(int fd)gem_close (fd, get2.handle); } + igt_subtest("getfb-reject-ccs") { +struct drm_mode_fb_cmd2 add_ccs = { }; +struct drm_mode_fb_cmd get = { }; + +get_ccs_fb (fd, &add_ccs); +igt_require (add_ccs.handles[0 ] !=0 ); + get.fb_id = add_ccs.fb_id; +do_ioctl_err (fd,DRM_IOCTL_MODE_GETFB , &get,EINVAL ); + +do_ioctl (fd,DRM_IOCTL_MODE_RMFB , &add_ccs.fb_id); +gem_close (fd, add_ccs.handles[0 ]); + } + igt_fixture {do_ioctl (fd,DRM_IOCTL_MODE_RMFB , &add.fb_id);gem_close (fd, add.handles[0 ]);Signature · 6 lines
2.16.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for tests/kms_getfb: Test we reject CCS buffers
In reply to Daniel Stone== Series Details ==
== Series Details ==
Series: tests/kms_getfb: Test we reject CCS buffers
URL : https://patchwork.freedesktop.org/series/40565/
State : success
== Summary ==
IGT patchset tested on top of latest successful build c2ee90774496a9772f17a7a359d7a670bf7d6b85 meson: Chamelium depends on GSL
with latest DRM-Tip kernel build CI_DRM_3976101f8aec6229 drm-tip: 2018y-03m-23d-17h-52m-01s UTC integration manifest
Testlist changes:
+igt@kms_getfb@getfb-reject-ccs
---- Known issues:
Test debugfs_test:
Subgroup read_all_entries:
incomplete -> PASS (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
pass -> FAIL (fi-gdg-551) fdo#102575
Test prime_vgem:
Subgroup basic-fence-flip:
fail -> PASS (fi-ilk-650) fdo#104008fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:432s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:441s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:381s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:543s fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:298s fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:514s fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:521s fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:509s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:416s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:512s fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:587s fi-elk-e7500 total:285 pass:225 dwarn:1 dfail:0 fail:0 skip:59 time:428s fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:317s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:538s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:403s fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:422s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:477s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:429s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:476s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:469s fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:515s fi-pnv-d510 total:285 pass:219 dwarn:1 dfail:0 fail:0 skip:65 time:659s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:444s fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:538s fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:508s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:501s fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:435s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:447s fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:596s fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:401s Blacklisted hosts: fi-cfl-s3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:567s fi-cnl-psr total:224 pass:197 dwarn:0 dfail:0 fail:2 skip:24 fi-glk-j4005 total:285 pass:255 dwarn:1 dfail:0 fail:0 skip:29 time:492s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1186/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for tests/kms_getfb: Test we reject CCS buffers
In reply to Daniel Stone== Series Details ==
== Series Details ==
Series: tests/kms_getfb: Test we reject CCS buffers
URL : https://patchwork.freedesktop.org/series/40565/
State : success
== Summary ==
---- Known issues:
Test kms_flip:
Subgroup 2x-plain-flip-ts-check-interruptible:
fail -> PASS (shard-hsw) fdo#100368 +3
Subgroup dpms-vs-vblank-race:
pass -> FAIL (shard-hsw) fdo#103060
Subgroup flip-vs-modeset-vs-hang-interruptible:
pass -> DMESG-WARN (shard-snb) fdo#104311
Test kms_rotation_crc:
Subgroup sprite-rotation-180:
pass -> FAIL (shard-snb) fdo#103925fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#104311 https://bugs.freedesktop.org/show_bug.cgi?id=104311
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
shard-apl total:3485 pass:1821 dwarn:1 dfail:0 fail:7 skip:1655 time:12864s shard-hsw total:3485 pass:1772 dwarn:1 dfail:0 fail:3 skip:1708 time:11674s shard-snb total:3485 pass:1361 dwarn:2 dfail:0 fail:4 skip:2118 time:7032s
Blacklisted hosts:
shard-kbl total:3472 pass:1935 dwarn:7 dfail:0 fail:9 skip:1520 time:9335s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1186/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev