From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 5/8] lib/kms: Simplify kmstest_get_vbl_flag()
Date: Tue, 13 Jan 2026 16:33:55 +0200 [thread overview]
Message-ID: <6a913e4bb702ede2bc990f36f0b4667e030a2dbd@intel.com> (raw)
In-Reply-To: <20260113120439.12577-6-ville.syrjala@linux.intel.com>
On Tue, 13 Jan 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Simplify kmstest_get_vbl_flag() by observing that:
> - '0 << DRM_VBLANK_HIGH_CRTC_SHIFT == 0' so we don't
> have to have special treatment for crtc_offset==0
> - the kernel will treat '1 << DRM_VBLANK_HIGH_CRTC_SHIFT'
> and 'DRM_VBLANK_SECONDARY' identically, so the
> crtc_offset==1 special case can also go away.
>
> DRM_VBLANK_HIGH_CRTC_* was added in 2011, so there is no real
> point in keeping support for old kernels that don't have it.
> And in case someone is crazy enoguh to run igt on a kernel older
> than that we can toss in a DRM_CAP_VBLANK_HIGH_CRTC check into
> igt_display_require().
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> lib/igt_kms.c | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 8581a218a83c..3cb1273f3041 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -3186,6 +3186,8 @@ void igt_display_require(igt_display_t *display, int drm_fd)
> display->drm_fd = drm_fd;
> is_intel_dev = is_intel_device(drm_fd);
>
> + igt_require(igt_has_drm_cap(drm_fd, DRM_CAP_VBLANK_HIGH_CRTC));
> +
> if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
> display->is_atomic = 1;
>
> @@ -6125,19 +6127,13 @@ void igt_cleanup_uevents(struct udev_monitor *mon)
> */
> uint32_t kmstest_get_vbl_flag(int crtc_offset)
> {
> - uint32_t pipe_id;
> + uint32_t flag;
>
> - if (crtc_offset == 0)
> - pipe_id = 0;
> - else if (crtc_offset == 1)
> - pipe_id = _DRM_VBLANK_SECONDARY;
> - else {
> - uint32_t pipe_flag = crtc_offset << 1;
> - igt_assert(!(pipe_flag & ~DRM_VBLANK_HIGH_CRTC_MASK));
> - pipe_id = pipe_flag;
> - }
> + flag = crtc_offset << DRM_VBLANK_HIGH_CRTC_SHIFT;
> +
> + igt_assert_eq(flag & ~DRM_VBLANK_HIGH_CRTC_MASK, 0);
>
> - return pipe_id;
> + return flag;
> }
>
> static inline const uint32_t *
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-01-13 14:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 12:04 [PATCH i-g-t 0/8] Some cleanups etc Ville Syrjala
2026-01-13 12:04 ` [PATCH i-g-t 1/8] tests/kms_plane_cursor: s/or/rect/ Ville Syrjala
2026-01-13 14:31 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 2/8] tests/intel/i915_pm_rpm: Nuke bogus NULL check Ville Syrjala
2026-01-13 14:31 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 3/8] tests/kms_rotation_crc: s/0/PIPE_A/ Ville Syrjala
2026-01-13 14:32 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 4/8] lib/kms: Nuke pipe_select() Ville Syrjala
2026-01-13 14:32 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 5/8] lib/kms: Simplify kmstest_get_vbl_flag() Ville Syrjala
2026-01-13 14:33 ` Jani Nikula [this message]
2026-01-13 12:04 ` [PATCH i-g-t 6/8] tests/kms_async_flips: Use designated initializers in wait_for_vblank() Ville Syrjala
2026-01-13 14:37 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 7/8] tests/intel/kms_pipe_stress: Eliminate double display.drm_fd initialization Ville Syrjala
2026-01-13 14:39 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 8/8] lib/kms: Turn igt_pipe_connector_valid() into a function Ville Syrjala
2026-01-13 14:41 ` Jani Nikula
2026-01-13 15:01 ` ✓ Xe.CI.BAT: success for Some cleanups etc Patchwork
2026-01-13 15:18 ` ✓ i915.CI.BAT: " Patchwork
2026-01-13 22:00 ` ✗ i915.CI.Full: failure " Patchwork
2026-01-13 23:14 ` ✗ Xe.CI.Full: " Patchwork
2026-01-15 15:09 ` ✓ Xe.CI.BAT: success for Some cleanups etc. (rev2) Patchwork
2026-01-15 15:17 ` ✓ i915.CI.BAT: " Patchwork
2026-01-15 17:26 ` ✗ Xe.CI.Full: failure " Patchwork
2026-01-15 18:22 ` ✗ i915.CI.Full: " 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=6a913e4bb702ede2bc990f36f0b4667e030a2dbd@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.