Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 12/18] drm/i915/vrr: Introduce intel_vrr_vblank_delay()
Date: Fri, 3 Jan 2025 17:18:03 +0530	[thread overview]
Message-ID: <8fa7f9af-a592-4654-ab65-6440315499f7@intel.com> (raw)
In-Reply-To: <20241210211007.5976-13-ville.syrjala@linux.intel.com>


On 12/11/2024 2:40 AM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Introduce a VRR specific function for determining the current
> vblank delay. Currently thus will give the same answer as
> intel_mode_vblank_delay() but that will change later.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>


> ---
>   drivers/gpu/drm/i915/display/intel_dsb.c    | 18 ++++++++++++++----
>   drivers/gpu/drm/i915/display/intel_vblank.c |  7 ++++++-
>   drivers/gpu/drm/i915/display/intel_vrr.c    |  6 ++++++
>   drivers/gpu/drm/i915/display/intel_vrr.h    |  1 +
>   4 files changed, 27 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
> index 673f75703785..89d3496bcbdb 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> @@ -109,9 +109,16 @@ static bool pre_commit_is_vrr_active(struct intel_atomic_state *state,
>   	return old_crtc_state->vrr.enable && !intel_crtc_vrr_disabling(state, crtc);
>   }
>   
> -static int dsb_vblank_delay(const struct intel_crtc_state *crtc_state)
> +static int dsb_vblank_delay(struct intel_atomic_state *state,
> +			    struct intel_crtc *crtc)
>   {
> -	return intel_mode_vblank_delay(&crtc_state->hw.adjusted_mode);
> +	const struct intel_crtc_state *crtc_state =
> +		intel_pre_commit_crtc_state(state, crtc);
> +
> +	if (pre_commit_is_vrr_active(state, crtc))
> +		return intel_vrr_vblank_delay(crtc_state);
> +	else
> +		return intel_mode_vblank_delay(&crtc_state->hw.adjusted_mode);
>   }
>   
>   static int dsb_vtotal(struct intel_atomic_state *state,
> @@ -520,10 +527,11 @@ void intel_dsb_vblank_evade(struct intel_atomic_state *state,
>   		intel_pre_commit_crtc_state(state, crtc);
>   	/* FIXME calibrate sensibly */
>   	int latency = intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode, 20);
> -	int vblank_delay = dsb_vblank_delay(crtc_state);
>   	int start, end;
>   
>   	if (pre_commit_is_vrr_active(state, crtc)) {
> +		int vblank_delay = intel_vrr_vblank_delay(crtc_state);
> +
>   		end = intel_vrr_vmin_vblank_start(crtc_state);
>   		start = end - vblank_delay - latency;
>   		intel_dsb_wait_scanline_out(state, dsb, start, end);
> @@ -532,6 +540,8 @@ void intel_dsb_vblank_evade(struct intel_atomic_state *state,
>   		start = end - vblank_delay - latency;
>   		intel_dsb_wait_scanline_out(state, dsb, start, end);
>   	} else {
> +		int vblank_delay = intel_mode_vblank_delay(&crtc_state->hw.adjusted_mode);
> +
>   		end = intel_mode_vblank_start(&crtc_state->hw.adjusted_mode);
>   		start = end - vblank_delay - latency;
>   		intel_dsb_wait_scanline_out(state, dsb, start, end);
> @@ -612,7 +622,7 @@ void intel_dsb_wait_vblank_delay(struct intel_atomic_state *state,
>   	const struct intel_crtc_state *crtc_state =
>   		intel_pre_commit_crtc_state(state, crtc);
>   	int usecs = intel_scanlines_to_usecs(&crtc_state->hw.adjusted_mode,
> -					     dsb_vblank_delay(crtc_state)) + 1;
> +					     dsb_vblank_delay(state, crtc)) + 1;
>   
>   	intel_dsb_wait_usec(dsb, usecs);
>   }
> diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
> index 2a99bde457db..fb80e0bef08a 100644
> --- a/drivers/gpu/drm/i915/display/intel_vblank.c
> +++ b/drivers/gpu/drm/i915/display/intel_vblank.c
> @@ -647,6 +647,7 @@ void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
>   	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
>   	const struct intel_crtc_state *crtc_state;
>   	const struct drm_display_mode *adjusted_mode;
> +	int vblank_delay;
>   
>   	evade->crtc = crtc;
>   
> @@ -668,8 +669,12 @@ void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
>   			evade->vblank_start = intel_vrr_vmin_vblank_start(crtc_state);
>   		else
>   			evade->vblank_start = intel_vrr_vmax_vblank_start(crtc_state);
> +
> +		vblank_delay = intel_vrr_vblank_delay(crtc_state);
>   	} else {
>   		evade->vblank_start = intel_mode_vblank_start(adjusted_mode);
> +
> +		vblank_delay = intel_mode_vblank_delay(adjusted_mode);
>   	}
>   
>   	/* FIXME needs to be calibrated sensibly */
> @@ -687,7 +692,7 @@ void intel_vblank_evade_init(const struct intel_crtc_state *old_crtc_state,
>   	 */
>   	if (intel_color_uses_dsb(new_crtc_state) ||
>   	    new_crtc_state->update_m_n || new_crtc_state->update_lrr)
> -		evade->min -= intel_mode_vblank_delay(adjusted_mode);
> +		evade->min -= vblank_delay;
>   }
>   
>   /* must be called with vblank interrupt already enabled! */
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 0d40402fe043..a0ddc288c1a3 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -76,6 +76,12 @@ intel_vrr_check_modeset(struct intel_atomic_state *state)
>   	}
>   }
>   
> +int intel_vrr_vblank_delay(const struct intel_crtc_state *crtc_state)
> +{
> +	return crtc_state->hw.adjusted_mode.crtc_vblank_start -
> +		crtc_state->hw.adjusted_mode.crtc_vdisplay;
> +}
> +
>   /*
>    * Without VRR registers get latched at:
>    *  vblank_start
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.h b/drivers/gpu/drm/i915/display/intel_vrr.h
> index 75db88ae9cc4..8e8961adce39 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.h
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.h
> @@ -30,5 +30,6 @@ int intel_vrr_vmax_vtotal(const struct intel_crtc_state *crtc_state);
>   int intel_vrr_vmin_vtotal(const struct intel_crtc_state *crtc_state);
>   int intel_vrr_vmax_vblank_start(const struct intel_crtc_state *crtc_state);
>   int intel_vrr_vmin_vblank_start(const struct intel_crtc_state *crtc_state);
> +int intel_vrr_vblank_delay(const struct intel_crtc_state *crtc_state);
>   
>   #endif /* __INTEL_VRR_H__ */

  reply	other threads:[~2025-01-03 11:48 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10 21:09 [PATCH 00/18] drm/i915: DSB+VRR Ville Syrjala
2024-12-10 21:09 ` [PATCH 01/18] drm/i915: Extract intel_crtc_vblank_delay() Ville Syrjala
2025-01-03 11:24   ` Nautiyal, Ankit K
2025-01-09 15:43     ` Ville Syrjälä
2025-01-10  5:09       ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 02/18] drm/i915: Check vblank delay validity Ville Syrjala
2025-01-03 11:26   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 03/18] drm/i915: Fix include order Ville Syrjala
2025-01-03 11:27   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 04/18] drm/i915: Introduce intel_vrr_{vmin,vmax}_vtotal() Ville Syrjala
2025-01-03 11:28   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 05/18] drm/i915: Move framestart/etc. state dump to a better spot Ville Syrjala
2025-01-03 11:29   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 06/18] drm/i915: Include the vblank delay in the state dump Ville Syrjala
2025-01-03 11:30   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 07/18] drm/i915/vrr: Improve VRR " Ville Syrjala
2025-01-03 11:31   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 08/18] drm/i915: Include the scanline offset in the " Ville Syrjala
2025-01-03 11:32   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 09/18] drm/i915: Extract intel_mode_vblank_delay() Ville Syrjala
2025-01-03 11:34   ` Nautiyal, Ankit K
2024-12-10 21:09 ` [PATCH 10/18] drm/i915: Consolidate intel_pre_commit_crtc_state() Ville Syrjala
2025-01-03 11:38   ` Nautiyal, Ankit K
2024-12-10 21:10 ` [PATCH 11/18] drm/i915: Extract intel_crtc_active_timings() Ville Syrjala
2025-01-03 11:42   ` Nautiyal, Ankit K
2024-12-10 21:10 ` [PATCH 12/18] drm/i915/vrr: Introduce intel_vrr_vblank_delay() Ville Syrjala
2025-01-03 11:48   ` Nautiyal, Ankit K [this message]
2024-12-10 21:10 ` [PATCH 13/18] drm/i915/vrr: Drop the extra vmin adjustment for ADL+ Ville Syrjala
2025-01-03 11:56   ` Nautiyal, Ankit K
2024-12-10 21:10 ` [PATCH 14/18] drm/i915/vrr: Fix vmin/vmax/flipline on TGL when using vblank delay Ville Syrjala
2025-01-03 12:03   ` Nautiyal, Ankit K
2024-12-10 21:10 ` [PATCH 15/18] drm/i915/vrr: Add extra vblank delay to estimates Ville Syrjala
2025-01-03 12:13   ` Nautiyal, Ankit K
2024-12-10 21:10 ` [PATCH 16/18] drm/i915/vrr: Plumb the DSB into intel_vrr_send_push() Ville Syrjala
2025-01-03 12:14   ` Nautiyal, Ankit K
2024-12-10 21:10 ` [PATCH 17/18] drm/i915/dsb: Add support for triggering VRR push with DSB Ville Syrjala
2025-01-03 12:17   ` Nautiyal, Ankit K
2024-12-10 21:10 ` [PATCH 18/18] drm/i915/dsb: Allow DSB to perform commits when VRR is enabled Ville Syrjala
2025-01-03 12:18   ` Nautiyal, Ankit K
2024-12-10 22:17 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: DSB+VRR Patchwork
2024-12-10 22:17 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-12-10 22:30 ` ✓ i915.CI.BAT: success " Patchwork
2024-12-10 23:49 ` ✗ i915.CI.Full: failure " Patchwork
2024-12-13 23:41 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: DSB+VRR (rev2) Patchwork
2024-12-13 23:41 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-12-13 23:55 ` ✗ i915.CI.BAT: failure " Patchwork
2025-01-13 16:48 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: DSB+VRR (rev3) Patchwork
2025-01-13 16:48 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-01-13 17:12 ` ✓ i915.CI.BAT: success " Patchwork
2025-01-15  4:05 ` ✗ i915.CI.Full: failure " Patchwork
2025-01-15 18:11 ` [PATCH 00/18] drm/i915: DSB+VRR Ville Syrjälä

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=8fa7f9af-a592-4654-ab65-6440315499f7@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@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