Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_vblank: Query the pipe under test in the invalid subtest
@ 2026-11-26  3:00 Roy
  2026-11-26 12:21 ` Jani Nikula
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Roy @ 2026-11-26  3:00 UTC (permalink / raw)
  To: igt-dev; +Cc: Roy

invalid_subtest() sets up data->crtc but builds its vblank requests
without the pipe flag, so every request goes to CRTC 0. The other
subtests add igt_crtc_get_vbl_flag(data->crtc).

That breaks on hardware where the output under test can't be driven by
CRTC 0. On a Raspberry Pi 5 (vc4), HDMI-A-1 only works with pipe C, so
CRTC 0 is off and the first, valid query already fails:

  Starting dynamic subtest: pipe-C-HDMI-A-1
  (kms_vblank) CRITICAL: Failed assertion: wait_vblank(fd, &vbl) == 0
  (kms_vblank) CRITICAL: Last errno: 22, Invalid argument
  Subtest invalid: FAIL

The invalid-flag checks after it have the same problem: with CRTC 0
off, an -EINVAL can't tell a rejected flag from a CRTC that isn't
running.

Add the pipe flag to the valid query and to the invalid-flag checks.
The final check, which asks for an out-of-range pipe on purpose, is
left as is.

Tested on a Raspberry Pi 5 (Raspberry Pi OS kernel 6.18.39): the
invalid subtest fails before and passes after.

This change and its description were written with the help of an AI
coding assistant (Claude); the test runs above were done on real
hardware.

Signed-off-by: Roy <rongh7426@gmail.com>
---
 tests/kms_vblank.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 47b733a..018bc6f 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -582,12 +582,14 @@ static void invalid_subtest(data_t *data, int fd)
 	union drm_wait_vblank vbl;
 	unsigned long valid_flags;
 	igt_output_t *output = data->output;
+	uint32_t crtc_flag;
 
 	prepare_crtc(data, fd, output);
+	crtc_flag = igt_crtc_get_vbl_flag(data->crtc);
 
 	/* First check all is well with a simple query */
 	memset(&vbl, 0, sizeof(vbl));
-	vbl.request.type = _DRM_VBLANK_RELATIVE;
+	vbl.request.type = _DRM_VBLANK_RELATIVE | crtc_flag;
 	igt_assert_eq(wait_vblank(fd, &vbl), 0);
 
 	valid_flags = (_DRM_VBLANK_TYPES_MASK |
@@ -596,7 +598,7 @@ static void invalid_subtest(data_t *data, int fd)
 
 	/* pick some interesting invalid permutations */
 	memset(&vbl, 0, sizeof(vbl));
-	vbl.request.type = _DRM_VBLANK_RELATIVE | ~valid_flags;
+	vbl.request.type = _DRM_VBLANK_RELATIVE | crtc_flag | ~valid_flags;
 	igt_assert_eq(wait_vblank(fd, &vbl), -EINVAL);
 	for (int bit = 0; bit < 32; bit++) {
 		int err;
@@ -605,7 +607,7 @@ static void invalid_subtest(data_t *data, int fd)
 			continue;
 
 		memset(&vbl, 0, sizeof(vbl));
-		vbl.request.type = _DRM_VBLANK_RELATIVE | (1 << bit);
+		vbl.request.type = _DRM_VBLANK_RELATIVE | crtc_flag | (1 << bit);
 		err = wait_vblank(fd, &vbl);
 		igt_assert_f(err == -EINVAL,
 			     "vblank wait with invalid request.type bit %d [0x%08x] did not report -EINVAL, got %d\n",
-- 
2.51.1.windows.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-12-01  1:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26  3:00 [PATCH i-g-t] tests/kms_vblank: Query the pipe under test in the invalid subtest Roy
2026-11-26 12:21 ` Jani Nikula
2026-11-26 16:05 ` Kamil Konieczny
2026-11-26 22:18 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-11-27 22:00 ` ✓ Xe.CI.BAT: success for tests/kms_vblank: Query the pipe under test in the invalid subtest (rev2) Patchwork
2026-11-27 22:14 ` ✗ i915.CI.BAT: failure " Patchwork
2026-11-28 20:17 ` ✓ Xe.CI.FULL: success " Patchwork
2026-11-30 11:51 ` [PATCH i-g-t v2] tests/kms_vblank: Query the pipe under test in the invalid subtest Lin Tzu Yang
2026-11-30 13:55   ` Kamil Konieczny
2026-12-01  1:27 ` ✗ LGCI.VerificationFailed: failure for tests/kms_vblank: Query the pipe under test in the invalid subtest (rev3) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox