tests/kms_flip: Skip VBlank tests in modules without VBlank
PATCH RESEND v7 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).
V6: Set errno to zero before call drmWaitVBlank() (Chris Wilson)
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 | 21 +++++++++++++++++++++ lib/igt_kms.h | 2 ++ tests/kms_flip.c | 22 ++++++++++++++++++++++ 3 files changed, 45 insertions(+)
lib/igt_kms.c +21 -0
@@ -1656,6 +1656,27 @@ void igt_assert_plane_visible(int fd, enum pipe pipe, int plane_index, bool visiigt_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 ; + + errno =0 ; +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,int plane_index,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 ;
@@ -1176,6 +1189,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 :
@@ -1259,6 +1273,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: success for tests/kms_flip: Skip VBlank tests in modules without VBlank (rev6)
== Series Details ==
== Series Details ==
Series: tests/kms_flip: Skip VBlank tests in modules without VBlank (rev6)
URL : https://patchwork.freedesktop.org/series/58091/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6097 -> IGTPW_3004
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58091/revisions/6/mbox/
Known issues
------------
Here are the changes found in IGTPW_3004 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: [PASS][1] -> [FAIL][2] ([fdo#103167])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-icl-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/fi-icl-u2/igt@[email protected]
#### Possible fixes ####
* igt@amdgpu/amd_basic@userptr:
- fi-kbl-8809g: [DMESG-WARN][3] ([fdo#108965]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-kbl-8809g/igt@amdgpu/[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/fi-kbl-8809g/igt@amdgpu/[email protected]
* igt@i915_selftest@live_hangcheck:
- fi-skl-iommu: [INCOMPLETE][5] ([fdo#108602] / [fdo#108744]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/fi-skl-iommu/igt@i915_selftest@live_hangcheck.html
#### Warnings ####
* igt@i915_selftest@live_hangcheck:
- fi-apl-guc: [FAIL][7] ([fdo#110623]) -> [DMESG-FAIL][8] ([fdo#110620])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/fi-apl-guc/igt@i915_selftest@live_hangcheck.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/fi-apl-guc/igt@i915_selftest@live_hangcheck.html
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
[fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
[fdo#108965]: https://bugs.freedesktop.org/show_bug.cgi?id=108965
[fdo#110620]: https://bugs.freedesktop.org/show_bug.cgi?id=110620
[fdo#110623]: https://bugs.freedesktop.org/show_bug.cgi?id=110623
Participating hosts (52 -> 43)
------------------------------
Additional (1): fi-pnv-d510
Missing (10): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-gdg-551 fi-icl-u3 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* IGT: IGT_4996 -> IGTPW_3004
CI_DRM_6097: 3f2d6a47d9eec66594887b1e9718bc1a29aa6a77 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3004: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/
IGT_4996: 6fe5d254ec1b9b47d61408e1b49a7339876bf1e7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/
_______________________________________________
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_flip: Skip VBlank tests in modules without VBlank (rev6)
In reply to Rodrigo Siqueira== Series Details ==
== Series Details ==
Series: tests/kms_flip: Skip VBlank tests in modules without VBlank (rev6)
URL : https://patchwork.freedesktop.org/series/58091/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6097_full -> IGTPW_3004_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58091/revisions/6/mbox/
Known issues
------------
Here are the changes found in IGTPW_3004_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_eio@unwedge-stress:
- shard-snb: [PASS][1] -> [FAIL][2] ([fdo#109661])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-snb2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-snb4/igt@[email protected]
* igt@gem_mmap_gtt@forked-big-copy:
- shard-iclb: [PASS][3] -> [INCOMPLETE][4] ([fdo#107713] / [fdo#109100])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb6/igt@[email protected]
* igt@gem_mmap_gtt@forked-medium-copy:
- shard-iclb: [PASS][5] -> [INCOMPLETE][6] ([fdo#107713])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb5/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb2/igt@[email protected]
* igt@gem_workarounds@suspend-resume-context:
- shard-apl: [PASS][7] -> [DMESG-WARN][8] ([fdo#108566]) +7 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-apl8/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-apl3/igt@[email protected]
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
- shard-glk: [PASS][9] -> [FAIL][10] ([fdo#104873])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-glk3/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-glk5/igt@[email protected]
* igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
- shard-hsw: [PASS][11] -> [FAIL][12] ([fdo#103355])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-hsw4/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-hsw6/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-iclb: [PASS][13] -> [FAIL][14] ([fdo#103167]) +3 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb6/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-rte:
- shard-iclb: [PASS][15] -> [FAIL][16] ([fdo#103167] / [fdo#110378])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb5/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb5/igt@[email protected]
* igt@kms_psr@psr2_dpms:
- shard-iclb: [PASS][17] -> [SKIP][18] ([fdo#109441]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb2/igt@kms_psr@psr2_dpms.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb7/igt@kms_psr@psr2_dpms.html
* igt@kms_setmode@basic:
- shard-apl: [PASS][19] -> [FAIL][20] ([fdo#99912])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-apl6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-apl4/igt@[email protected]
#### Possible fixes ####
* igt@gem_mmap_gtt@forked-medium-copy-odd:
- shard-iclb: [INCOMPLETE][21] ([fdo#107713]) -> [PASS][22] +1 similar issue
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb7/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb7/igt@[email protected]
* igt@gem_tiled_swapping@non-threaded:
- shard-glk: [DMESG-WARN][23] ([fdo#108686]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-glk7/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-glk7/igt@[email protected]
- shard-hsw: [FAIL][25] ([fdo#108686]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-hsw6/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-hsw6/igt@[email protected]
* igt@kms_color@pipe-b-ctm-green-to-red:
- shard-kbl: [FAIL][27] ([fdo#107201]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-kbl7/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-kbl2/igt@[email protected]
- shard-apl: [FAIL][29] ([fdo#107201]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-apl5/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-apl5/igt@[email protected]
* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-glk: [FAIL][31] ([fdo#102887]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-glk8/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-glk3/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-blt:
- shard-iclb: [FAIL][33] ([fdo#103167]) -> [PASS][34] +1 similar issue
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-blt.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb8/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-blt.html
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
- shard-apl: [DMESG-WARN][35] ([fdo#108566]) -> [PASS][36] +2 similar issues
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-apl2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-apl1/igt@[email protected]
* igt@kms_psr@psr2_sprite_mmap_cpu:
- shard-iclb: [SKIP][37] ([fdo#109441]) -> [PASS][38] +1 similar issue
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb8/igt@kms_psr@psr2_sprite_mmap_cpu.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_cpu.html
* igt@kms_setmode@basic:
- shard-kbl: [FAIL][39] ([fdo#99912]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-kbl7/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-kbl1/igt@[email protected]
* igt@kms_sysfs_edid_timing:
- shard-iclb: [FAIL][41] ([fdo#100047]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6097/shard-iclb2/igt@kms_sysfs_edid_timing.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/shard-iclb6/igt@kms_sysfs_edid_timing.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#100047]: https://bugs.freedesktop.org/show_bug.cgi?id=100047
[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
[fdo#107201]: https://bugs.freedesktop.org/show_bug.cgi?id=107201
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
[fdo#110378]: https://bugs.freedesktop.org/show_bug.cgi?id=110378
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (10 -> 6)
------------------------------
Missing (4): pig-skl-6260u shard-skl pig-hsw-4770r pig-glk-j5005
Build changes
-------------
* IGT: IGT_4996 -> IGTPW_3004
* Piglit: piglit_4509 -> None
CI_DRM_6097: 3f2d6a47d9eec66594887b1e9718bc1a29aa6a77 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3004: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/
IGT_4996: 6fe5d254ec1b9b47d61408e1b49a7339876bf1e7 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3004/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev