Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lin Tzu Yang <rongh7426@gmail.com>
To: igt-dev@lists.freedesktop.org
Cc: kamil.konieczny@linux.intel.com, jani.nikula@intel.com
Subject: [PATCH i-g-t v2] tests/kms_vblank: Query the pipe under test in the invalid subtest
Date: Mon, 30 Nov 2026 19:51:04 +0800	[thread overview]
Message-ID: <20261130115104.842861-1-rongh7426@gmail.com> (raw)
In-Reply-To: <20261126030034.641144-1-rongh7426@gmail.com>

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.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Lin Tzu Yang <rongh7426@gmail.com>
---
v2:
- Move the note about AI use below the --- line (Kamil).
- Use my full name in the author and Signed-off-by (Kamil).
- Add Jani's Reviewed-by.

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

 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


  parent reply	other threads:[~2026-11-30 11:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Lin Tzu Yang [this message]
2026-11-30 13:55   ` [PATCH i-g-t v2] tests/kms_vblank: Query the pipe under test in the invalid subtest 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130115104.842861-1-rongh7426@gmail.com \
    --to=rongh7426@gmail.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox