Skip to contentSkip to conversation

Skip VBlank tests in modules without VBlank

PATCH New Rodrigo Siqueira via igt-dev 2 participants 3 messages Feb 14, 2019 – Feb 15, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 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).

Changes since V3:
Daniel Vetter:
- Add documentation for kms_vblank_status()

Changes since V2:
- Add new branch coverage to check if VBlank is enabled or not
- Update commit message
- Change function name from kms_has_vblank to kms_vblank_status

Changes since 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 | 27 +++++++++++++++++++++++++--
 3 files changed, 47 insertions(+), 2 deletions(-)
lib/igt_kms.c +20 -0
index 85a911e1..81fbafe0 100644
@@ -1654,6 +1654,26 @@ void igt_assert_plane_visible(int fd, enum pipe pipe, bool visibility)
 	igt_assert_eq(visible, visibility);
 }
 
+/**
+ * kms_vblank_status:
+ * @fd: DRM fd
+ *
+ * Get the VBlank status after an attempt to call drmWaitVBlank(). This
+ * function is useful for checking if a driver has support or not for VBlank.
+ *
+ * Returns: The errno code generated by drmWaitVBlank()
+ */
+int kms_vblank_status(int fd)
+{
+	drmVBlank dummy_vbl;
+
+	memset(&dummy_vbl, 0, sizeof(drmVBlank));
+	dummy_vbl.request.type = DRM_VBLANK_ABSOLUTE;
+
+	drmWaitVBlank(fd, &dummy_vbl);
+	return errno;
+}
+
 /*
  * A small modeset API
  */
lib/igt_kms.h +2 -0
index 679d4e84..259eaa75 100644
@@ -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);
 
+int kms_vblank_status(int fd);
+
 /*
  * A small modeset API
  */
tests/kms_flip.c +25 -2
index 798fc4e8..efc59328 100755
@@ -73,6 +73,7 @@
 #define TEST_TS_CONT		(1 << 27)
 #define TEST_BO_TOOBIG		(1 << 28)
 
+#define TEST_NO_VBLANK		(1 << 29)
 #define TEST_BASIC		(1 << 30)
 
 #define EVENT_FLIP		(1 << 0)
