diff mbox series

[01/14] drm/i915: Calculate vblank delay more accurately

Message ID 20240624191032.27333-2-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/dsb: Use chained DSBs for LUT programming | expand

Commit Message

Ville Syrjälä June 24, 2024, 7:10 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Calculate the vblank delay in the vblank evasion code correctly
for interlaced modes.

The current code assumes that we won't be using an interlaced mode.
That assumption is actually valid since we've defeatured interlaced
scanout in commit f71c9b7bc35f ("drm/i915/display: Prune Interlace
modes for Display >=12") for DSB capable platforms. However the
feature is still present in the hardware, and if we ever find the
need to re-enable it seems better to calculate the vblank delay
correctly.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_vblank.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Manna, Animesh June 28, 2024, 8:16 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: Tuesday, June 25, 2024 12:40 AM
> To: intel-gfx@lists.freedesktop.org
> Subject: [PATCH 01/14] drm/i915: Calculate vblank delay more accurately
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Calculate the vblank delay in the vblank evasion code correctly for interlaced
> modes.
> 
> The current code assumes that we won't be using an interlaced mode.
> That assumption is actually valid since we've defeatured interlaced scanout
> in commit f71c9b7bc35f ("drm/i915/display: Prune Interlace modes for
> Display >=12") for DSB capable platforms. However the feature is still present
> in the hardware, and if we ever find the need to re-enable it seems better to
> calculate the vblank delay correctly.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

LGTM.
Reviewed-by: Animesh Manna <animesh.manna@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_vblank.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c
> b/drivers/gpu/drm/i915/display/intel_vblank.c
> index 5b065e1cd4e4..f183e0d4b2ba 100644
> --- a/drivers/gpu/drm/i915/display/intel_vblank.c
> +++ b/drivers/gpu/drm/i915/display/intel_vblank.c
> @@ -652,7 +652,8 @@ 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 -= adjusted_mode->crtc_vblank_start -
> adjusted_mode->crtc_vdisplay;
> +		evade->min -= intel_mode_vblank_start(adjusted_mode) -
> +			intel_mode_vdisplay(adjusted_mode);
>  }
> 
>  /* must be called with vblank interrupt already enabled! */
> --
> 2.44.2
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
index 5b065e1cd4e4..f183e0d4b2ba 100644
--- a/drivers/gpu/drm/i915/display/intel_vblank.c
+++ b/drivers/gpu/drm/i915/display/intel_vblank.c
@@ -652,7 +652,8 @@  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 -= adjusted_mode->crtc_vblank_start - adjusted_mode->crtc_vdisplay;
+		evade->min -= intel_mode_vblank_start(adjusted_mode) -
+			intel_mode_vdisplay(adjusted_mode);
 }
 
 /* must be called with vblank interrupt already enabled! */