tests/kms_ccs: Move fbs out from data
PATCH 1/2 tests/kms_ccs: Move fbs out from data
From: Ville Syrjälä <[email protected]>
There's no need to house fb and fb_sprite in the data_t. Just suck them into try_config(). Much cleaner since we no longer have to match the fb setup done in try_config() in test_output(). Also I think doing multiple try_config()s (like done by TEST_CRC) would leak one of the primary fbs.
--- tests/kms_ccs.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-)
tests/kms_ccs.c +14 -18
@@ -53,8 +53,6 @@ enum test_fb_flags { typedef struct { int drm_fd; igt_display_t display; - struct igt_fb fb; - struct igt_fb fb_sprite; igt_output_t *output; enum pipe pipe; enum test_flags flags;
@@ -394,6 +392,7 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,igt_plane_t *primary;drmModeModeInfo *drm_mode =igt_output_get_mode (data->output);enum igt_commit_style commit; +struct igt_fb fb, fb_sprite;int ret;if (data->display.is_atomic)
@@ -407,12 +406,12 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,if (data->plane && fb_flags &FB_COMPRESSED ) {plane_require_ccs (data, data->plane,DRM_FORMAT_XRGB8888 ); -generate_fb (data, &data->fb, drm_mode->hdisplay, +generate_fb (data, &fb, drm_mode->hdisplay, drm_mode->vdisplay, (fb_flags & ~FB_COMPRESSED ) |FB_HAS_PLANE ); -generate_fb (data, &data->fb_sprite,256 ,256 , fb_flags); +generate_fb (data, &fb_sprite,256 ,256 , fb_flags); }else { -generate_fb (data, &data->fb, drm_mode->hdisplay, +generate_fb (data, &fb, drm_mode->hdisplay, drm_mode->vdisplay, fb_flags); }
@@ -421,12 +420,12 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,igt_plane_set_position (primary,0 ,0 );igt_plane_set_size (primary, drm_mode->hdisplay, drm_mode->vdisplay); -igt_plane_set_fb (primary, &data->fb); +igt_plane_set_fb (primary, &fb);if (data->plane && fb_flags &FB_COMPRESSED ) {igt_plane_set_position (data->plane,0 ,0 );igt_plane_set_size (data->plane,256 ,256 ); -igt_plane_set_fb (data->plane, &data->fb_sprite); +igt_plane_set_fb (data->plane, &fb_sprite); }if (data->flags &TEST_ROTATE_180 )
@@ -450,14 +449,20 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,igt_plane_set_position (data->plane,0 ,0 );igt_plane_set_size (data->plane,0 ,0 );igt_plane_set_fb (data->plane,NULL ); -igt_remove_fb (display->drm_fd, &data->fb_sprite); +igt_remove_fb (display->drm_fd, &fb_sprite); } + +igt_plane_set_fb (primary,NULL ); +igt_plane_set_rotation (primary,IGT_ROTATION_0 ); +igt_display_commit2 (display, commit); + +if (data->flags &TEST_CRC ) +igt_remove_fb (data->drm_fd, &fb); }static void test_output (data_t *data) {igt_display_t *display = &data->display; -igt_plane_t *primary;igt_crc_t crc, ref_crc;enum test_fb_flags fb_flags =0 ;
@@ -495,17 +500,8 @@ static void test_output(data_t *data)try_config (data, fb_flags |FB_COMPRESSED |FB_ZERO_AUX_STRIDE ,NULL ); } - primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY ); -igt_plane_set_fb (primary,NULL ); -igt_plane_set_rotation (primary,IGT_ROTATION_0 ); -if (!display->is_atomic) -igt_display_commit2 (display,COMMIT_UNIVERSAL ); -igt_output_set_pipe (data->output,PIPE_ANY );igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); - -if (data->flags &TEST_CRC ) -igt_remove_fb (data->drm_fd, &data->fb); }static data_t data;
Signature · 6 lines
2.13.6 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 2/2 tests/kms_ccs: Don't skip the entire subtest if one plane can't do CCS
From: Ville Syrjälä <[email protected]>
Make sure we test every plane on the pipe, and only report a SKIP if none of the planes support CCS (or the pixel format).
Cc: Gabriel Krisman Bertazi <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104724
--- tests/kms_ccs.c | 67 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 30 deletions(-)
tests/kms_ccs.c +37 -30
@@ -130,7 +130,7 @@ modifiers_ptr(struct local_drm_format_modifier_blob *blob)return (struct local_drm_format_modifier *)(((char *)blob) + blob->modifiers_offset); } -static void plane_require_ccs (data_t *data,igt_plane_t *plane,uint32_t format) +static bool plane_has_format_with_ccs (data_t *data,igt_plane_t *plane,uint32_t format) {drmModePropertyBlobPtr blob;struct local_drm_format_modifier_blob *blob_data;
@@ -161,8 +161,8 @@ static void plane_require_ccs(data_t *data, igt_plane_t *plane, uint32_t format) } } -igt_skip_on_f (fmt_idx ==-1 , -"Format 0x%x not supported by plane\n" , format); +if (fmt_idx ==-1 ) +return false; modifiers =modifiers_ptr (blob_data); last_mod = &modifiers[blob_data->count_modifiers];
@@ -177,12 +177,10 @@ static void plane_require_ccs(data_t *data, igt_plane_t *plane, uint32_t format)if (modifiers[i].formats & (1UL << (fmt_idx - modifiers[i].offset))) -return ; - -igt_skip ("i915 CCS modifier not supported for format\n" ); +return true; } -igt_skip ("i915 CCS modifier not supported by kernel for plane\n" ); +return false; } static void render_fb(data_t *data, uint32_t gem_handle, unsigned int size,
@@ -385,7 +383,7 @@ static void generate_fb(data_t *data, struct igt_fb *fb, fb->domain =0 ; } -static void try_config (data_t *data,enum test_fb_flags fb_flags, +static bool try_config (data_t *data,enum test_fb_flags fb_flags,igt_crc_t *crc) {igt_display_t *display = &data->display;
@@ -402,10 +400,12 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags, primary =igt_output_get_plane_type (data->output,DRM_PLANE_TYPE_PRIMARY ); -plane_require_ccs (data, primary,DRM_FORMAT_XRGB8888 ); +if (!plane_has_format_with_ccs (data, primary,DRM_FORMAT_XRGB8888 )) +return false;if (data->plane && fb_flags &FB_COMPRESSED ) { -plane_require_ccs (data, data->plane,DRM_FORMAT_XRGB8888 ); +if (!plane_has_format_with_ccs (data, data->plane,DRM_FORMAT_XRGB8888 )) +return false;generate_fb (data, &fb, drm_mode->hdisplay, drm_mode->vdisplay, (fb_flags & ~FB_COMPRESSED ) |FB_HAS_PLANE );
@@ -416,7 +416,7 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags, }if (data->flags &TEST_FAIL_ON_ADDFB2 ) -return ; +return true;igt_plane_set_position (primary,0 ,0 );igt_plane_set_size (primary, drm_mode->hdisplay, drm_mode->vdisplay);
@@ -458,13 +458,16 @@ static void try_config(data_t *data, enum test_fb_flags fb_flags,if (data->flags &TEST_CRC )igt_remove_fb (data->drm_fd, &fb); + +return true; } -static void test_output (data_t *data) +static int test_output (data_t *data) {igt_display_t *display = &data->display;igt_crc_t crc, ref_crc;enum test_fb_flags fb_flags =0 ; +int valid_tests =0 ;igt_display_require_output_on_pipe (display, data->pipe);
@@ -478,10 +481,11 @@ static void test_output(data_t *data)if (data->flags &TEST_CRC ) { data->pipe_crc =igt_pipe_crc_new (data->drm_fd, data->pipe,INTEL_PIPE_CRC_SOURCE_AUTO ); -try_config (data, fb_flags |FB_COMPRESSED , &ref_crc); -try_config (data, fb_flags, &crc); - -igt_assert_crc_equal (&crc, &ref_crc); +if (try_config (data, fb_flags |FB_COMPRESSED , &ref_crc) && +try_config (data, fb_flags, &crc)) { +igt_assert_crc_equal (&crc, &ref_crc); + valid_tests++; + }igt_pipe_crc_free (data->pipe_crc); data->pipe_crc =NULL ;
@@ -491,17 +495,19 @@ static void test_output(data_t *data) data->flags & TEST_BAD_ROTATION_90 || data->flags & TEST_NO_AUX_BUFFER || data->flags & TEST_BAD_CCS_HANDLE) { -try_config (data, fb_flags |FB_COMPRESSED ,NULL ); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED ,NULL ); }if (data->flags &TEST_BAD_AUX_STRIDE ) { -try_config (data, fb_flags |FB_COMPRESSED |FB_MISALIGN_AUX_STRIDE ,NULL ); -try_config (data, fb_flags |FB_COMPRESSED |FB_SMALL_AUX_STRIDE ,NULL ); -try_config (data, fb_flags |FB_COMPRESSED |FB_ZERO_AUX_STRIDE ,NULL ); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED |FB_MISALIGN_AUX_STRIDE ,NULL ); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED |FB_SMALL_AUX_STRIDE ,NULL ); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED |FB_ZERO_AUX_STRIDE ,NULL ); }igt_output_set_pipe (data->output,PIPE_ANY );igt_display_commit2 (display, display->is_atomic ?COMMIT_ATOMIC :COMMIT_LEGACY ); + +return valid_tests; }static data_t data;
@@ -522,52 +528,53 @@ igt_mainfor_each_pipe_static (pipe) {const char *pipe_name =kmstest_pipe_name (pipe); -int sprite_idx =0 ; data.pipe = pipe; data.flags =TEST_BAD_PIXEL_FORMAT ; igt_subtest_f("pipe-%s-bad-pixel-format", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_ROTATION_90 ; igt_subtest_f("pipe-%s-bad-rotation-90", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC ; igt_subtest_f("pipe-%s-crc-primary-basic", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC |TEST_ROTATE_180 ; igt_subtest_f("pipe-%s-crc-primary-rotation-180", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC ; igt_subtest_f("pipe-%s-crc-sprite-planes-basic", pipe_name) { +int valid_tests =0 ;igt_display_require_output_on_pipe (&data.display, data.pipe);for_each_plane_on_pipe (&data.display, data.pipe, data.plane) {if (data.plane->type ==DRM_PLANE_TYPE_PRIMARY )continue ; - sprite_idx++; -test_output (&data); + valid_tests +=test_output (&data); } + +igt_require (valid_tests); } data.plane =NULL ; data.flags =TEST_NO_AUX_BUFFER ; igt_subtest_f("pipe-%s-missing-ccs-buffer", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_CCS_HANDLE ; igt_subtest_f("pipe-%s-ccs-on-another-bo", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_AUX_STRIDE ; igt_subtest_f("pipe-%s-bad-aux-stride", pipe_name) -test_output (&data); +igt_require (test_output (&data)); } igt_fixture
Signature · 6 lines
2.13.6 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_ccs: Move fbs out from data
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,1/2] tests/kms_ccs: Move fbs out from data
URL : https://patchwork.freedesktop.org/series/37207/
State : success
== Summary ==
IGT patchset tested on top of latest successful build 5d63473d5264d3384fc9ec8a328d5046a6bf868c tests/gem_reset_stats: Fix retrieval of hangcheck stats expectation
with latest DRM-Tip kernel build CI_DRM_368659275f1cec1d drm-tip: 2018y-01m-26d-13h-05m-14s UTC integration manifest
No testlist changes.
Test debugfs_test:
Subgroup read_all_entries:
dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:425s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:428s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:371s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:490s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:282s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:484s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:487s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:473s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:458s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:571s fi-cnl-y2 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:532s fi-elk-e7500 total:224 pass:168 dwarn:10 dfail:0 fail:0 skip:45 fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:280s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:514s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:393s fi-hsw-4770r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:404s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:414s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:464s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:412s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:468s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:499s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:454s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:504s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:578s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:430s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:514s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:528s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:488s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:482s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:421s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:432s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:519s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:402s
Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:468s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_829/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] tests/kms_ccs: Move fbs out from data
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,1/2] tests/kms_ccs: Move fbs out from data
URL : https://patchwork.freedesktop.org/series/37207/
State : failure
== Summary ==
Warning: bzip CI_DRM_3686/shard-glkb6/results14.json.bz2 wasn't in correct JSON format Test kms_frontbuffer_tracking:
Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
fail -> PASS (shard-snb) fdo#101623 +1
Test gem_mmap_wc:
Subgroup set-cache-level:
pass -> SKIP (shard-snb)
Test perf_pmu:
Subgroup semaphore-wait-vcs0:
pass -> FAIL (shard-apl)
Test kms_ccs:
Subgroup pipe-a-crc-sprite-planes-basic:
skip -> PASS (shard-apl) fdo#104724 +1
Test perf:
Subgroup oa-exponents:
pass -> FAIL (shard-apl) fdo#102254
Subgroup enable-disable:
fail -> PASS (shard-apl) fdo#103715
Subgroup blocking:
pass -> FAIL (shard-hsw) fdo#102252
Test kms_mmap_write_crc:
skip -> PASS (shard-apl)
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
shard-apl total:2838 pass:1753 dwarn:1 dfail:0 fail:22 skip:1062 time:12695s shard-hsw total:2838 pass:1735 dwarn:1 dfail:0 fail:11 skip:1090 time:11871s shard-snb total:2838 pass:1328 dwarn:1 dfail:0 fail:11 skip:1498 time:6618s
Blacklisted hosts:
shard-kbl total:2801 pass:1852 dwarn:7 dfail:0 fail:22 skip:919 time:9332s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_829/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 2/2] tests/kms_ccs: Don't skip the entire subtest if one plane can't do CCS
In reply to Ville SyrjalaSorry Ville I didn't realize that you had a new patch on this bug.
Quoted 265 lines
-----Original Message-----
From: igt-dev [mailto:[email protected]] On Behalf Of Ville Syrjala
Sent: Friday, January 26, 2018 9:51 PM
To: [email protected]
Cc: Gabriel Krisman Bertazi <[email protected]>
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/kms_ccs: Don't skip the entire subtest if one plane can't do CCSFrom: Ville Syrjälä <[email protected]>
Make sure we test every plane on the pipe, and only report a SKIP if none of the planes support CCS (or the pixel format).
Cc: Gabriel Krisman Bertazi <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104724Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_ccs.c | 67 +++++++++++++++++++++++++++++++------------------ -------- 1 file changed, 37 insertions(+), 30 deletions(-)tests/kms_ccs.c index renamed from tests/kms_ccs.c +0
-0
b142d3e5a7cb..63298f137abb100644tests/kms_ccs.c +2
-1@@ -130,7 +130,7 @@ modifiers_ptr(struct local_drm_format_modifier_blob *blob)return (struct local_drm_format_modifier *)(((char *)blob) + blob->modifiers_offset); } -static void plane_require_ccs (data_t *data,igt_plane_t *plane,uint32_t format) +static bool plane_has_format_with_ccs(data_t *data, igt_plane_t *plane, +uint32_t format) {drmModePropertyBlobPtr blob; struct local_drm_format_modifier_blob *blob_data; @@ -161,8 +161,8 @@ static void
plane_require_ccs(data_t *data, igt_plane_t *plane, uint32_t format)tests/kms_ccs.c +0
-2} } - igt_skip_on_f(fmt_idx == -1, - "Format 0x%x not supported by plane\n",format);
tests/kms_ccs.c +4
-4+if (fmt_idx ==-1 ) +return false; modifiers =modifiers_ptr (blob_data); last_mod = &modifiers[blob_data->count_modifiers];@@ -177,12 +177,10 @@ static void plane_require_ccs(data_t *data, igt_plane_t *plane, uint32_t format) if (modifiers[i].formats & (1UL << (fmt_idx - modifiers[i].offset))) - return; - -igt_skip ("i915 CCS modifier not supported for format\n"); + return true; } -igt_skip ("i915 CCS modifier not supported by kernel for plane\n"); +return false;}
static void render_fb(data_t *data,
uint32_tgem_handle, unsigned int size,tests/kms_ccs.c +1
-1@@ -385,7 +383,7 @@ static void generate_fb(data_t *data, struct igt_fb *fb, fb->domain =0 ; } -static void try_config (data_t *data,enum test_fb_flags fb_flags, +static bool try_config (data_t *data,enum test_fb_flags fb_flags,igt_crc_t *crc) {
igt_display_t*display =&data->display; @@ -402,10 +400,12
@@ static void try_config(data_t *data, enumtest_fb_flagsfb_flags,primary = igt_output_get_plane_type(data->output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_ccs.c +1
-1-plane_require_ccs (data, primary,DRM_FORMAT_XRGB8888 ); + if (!plane_has_format_with_ccs(data, primary,
DRM_FORMAT_XRGB8888))tests/kms_ccs.c +1
-1+return false;if (data->plane && fb_flags &FB_COMPRESSED ) { - plane_require_ccs(data, data->plane,
DRM_FORMAT_XRGB8888);tests/kms_ccs.c +1
-0+ if (!plane_has_format_with_ccs(data, data-Quoted 1 line
plane,
DRM_FORMAT_XRGB8888))tests/kms_ccs.c +1
-0+return false;generate_fb (data, &fb, drm_mode->hdisplay, drm_mode->vdisplay, (fb_flags & ~FB_COMPRESSED)|
FB_HAS_PLANE); @@ -416,7 +416,7 @@ static void try_config(data_t *data, enumtest_fb_flagsfb_flags,tests/kms_ccs.c +1
-1}if (data->flags &TEST_FAIL_ON_ADDFB2 ) -return ; +return true;igt_plane_set_position (primary,0 ,0 ); igt_plane_set_size(primary, drm_mode->hdisplay,
drm_mode->vdisplay); @@ -458,13 +458,16 @@ static void try_config(data_t *data, enumtest_fb_flagsfb_flags,tests/kms_ccs.c +5
-5if (data->flags &TEST_CRC )igt_remove_fb (data->drm_fd, &fb); + +return true; } -static void test_output (data_t *data) +static int test_output (data_t *data) {igt_display_t *display = &data->display;igt_crc_t crc, ref_crc;enum test_fb_flags fb_flags =0 ; +int valid_tests =0 ;igt_display_require_output_on_pipe (display, data->pipe);@@ -478,10 +481,11 @@ static void test_output(data_t *data)if (data->flags &TEST_CRC ) { data->pipe_crc =igt_pipe_crc_new (data- >drm_fd, data->pipe, INTEL_PIPE_CRC_SOURCE_AUTO); -try_config (data, fb_flags |FB_COMPRESSED , &ref_crc); -try_config (data, fb_flags, &crc); - -igt_assert_crc_equal (&crc, &ref_crc); + if (try_config(data, fb_flags | FB_COMPRESSED,
&ref_crc) &&tests/kms_ccs.c +2
-0+ try_config(data, fb_flags, &crc)) { + igt_assert_crc_equal(&crc,
&ref_crc);tests/kms_ccs.c +6
-4+ valid_tests++; + }igt_pipe_crc_free (data->pipe_crc); data->pipe_crc =NULL ;@@ -491,17 +495,19 @@ static void test_output(data_t *data) data->flags & TEST_BAD_ROTATION_90 || data->flags & TEST_NO_AUX_BUFFER || data->flags & TEST_BAD_CCS_HANDLE) { -try_config (data, fb_flags |FB_COMPRESSED , NULL); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED ,NULL ); }if (data->flags &TEST_BAD_AUX_STRIDE ) { -try_config (data, fb_flags |FB_COMPRESSED | FB_MISALIGN_AUX_STRIDE , NULL); -try_config (data, fb_flags |FB_COMPRESSED | FB_SMALL_AUX_STRIDE , NULL); -try_config (data, fb_flags |FB_COMPRESSED | FB_ZERO_AUX_STRIDE , NULL); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED |FB_MISALIGN_AUX_STRIDE ,NULL ); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED |FB_SMALL_AUX_STRIDE ,NULL ); + valid_tests += try_config(data, fb_flags |
FB_COMPRESSED|tests/kms_ccs.c +1
-0+FB_ZERO_AUX_STRIDE , NULL); }igt_output_set_pipe (data->output,PIPE_ANY ); igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_LEGACY);tests/kms_ccs.c +10
-7+ +return valid_tests; }static data_t data;@@ -522,52 +528,53 @@ igt_mainfor_each_pipe_static (pipe) {const char *pipe_name =kmstest_pipe_name (pipe); -int sprite_idx =0 ; data.pipe = pipe; data.flags =TEST_BAD_PIXEL_FORMAT ;igt_subtest_f ("pipe-%s-bad-pixel-format" , pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_ROTATION_90 ;igt_subtest_f ("pipe-%s-bad-rotation-90" , pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC ;igt_subtest_f ("pipe-%s-crc-primary-basic" , pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC |TEST_ROTATE_180 ;igt_subtest_f ("pipe-%s-crc-primary-rotation- 180", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC ;igt_subtest_f ("pipe-%s-crc-sprite-planes-basic" , pipe_name) { +int valid_tests =0 ;igt_display_require_output_on_pipe (&data.display, data.pipe);for_each_plane_on_pipe (&data.display, data.pipe, data.plane) {if (data.plane->type ==DRM_PLANE_TYPE_PRIMARY )continue ; - sprite_idx++; -test_output (&data); + valid_tests +=test_output (&data); } + +igt_require (valid_tests); } data.plane =NULL ;tests/kms_ccs.c +0
-0data.flags =TEST_NO_AUX_BUFFER ; igt_subtest_f("pipe-%s-missing-ccs-buffer",
pipe_name)tests/kms_ccs.c +1
-1-test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_CCS_HANDLE ; igt_subtest_f("pipe-%s-ccs-on-another-bo",
pipe_name)tests/kms_ccs.c +1
-1-test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_AUX_STRIDE ; igt_subtest_f("pipe-%s-bad-aux-stride",
pipe_name)tests/kms_ccs.c +1
-2-test_output (&data); +igt_require (test_output (&data)); } igt_fixture --2.13.6
Quoted 4 lines
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 135 lines
-----Original Message-----
From: igt-dev [mailto:[email protected]] On Behalf Of Ville Syrjala
Sent: Friday, January 26, 2018 9:51 PM
To: [email protected]
Cc: Gabriel Krisman Bertazi <[email protected]>
Subject: [igt-dev] [PATCH i-g-t 1/2] tests/kms_ccs: Move fbs out from dataFrom: Ville Syrjälä <[email protected]>
There's no need to house fb and
fb_spritein thedata_t. Just suck them intotry_config(). Much cleaner since we no longer have to match the fb setup done intry_config()intest_output(). Also I think doing multiple try_config()s (like done byTEST_CRC) would leak one of the primary fbs.Cc Gabriel Krisman Bertazi <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_ccs.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-)tests/kms_ccs.c index renamed from tests/kms_ccs.c +0
-0
ebf4212e770e..b142d3e5a7cb100644tests/kms_ccs.c +1
-2@@ -53,8 +53,6 @@ enum test_fb_flags { typedef struct { int drm_fd; igt_display_t display; - struct igt_fb fb; - struct igt_fb fb_sprite; igt_output_t *output; enum pipe pipe; enum test_flags flags;@@ -394,6 +392,7 @@ static void try_config(data_t *data, enumtest_fb_flags fb_flags, igt_plane_t *primary;drmModeModeInfo *drm_mode =igt_output_get_mode (data->output);enum igt_commit_style commit; +struct igt_fb fb, fb_sprite;int ret;tests/kms_ccs.c +2
-2if (data->display.is_atomic)@@ -407,12 +406,12 @@ static void try_config(data_t *data, enumtest_fb_flags fb_flags, if (data->plane && fb_flags & FB_COMPRESSED) { plane_require_ccs(data, data->plane,DRM_FORMAT_XRGB8888 ); -generate_fb (data, &data->fb, drm_mode- >hdisplay, +generate_fb (data, &fb, drm_mode->hdisplay, drm_mode->vdisplay, (fb_flags & ~FB_COMPRESSED ) |FB_HAS_PLANE ); -generate_fb (data, &data->fb_sprite,256 ,256 , fb_flags); + generate_fb(data, &fb_sprite, 256, 256,
fb_flags);tests/kms_ccs.c +0
-1}else { - generate_fb(data, &data->fb, drm_mode-Quoted 1 line
hdisplay,
tests/kms_ccs.c +3
-2+generate_fb (data, &fb, drm_mode->hdisplay, drm_mode->vdisplay, fb_flags); }@@ -421,12 +420,12 @@ static void try_config(data_t *data, enumtest_fb_flags fb_flags, igt_plane_set_position(primary, 0, 0);igt_plane_set_size (primary, drm_mode->hdisplay, drm_mode->vdisplay); -igt_plane_set_fb (primary, &data->fb); +igt_plane_set_fb (primary, &fb);if (data->plane && fb_flags &FB_COMPRESSED ) {igt_plane_set_position (data->plane,0 ,0 );igt_plane_set_size (data->plane,256 ,256 ); -igt_plane_set_fb (data->plane, &data- >fb_sprite); +igt_plane_set_fb (data->plane, &fb_sprite);tests/kms_ccs.c +8
-2}if (data->flags &TEST_ROTATE_180 )@@ -450,14 +449,20 @@ static void try_config(data_t *data, enumtest_fb_flags fb_flags, igt_plane_set_position(data->plane, 0, 0);igt_plane_set_size (data->plane,0 ,0 );igt_plane_set_fb (data->plane,NULL ); -igt_remove_fb (display->drm_fd, &data- >fb_sprite); +igt_remove_fb (display->drm_fd, &fb_sprite); } + +igt_plane_set_fb (primary,NULL ); +igt_plane_set_rotation (primary,IGT_ROTATION_0 ); +igt_display_commit2 (display, commit); + +if (data->flags &TEST_CRC ) +igt_remove_fb (data->drm_fd, &fb); }static void test_output (data_t *data) {igt_display_t *display = &data->display; -igt_plane_t *primary;igt_crc_t crc, ref_crc;tests/kms_ccs.c +0
-6enum test_fb_flags fb_flags =0 ;@@ -495,17 +500,8 @@ static void test_output(data_t *data)try_config (data, fb_flags |FB_COMPRESSED |FB_ZERO_AUX_STRIDE ,NULL ); } - primary =igt_output_get_plane_type (data->output, DRM_PLANE_TYPE_PRIMARY); -igt_plane_set_fb (primary,NULL ); -igt_plane_set_rotation (primary,IGT_ROTATION_0 ); -if (!display->is_atomic) -igt_display_commit2 (display, COMMIT_UNIVERSAL); -igt_output_set_pipe (data->output,PIPE_ANY ); igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_LEGACY);tests/kms_ccs.c +0
-4- -if (data->flags &TEST_CRC ) -igt_remove_fb (data->drm_fd, &data->fb); }static data_t data; --2.13.6
Quoted 4 lines
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 2/2] tests/kms_ccs: Don't skip the entire subtest if one plane can't do CCS
In reply to Lofstedt, MartaQuoted 3 lines · Marta
Sorry Ville I didn't realize that you had a new patch on this bug.
Reviewed-by Marta Lofstedt<[email protected]>
Thanks. Series pushed to master.
Quoted 270 lines
Quoted 270 lines
-----Original Message-----
From: igt-dev [mailto:[email protected]] On Behalf Of Ville Syrjala
Sent: Friday, January 26, 2018 9:51 PM
To: [email protected]
Cc: Gabriel Krisman Bertazi <[email protected]>
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/kms_ccs: Don't skip the entire subtest if one plane can't do CCSFrom: Ville Syrjälä <[email protected]>
Make sure we test every plane on the pipe, and only report a SKIP if none of the planes support CCS (or the pixel format).
Cc: Gabriel Krisman Bertazi <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104724Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_ccs.c | 67 +++++++++++++++++++++++++++++++------------------ -------- 1 file changed, 37 insertions(+), 30 deletions(-)tests/kms_ccs.c index renamed from tests/kms_ccs.c +0
-0
b142d3e5a7cb..63298f137abb100644tests/kms_ccs.c +2
-1@@ -130,7 +130,7 @@ modifiers_ptr(struct local_drm_format_modifier_blob *blob)return (struct local_drm_format_modifier *)(((char *)blob) + blob->modifiers_offset); } -static void plane_require_ccs (data_t *data,igt_plane_t *plane,uint32_t format) +static bool plane_has_format_with_ccs(data_t *data, igt_plane_t *plane, +uint32_t format) {drmModePropertyBlobPtr blob; struct local_drm_format_modifier_blob *blob_data; @@ -161,8 +161,8 @@ static void
plane_require_ccs(data_t *data, igt_plane_t *plane, uint32_t format)tests/kms_ccs.c +0
-2} } - igt_skip_on_f(fmt_idx == -1, - "Format 0x%x not supported by plane\n",format);
tests/kms_ccs.c +4
-4+if (fmt_idx ==-1 ) +return false; modifiers =modifiers_ptr (blob_data); last_mod = &modifiers[blob_data->count_modifiers];@@ -177,12 +177,10 @@ static void plane_require_ccs(data_t *data, igt_plane_t *plane, uint32_t format) if (modifiers[i].formats & (1UL << (fmt_idx - modifiers[i].offset))) - return; - -igt_skip ("i915 CCS modifier not supported for format\n"); + return true; } -igt_skip ("i915 CCS modifier not supported by kernel for plane\n"); +return false;}
static void render_fb(data_t *data,
uint32_tgem_handle, unsigned int size,tests/kms_ccs.c +1
-1@@ -385,7 +383,7 @@ static void generate_fb(data_t *data, struct igt_fb *fb, fb->domain =0 ; } -static void try_config (data_t *data,enum test_fb_flags fb_flags, +static bool try_config (data_t *data,enum test_fb_flags fb_flags,igt_crc_t *crc) {
igt_display_t*display =&data->display; @@ -402,10 +400,12
@@ static void try_config(data_t *data, enumtest_fb_flagsfb_flags,primary = igt_output_get_plane_type(data->output,
DRM_PLANE_TYPE_PRIMARY);tests/kms_ccs.c +1
-1-plane_require_ccs (data, primary,DRM_FORMAT_XRGB8888 ); + if (!plane_has_format_with_ccs(data, primary,
DRM_FORMAT_XRGB8888))tests/kms_ccs.c +1
-1+return false;if (data->plane && fb_flags &FB_COMPRESSED ) { - plane_require_ccs(data, data->plane,
DRM_FORMAT_XRGB8888);tests/kms_ccs.c +1
-0+ if (!plane_has_format_with_ccs(data, data-Quoted 1 line
plane,
DRM_FORMAT_XRGB8888))tests/kms_ccs.c +1
-0+return false;generate_fb (data, &fb, drm_mode->hdisplay, drm_mode->vdisplay, (fb_flags & ~FB_COMPRESSED)|
FB_HAS_PLANE); @@ -416,7 +416,7 @@ static void try_config(data_t *data, enumtest_fb_flagsfb_flags,tests/kms_ccs.c +1
-1}if (data->flags &TEST_FAIL_ON_ADDFB2 ) -return ; +return true;igt_plane_set_position (primary,0 ,0 ); igt_plane_set_size(primary, drm_mode->hdisplay,
drm_mode->vdisplay); @@ -458,13 +458,16 @@ static void try_config(data_t *data, enumtest_fb_flagsfb_flags,tests/kms_ccs.c +5
-5if (data->flags &TEST_CRC )igt_remove_fb (data->drm_fd, &fb); + +return true; } -static void test_output (data_t *data) +static int test_output (data_t *data) {igt_display_t *display = &data->display;igt_crc_t crc, ref_crc;enum test_fb_flags fb_flags =0 ; +int valid_tests =0 ;igt_display_require_output_on_pipe (display, data->pipe);@@ -478,10 +481,11 @@ static void test_output(data_t *data)if (data->flags &TEST_CRC ) { data->pipe_crc =igt_pipe_crc_new (data- >drm_fd, data->pipe, INTEL_PIPE_CRC_SOURCE_AUTO); -try_config (data, fb_flags |FB_COMPRESSED , &ref_crc); -try_config (data, fb_flags, &crc); - -igt_assert_crc_equal (&crc, &ref_crc); + if (try_config(data, fb_flags | FB_COMPRESSED,
&ref_crc) &&tests/kms_ccs.c +2
-0+ try_config(data, fb_flags, &crc)) { + igt_assert_crc_equal(&crc,
&ref_crc);tests/kms_ccs.c +6
-4+ valid_tests++; + }igt_pipe_crc_free (data->pipe_crc); data->pipe_crc =NULL ;@@ -491,17 +495,19 @@ static void test_output(data_t *data) data->flags & TEST_BAD_ROTATION_90 || data->flags & TEST_NO_AUX_BUFFER || data->flags & TEST_BAD_CCS_HANDLE) { -try_config (data, fb_flags |FB_COMPRESSED , NULL); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED ,NULL ); }if (data->flags &TEST_BAD_AUX_STRIDE ) { -try_config (data, fb_flags |FB_COMPRESSED | FB_MISALIGN_AUX_STRIDE , NULL); -try_config (data, fb_flags |FB_COMPRESSED | FB_SMALL_AUX_STRIDE , NULL); -try_config (data, fb_flags |FB_COMPRESSED | FB_ZERO_AUX_STRIDE , NULL); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED |FB_MISALIGN_AUX_STRIDE ,NULL ); + valid_tests +=try_config (data, fb_flags |FB_COMPRESSED |FB_SMALL_AUX_STRIDE ,NULL ); + valid_tests += try_config(data, fb_flags |
FB_COMPRESSED|tests/kms_ccs.c +1
-0+FB_ZERO_AUX_STRIDE , NULL); }igt_output_set_pipe (data->output,PIPE_ANY ); igt_display_commit2(display, display->is_atomic ?
COMMIT_ATOMIC:COMMIT_LEGACY);tests/kms_ccs.c +10
-7+ +return valid_tests; }static data_t data;@@ -522,52 +528,53 @@ igt_mainfor_each_pipe_static (pipe) {const char *pipe_name =kmstest_pipe_name (pipe); -int sprite_idx =0 ; data.pipe = pipe; data.flags =TEST_BAD_PIXEL_FORMAT ;igt_subtest_f ("pipe-%s-bad-pixel-format" , pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_ROTATION_90 ;igt_subtest_f ("pipe-%s-bad-rotation-90" , pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC ;igt_subtest_f ("pipe-%s-crc-primary-basic" , pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC |TEST_ROTATE_180 ;igt_subtest_f ("pipe-%s-crc-primary-rotation- 180", pipe_name) -test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_CRC ;igt_subtest_f ("pipe-%s-crc-sprite-planes-basic" , pipe_name) { +int valid_tests =0 ;igt_display_require_output_on_pipe (&data.display, data.pipe);for_each_plane_on_pipe (&data.display, data.pipe, data.plane) {if (data.plane->type ==DRM_PLANE_TYPE_PRIMARY )continue ; - sprite_idx++; -test_output (&data); + valid_tests +=test_output (&data); } + +igt_require (valid_tests); } data.plane =NULL ;tests/kms_ccs.c +0
-0data.flags =TEST_NO_AUX_BUFFER ; igt_subtest_f("pipe-%s-missing-ccs-buffer",
pipe_name)tests/kms_ccs.c +1
-1-test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_CCS_HANDLE ; igt_subtest_f("pipe-%s-ccs-on-another-bo",
pipe_name)tests/kms_ccs.c +1
-1-test_output (&data); +igt_require (test_output (&data)); data.flags =TEST_BAD_AUX_STRIDE ; igt_subtest_f("pipe-%s-bad-aux-stride",
pipe_name)tests/kms_ccs.c +1
-2-test_output (&data); +igt_require (test_output (&data)); } igt_fixture --2.13.6
_______________________________________________
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