@@ -125,6 +126,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_TS_CONT | 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;
@@ -493,11 +506,11 @@ static void check_state(const struct test_output *o, const struct event_state *e
 	/* check only valid if no modeset happens in between, that increments by
 	 * (1 << 23) on each step. This bounding matches the one in
 	 * DRM_IOCTL_WAIT_VBLANK. */
-	if (!(o->flags & (TEST_DPMS | TEST_MODESET)))
+	if (!(o->flags & (TEST_DPMS | TEST_MODESET | TEST_NO_VBLANK))) {
 		igt_assert_f(es->current_seq - (es->last_seq + o->seq_step) <= 1UL << 23,
 			     "unexpected %s seq %u, should be >= %u\n",
 			     es->name, es->current_seq, es->last_seq + o->seq_step);
-
+	}
 	/* Check that the vblank frame didn't wrap unexpectedly. */
 	if (o->flags & TEST_TS_CONT) {
 		/* Ignore seq_step here since vblank waits time out immediately
@@ -1184,6 +1197,7 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 	unsigned bo_size = 0;
 	uint64_t tiling;
 	int i;
+	int vblank_status = 0;
 
 	switch (crtc_count) {
 	case 1:
@@ -1267,6 +1281,15 @@ 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_status = kms_vblank_status(drm_fd);
+	if (vblank_status == EOPNOTSUPP) {
+		if (vblank_dependence(o->flags))
+			igt_require_f(!(vblank_status == EOPNOTSUPP),
+				      "Vblank: %s\n", strerror(vblank_status));
+		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.20.1

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for Skip VBlank tests in modules without VBlank (rev4)

== Series Details ==

== Series Details ==

Series: Skip VBlank tests in modules without VBlank (rev4)
URL : https://patchwork.freedesktop.org/series/48468/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5603 -> IGTPW_2411
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/48468/revisions/4/mbox/

Known issues
------------

Here are the changes found in IGTPW_2411 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: PASS -> INCOMPLETE [fdo#107718]

* igt@kms_flip@basic-flip-vs-dpms:
- fi-skl-6700hq: PASS -> DMESG-WARN [fdo#105998]

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s3:
- {fi-icl-u2}: FAIL [fdo#103375] -> PASS

* igt@i915_selftest@live_execlists:
- fi-apl-guc: INCOMPLETE [fdo#103927] -> PASS

* igt@pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: {SKIP} [fdo#109271] -> PASS

* igt@pm_rpm@basic-rte:
- fi-bsw-kefka: FAIL [fdo#108800] -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105998]: https://bugs.freedesktop.org/show_bug.cgi?id=105998
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108800]: https://bugs.freedesktop.org/show_bug.cgi?id=108800
[fdo#109226]: https://bugs.freedesktop.org/show_bug.cgi?id=109226
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109294]: https://bugs.freedesktop.org/show_bug.cgi?id=109294
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109527]: https://bugs.freedesktop.org/show_bug.cgi?id=109527
[fdo#109528]: https://bugs.freedesktop.org/show_bug.cgi?id=109528
[fdo#109530]: https://bugs.freedesktop.org/show_bug.cgi?id=109530

Participating hosts (46 -> 44)
------------------------------

Additional (1): fi-icl-y
Missing (3): fi-ilk-m540 fi-byt-squawks fi-bsw-cyan

Build changes
-------------

* IGT: IGT_4827 -> IGTPW_2411

CI_DRM_5603: 80e06a883a3c9272b3dc699c08ff43b9cca0d138 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2411: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2411/
IGT_4827: 395eaffd7e1390c9d6043c2980dc14ce3e08b154 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2411/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✗ Fi.CI.IGT: failure for Skip VBlank tests in modules without VBlank (rev4)

In reply to Rodrigo Siqueira via igt-dev
== Series Details ==

== Series Details ==

Series: Skip VBlank tests in modules without VBlank (rev4)
URL : https://patchwork.freedesktop.org/series/48468/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5603_full -> IGTPW_2411_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_2411_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_2411_full, 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/48468/revisions/4/mbox/

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_2411_full:

### IGT changes ###

#### Possible regressions ####

* igt@kms_vblank@pipe-c-ts-continuation-modeset-rpm:
- shard-kbl: PASS -> FAIL +1
- shard-apl: PASS -> FAIL +1

Known issues
------------

Here are the changes found in IGTPW_2411_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_eio@unwedge-stress:
- shard-snb: PASS -> FAIL [fdo#107799]

* igt@gem_mmap_wc@read-no-prefault:
- shard-snb: PASS -> INCOMPLETE [fdo#105411]

* igt@kms_busy@extended-modeset-hang-newfb-render-b:
- shard-kbl: NOTRUN -> DMESG-WARN [fdo#107956]

* igt@kms_ccs@pipe-b-crc-sprite-planes-basic:
- shard-glk: PASS -> FAIL [fdo#108145]
- shard-kbl: PASS -> FAIL [fdo#107725] / [fdo#108145]

* igt@kms_color@pipe-c-degamma:
- shard-apl: PASS -> FAIL [fdo#104782]

* igt@kms_cursor_crc@cursor-128x128-suspend:
- shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232]

* igt@kms_cursor_crc@cursor-256x256-random:
- shard-apl: NOTRUN -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-64x21-random:
- shard-apl: PASS -> FAIL [fdo#103232] +4
- shard-kbl: PASS -> FAIL [fdo#103232] +2

* igt@kms_cursor_crc@cursor-alpha-opaque:
- shard-kbl: PASS -> FAIL [fdo#109350]
- shard-apl: PASS -> FAIL [fdo#109350]

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-apl: PASS -> FAIL [fdo#103167] +4

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-fullscreen:
- shard-kbl: PASS -> FAIL [fdo#103167] +2

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
- shard-glk: PASS -> FAIL [fdo#103167] +8

* igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
- shard-apl: NOTRUN -> FAIL [fdo#108145]

* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-glk: PASS -> FAIL [fdo#103166] +5

* igt@kms_plane_multiple@atomic-pipe-b-tiling-yf:
- shard-apl: NOTRUN -> FAIL [fdo#103166]

* igt@kms_rotation_crc@multiplane-rotation:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665]

* igt@kms_universal_plane@universal-plane-pipe-c-functional:
- shard-apl: PASS -> FAIL [fdo#103166]

* igt@testdisplay:
- shard-kbl: PASS -> DMESG-WARN [fdo#103313]

#### Possible fixes ####

* igt@kms_atomic_transition@plane-all-modeset-transition-fencing:
- shard-apl: INCOMPLETE [fdo#103927] / [fdo#109225] -> PASS

* igt@kms_atomic_transition@plane-all-transition:
- shard-apl: DMESG-WARN [fdo#103558] / [fdo#105602] / [fdo#109225] -> PASS

* igt@kms_color@pipe-c-legacy-gamma:
- shard-glk: FAIL [fdo#104782] -> PASS

* igt@kms_cursor_crc@cursor-128x42-sliding:
- shard-kbl: FAIL [fdo#103232] -> PASS
- shard-apl: FAIL [fdo#103232] -> PASS +2

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-apl: FAIL [fdo#103191] / [fdo#103232] -> PASS

* igt@kms_cursor_legacy@short-flip-before-cursor-toggle:
- shard-apl: DMESG-WARN [fdo#103558] / [fdo#105602] -> PASS +6

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: FAIL [fdo#102887] / [fdo#105363] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-onoff:
- shard-apl: FAIL [fdo#103167] -> PASS

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
- shard-glk: FAIL [fdo#103167] -> PASS +2

* igt@kms_plane@pixel-format-pipe-b-planes-source-clamping:
- shard-glk: FAIL [fdo#108948] -> PASS

* igt@kms_plane@plane-position-covered-pipe-a-planes:
- shard-glk: FAIL [fdo#103166] -> PASS +1

* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-apl: FAIL [fdo#103166] -> PASS +4
- shard-kbl: FAIL [fdo#103166] -> PASS

* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: FAIL [fdo#109016] -> PASS

* igt@kms_setmode@basic:

    - shard-apl:          FAIL [fdo#99912] -> PASS
    - shard-hsw:          FAIL [fdo#99912] -> PASS
    - shard-kbl:          FAIL [fdo#99912] -> PASS

* igt@kms_vblank@pipe-a-ts-continuation-modeset-rpm:
- shard-kbl: FAIL -> PASS

* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-apl: FAIL [fdo#104894] -> PASS

* igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm:
- shard-apl: FAIL -> PASS +1

#### Warnings ####

* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max:
- shard-apl: DMESG-FAIL [fdo#103558] / [fdo#105602] / [fdo#108145] -> FAIL [fdo#108145]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#107725]: https://bugs.freedesktop.org/show_bug.cgi?id=107725
[fdo#107799]: https://bugs.freedesktop.org/show_bug.cgi?id=107799
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
[fdo#109225]: https://bugs.freedesktop.org/show_bug.cgi?id=109225
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109350]: https://bugs.freedesktop.org/show_bug.cgi?id=109350
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912

Participating hosts (8 -> 5)
------------------------------

Missing (3): shard-skl pig-hsw-4770r shard-iclb

Build changes
-------------

* IGT: IGT_4827 -> IGTPW_2411
* Piglit: piglit_4509 -> None

CI_DRM_5603: 80e06a883a3c9272b3dc699c08ff43b9cca0d138 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2411: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2411/
IGT_4827: 395eaffd7e1390c9d6043c2980dc14ce3e08b154 @ 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_2411/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev