Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Roy <rongh7426@gmail.com>, igt-dev@lists.freedesktop.org
Cc: Roy <rongh7426@gmail.com>
Subject: Re: [PATCH i-g-t] tests/kms_vblank: Query the pipe under test in the invalid subtest
Date: Thu, 26 Nov 2026 14:21:54 +0200	[thread overview]
Message-ID: <78487c3aa5f1aacf574e647e711cb61d502d7b35@intel.com> (raw)
In-Reply-To: <20261126030034.641144-1-rongh7426@gmail.com>

On Thu, 26 Nov 2026, Roy <rongh7426@gmail.com> wrote:
> 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>

Reviewed-by: Jani Nikula <jani.nikula@intel.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",

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-11-26 12:23 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 [this message]
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

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=78487c3aa5f1aacf574e647e711cb61d502d7b35@intel.com \
    --to=jani.nikula@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=rongh7426@gmail.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