tests/kms_flip: Skip VBlank tests in modules without VBlank
PATCH v6 1/1 tests/kms_flip: Skip VBlank tests in modules without VBlank
The kms_flip test relies on VBlank support, and this situation may exclude some virtual drivers to take advantage of this set of tests. This commit adds a mechanism that checks if a module has VBlank. If the target module has VBlank support, kms_flip will run all the VBlank tests; otherwise, the VBlank tests will be skipped. Additionally, this commit improves the test coverage by checks if the function drmWaitVBlank() returns EOPNOTSUPP (i.e., no VBlank support).
V5: Drop the DRM_VBLANK_NEXTONMISS (Chris Wilson)
V4: Replace DRM_VBLANK_ABSOLUTE by DRM_VBLANK_RELATIVE and DRM_VBLANK_NEXTONMISS
V3: Add documentation (Daniel Vetter)
V2: Add new branch coverage to check if VBlank is enabled or not and update commit message
V1: Chris Wilson
- Change function name from igt_there_is_vblank to kms_has_vblank
- Move vblank function check from igt_aux to igt_kms
- Utilizes memset in dummy_vbl variable
- Directly return the result of drmWaitVBlank()
--- lib/igt_kms.c | 20 ++++++++++++++++++++ lib/igt_kms.h | 2 ++ tests/kms_flip.c | 22 ++++++++++++++++++++++ 3 files changed, 44 insertions(+)
lib/igt_kms.c +20 -0
@@ -1660,6 +1660,26 @@ void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)igt_assert_eq (visible, visibility); } +/** +* kms_has_vblank: +* @fd: DRM fd +* +* Get the VBlank errno after an attempt to call drmWaitVBlank(). This +* function is useful for checking if a driver has support or not for VBlank. +* +* Returns: true if target driver has VBlank support, otherwise return false. +*/ +bool kms_has_vblank (int fd) +{ +drmVBlank dummy_vbl; + +memset (&dummy_vbl,0 ,sizeof (drmVBlank)); + dummy_vbl.request.type =DRM_VBLANK_RELATIVE ; + +drmWaitVBlank (fd, &dummy_vbl); +return (errno !=EOPNOTSUPP ); +} +/* * A small modeset API */
lib/igt_kms.h +2 -0
@@ -230,6 +230,8 @@ void kmstest_wait_for_pageflip(int fd);unsigned int kmstest_get_vblank (int fd,int pipe,unsigned int flags);void igt_assert_plane_visible (int fd,enum pipe pipe,bool visibility); +bool kms_has_vblank (int fd); +/* * A small modeset API */
tests/kms_flip.c +22 -0
@@ -71,6 +71,7 @@#define TEST_SUSPEND (1 << 26)#define TEST_BO_TOOBIG (1 << 28) +#define TEST_NO_VBLANK (1 << 29)#define TEST_BASIC (1 << 30)#define EVENT_FLIP (1 << 0)
@@ -126,6 +127,18 @@ struct event_state {int seq_step; }; +static bool vblank_dependence (int flags) +{ +int vblank_flags =TEST_VBLANK |TEST_VBLANK_BLOCK | +TEST_VBLANK_ABSOLUTE |TEST_VBLANK_EXPIRED_SEQ | +TEST_CHECK_TS |TEST_VBLANK_RACE ; + +if (flags & vblank_flags) +return true; + +return false; +} +static float timeval_float (const struct timeval *tv) {return tv->tv_sec + tv->tv_usec /1000000.0f ;
@@ -1177,6 +1190,7 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,unsigned bo_size =0 ;uint64_t tiling;int i; +bool vblank = true;switch (crtc_count) {case RUN_TEST :
@@ -1260,6 +1274,14 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs, }igt_assert (fb_is_bound (o, o->fb_ids[0 ])); + vblank =kms_has_vblank (drm_fd); +if (!vblank) { +if (vblank_dependence (o->flags)) +igt_require_f (vblank,"There is no VBlank\n" ); +else + o->flags |=TEST_NO_VBLANK ; + } +/* quiescent the hw a bit so ensure we don't miss a single frame */ if (o->flags &TEST_CHECK_TS )calibrate_ts (o, crtc_idxs[0 ]);
Signature · 1 line
2.21.0
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_flip: Skip VBlank tests in modules without VBlank (rev3)
== Series Details ==
== Series Details ==
Series: tests/kms_flip: Skip VBlank tests in modules without VBlank (rev3)
URL : https://patchwork.freedesktop.org/series/58091/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_5810 -> IGTPW_2700
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_2700 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_2700, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58091/revisions/3/mbox/
Known issues
------------
Here are the changes found in IGTPW_2700 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_basic@cs-gfx:
- fi-skl-6700k2: NOTRUN -> SKIP [fdo#109271] +41
* igt@amdgpu/amd_cs_nop@sync-compute0:
- fi-ilk-650: NOTRUN -> SKIP [fdo#109271] +69
* igt@gem_exec_basic@basic-vebox:
- fi-ivb-3770: NOTRUN -> SKIP [fdo#109271] +48
* igt@gem_exec_basic@gtt-bsd:
- fi-bwr-2160: NOTRUN -> SKIP [fdo#109271] +103
* igt@gem_mmap_gtt@basic-write-cpu-read-gtt:
- fi-apl-guc: NOTRUN -> SKIP [fdo#109271] +50
* igt@i915_selftest@live_execlists:
- fi-apl-guc: NOTRUN -> INCOMPLETE [fdo#103927] / [fdo#109720]
* igt@kms_busy@basic-flip-c:
- fi-ilk-650: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-bwr-2160: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] * igt@kms_chamelium@hdmi-hpd-fast:
- fi-byt-n2820: NOTRUN -> SKIP [fdo#109271] +56
* igt@kms_chamelium@vga-edid-read:
- fi-cfl-8700k: NOTRUN -> SKIP [fdo#109271] +45
* igt@kms_force_connector_basic@force-edid:
- fi-kbl-x1275: NOTRUN -> SKIP [fdo#109271] +45
* igt@runner@aborted:
- fi-apl-guc: NOTRUN -> FAIL [fdo#108622] / [fdo#109720]
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
Participating hosts (9 -> 12)
------------------------------
ERROR: It appears as if the changes made in IGTPW_2700 prevented too many machines from booting.
Additional (8): fi-bwr-2160 fi-ilk-650 fi-cfl-8700k fi-apl-guc fi-kbl-x1275 fi-ivb-3770 fi-byt-n2820 fi-skl-6700k2
Missing (5): fi-kbl-soraka fi-skl-guc fi-bxt-j4205 fi-cfl-8109u fi-blb-e6850
Build changes
-------------
* IGT: IGT_4902 -> IGTPW_2700
CI_DRM_5810: 5ab8acfb062b61cb361308064c36052fe5f445aa @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2700: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2700/
IGT_4902: 3d325bb211d8cd84c6862c9945185a937395cb44 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2700/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev