Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 01/13] drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start()
Date: Tue, 27 Oct 2026 18:04:39 +0200	[thread overview]
Message-ID: <956f60a3c6194f7ab12f8cb44d413c0bb58ec541@intel.com> (raw)
In-Reply-To: <20261023165803.31016-2-ville.syrjala@linux.intel.com>

On Fri, 23 Oct 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> intel_vrr_dcb_vmin_vblank_start() may evaluate
> intel_vrr_dcb_vmin_vblank_start_next() twice, and given that
> this is doing hardware access under the hood isn't really
> desired.

Feels like there's a word missing there. This? It?

> Even worse, the double evaluation might even cause
> intel_vrr_dcb_vmin_vblank_start() itself to finally
> return -EINVAL (if we race against the DMC hard enough),
> which we definitely never want to do.
>
> Eliminate the double evaluation, guaranteeing a sane
> final return value at the same time.

I think a Fixes: would be in order.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_vrr.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> index b14750692ae0..e59345bd1d33 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -1202,9 +1202,13 @@ int intel_vrr_safe_window_start(const struct intel_crtc_state *crtc_state)
>  static int
>  intel_vrr_dcb_vmin_vblank_start(const struct intel_crtc_state *crtc_state)
>  {
> -	return (intel_vrr_dcb_vmin_vblank_start_next(crtc_state) < 0) ?
> -		intel_vrr_dcb_vmin_vblank_start_final(crtc_state) :
> -		intel_vrr_dcb_vmin_vblank_start_next(crtc_state);
> +	int vblank_start;
> +
> +	vblank_start = intel_vrr_dcb_vmin_vblank_start_next(crtc_state);
> +	if (vblank_start < 0)
> +		vblank_start = intel_vrr_dcb_vmin_vblank_start_final(crtc_state);
> +
> +	return vblank_start;
>  }
>  
>  int intel_vrr_vmin_safe_window_end(const struct intel_crtc_state *crtc_state)

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-10-27 16:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 16:57 [PATCH 00/13] drm/i915/vrr: Fixes and cleanups Ville Syrjala
2026-10-23 16:57 ` [PATCH 01/13] drm/i915/vrr: Fix intel_vrr_dcb_vmin_vblank_start() Ville Syrjala
2026-10-27 16:04   ` Jani Nikula [this message]
2026-10-27 16:37     ` Ville Syrjälä
2026-10-23 16:57 ` [PATCH 02/13] drm/i915/vrr: Drop bogus intel_vrr_hw_value() call Ville Syrjala
2026-10-23 16:57 ` [PATCH 03/13] drm/i915/vrr: s/intel_vrr_vblank_start()/vrr_vblank_start()/ Ville Syrjala
2026-10-23 16:57 ` [PATCH 04/13] drm/i915/vrr: Reuse vrr_vblank_start() in more places Ville Syrjala
2026-10-23 16:57 ` [PATCH 05/13] drm/i915/vrr: Add a local 'adjusted_mode' variable to intel_vrr_get_config() Ville Syrjala
2026-10-23 16:57 ` [PATCH 06/13] drm/i915/vrr: Use the local 'adjusted_mode' intel_vrr_compute_config() Ville Syrjala
2026-10-23 16:57 ` [PATCH 07/13] drm/i915/vrr: Annotate live functions Ville Syrjala
2026-10-23 16:57 ` [PATCH 08/13] drm/i915/vrr: Shuffle code around Ville Syrjala
2026-10-23 16:57 ` [PATCH 09/13] drm/i915/vrr: Extract vrr_safe_window_end() Ville Syrjala
2026-10-23 16:58 ` [PATCH 10/13] drm/i915/vrr: Extract intel_vrr_vmin_vblank_start_live() Ville Syrjala
2026-10-23 16:58 ` [PATCH 11/13] drm/i915/vrr: Introduce intel_vrr_vblank_start_live() and use it for MMIO vblank evasion Ville Syrjala
2026-10-23 16:58 ` [PATCH 12/13] drm/i915/vrr: Include VRR safe window in state dump Ville Syrjala
2026-10-23 16:58 ` [PATCH 13/13] drm/i915: Add more vertical timing diagrams Ville Syrjala
2026-10-23 17:05 ` ✗ CI.checkpatch: warning for drm/i915/vrr: Fixes and cleanups Patchwork
2026-10-23 17:08 ` ✓ CI.KUnit: success " Patchwork
2026-10-23 17:45 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-23 23:57 ` ✓ Xe.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=956f60a3c6194f7ab12f8cb44d413c0bb58ec541@intel.com \
    --to=jani.nikula@linux.intel.com \
    --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