From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/modes: Add DRM_MODE_MATCH_TIMINGS_VRR
Date: Mon, 22 Jun 2026 15:46:35 +0200 [thread overview]
Message-ID: <3038ba5c-eff2-4af1-818e-ef3fc070311a@linux.intel.com> (raw)
In-Reply-To: <20260612144203.31715-2-ville.syrjala@linux.intel.com>
For inclusion through drm-intel:
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
On 6/12/26 16:42, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Add a new mode matching flag DRM_MODE_MATCH_TIMINGS_VRR. This is
> identical to DRM_MODE_MATCH_TIMINGS, except it requires the vsync
> pulse to remain anchored to the end of vtotal, as opposed to the
> start of the frame. VRR capable hardware can therefore treat
> matching modes as just variants of the same mode with a different
> vblank lengths.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_modes.c | 23 +++++++++++++++++++++++
> include/drm/drm_modes.h | 1 +
> 2 files changed, 24 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 3f8e025fd6d9..e1eed13a8e94 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -1469,6 +1469,25 @@ struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
> }
> EXPORT_SYMBOL(drm_mode_duplicate);
>
> +static bool drm_mode_match_timings_vrr(const struct drm_display_mode *mode1,
> + const struct drm_display_mode *mode2)
> +{
> + int mode1_vsync_start_offset = mode1->vtotal - mode1->vsync_start;
> + int mode1_vsync_end_offset = mode1->vtotal - mode1->vsync_end;
> + int mode2_vsync_start_offset = mode2->vtotal - mode2->vsync_start;
> + int mode2_vsync_end_offset = mode2->vtotal - mode2->vsync_end;
> +
> + return mode1->hdisplay == mode2->hdisplay &&
> + mode1->hsync_start == mode2->hsync_start &&
> + mode1->hsync_end == mode2->hsync_end &&
> + mode1->htotal == mode2->htotal &&
> + mode1->hskew == mode2->hskew &&
> + mode1->vdisplay == mode2->vdisplay &&
> + mode1_vsync_start_offset == mode2_vsync_start_offset &&
> + mode1_vsync_end_offset == mode2_vsync_end_offset &&
> + mode1->vscan == mode2->vscan;
> +}
> +
> static bool drm_mode_match_timings(const struct drm_display_mode *mode1,
> const struct drm_display_mode *mode2)
> {
> @@ -1538,6 +1557,10 @@ bool drm_mode_match(const struct drm_display_mode *mode1,
> if (!mode1 || !mode2)
> return false;
>
> + if (match_flags & DRM_MODE_MATCH_TIMINGS_VRR &&
> + !drm_mode_match_timings_vrr(mode1, mode2))
> + return false;
> +
> if (match_flags & DRM_MODE_MATCH_TIMINGS &&
> !drm_mode_match_timings(mode1, mode2))
> return false;
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index b9bb92e4b029..6e3eccc3c349 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -193,6 +193,7 @@ enum drm_mode_status {
> #define DRM_MODE_MATCH_FLAGS (1 << 2)
> #define DRM_MODE_MATCH_3D_FLAGS (1 << 3)
> #define DRM_MODE_MATCH_ASPECT_RATIO (1 << 4)
> +#define DRM_MODE_MATCH_TIMINGS_VRR (1 << 5)
>
> /**
> * struct drm_display_mode - DRM kernel-internal display mode structure
next prev parent reply other threads:[~2026-06-22 13:46 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 14:41 [PATCH 0/4] drm/i915: Work harder to enable VRR based refresh rate changes on eDP Ville Syrjala
2026-06-12 14:42 ` [PATCH 1/4] drm/modes: Add DRM_MODE_MATCH_TIMINGS_VRR Ville Syrjala
2026-06-13 14:19 ` Kandpal, Suraj
2026-06-22 13:46 ` Maarten Lankhorst [this message]
2026-06-12 14:42 ` [PATCH 2/4] drm/i915: Pass the full atomic state to .compute_config() Ville Syrjala
2026-06-13 14:23 ` Kandpal, Suraj
2026-06-12 14:42 ` [PATCH 3/4] drm/i915/panel: Adjust intel_panel_compute_config() calling convention Ville Syrjala
2026-06-13 14:25 ` Kandpal, Suraj
2026-06-12 14:42 ` [PATCH 4/4] drm/i915/panel: Attempt VRR based refresh rate change for !allow_modeset Ville Syrjala
2026-06-15 5:17 ` Nautiyal, Ankit K
2026-06-18 19:10 ` Ville Syrjälä
2026-06-19 4:24 ` Nautiyal, Ankit K
2026-06-12 15:45 ` ✓ i915.CI.BAT: success for drm/i915: Work harder to enable VRR based refresh rate changes on eDP Patchwork
2026-06-13 13:24 ` ✗ i915.CI.Full: failure " Patchwork
2026-06-15 9:06 ` [PATCH 0/4] " Michel Dänzer
2026-06-15 9:08 ` Michel Dänzer
2026-06-15 13:06 ` Ville Syrjälä
2026-06-15 13:30 ` Michel Dänzer
2026-06-15 17:00 ` Ville Syrjälä
2026-06-16 7:21 ` Michel Dänzer
2026-06-18 18:39 ` Ville Syrjälä
2026-06-19 8:48 ` Michel Dänzer
2026-06-22 11:13 ` Ville Syrjälä
2026-06-22 17:32 ` Mario Kleiner
2026-06-19 16:20 ` ✓ i915.CI.Full: success for " 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=3038ba5c-eff2-4af1-818e-ef3fc070311a@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox