diff mbox series

[2/9] drm/i915: Reorder drm_vblank_put() vs. need_vlv_dsi_wa

Message ID 20231213102519.13500-3-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Cursor vblank evasion | expand

Commit Message

Ville Syrjälä Dec. 13, 2023, 10:25 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Drop the vblank reference only after we've done the hideous
need_vlv_dsi_wa stuff. This will make it easier to reuse the
the vblank evasion machinery elsewhere.

Keeping the vblank reference for a bit longer is not a
problem. In fact we might want to not drop it at all until
intel_pipe_update_end(), but we'll leave that idea for later.

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

Comments

Shankar, Uma Dec. 20, 2023, 11:20 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: Wednesday, December 13, 2023 3:55 PM
> To: intel-gfx@lists.freedesktop.org
> Subject: [PATCH 2/9] drm/i915: Reorder drm_vblank_put() vs. need_vlv_dsi_wa
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Drop the vblank reference only after we've done the hideous need_vlv_dsi_wa
> stuff. This will make it easier to reuse the the vblank evasion machinery
> elsewhere.
> 
> Keeping the vblank reference for a bit longer is not a problem. In fact we might
> want to not drop it at all until intel_pipe_update_end(), but we'll leave that idea
> for later.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_crtc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c
> b/drivers/gpu/drm/i915/display/intel_crtc.c
> index d5c3f6078e42..4df8927bb062 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -614,8 +614,6 @@ void intel_pipe_update_start(struct intel_atomic_state
> *state,
> 
>  	finish_wait(wq, &wait);
> 
> -	drm_crtc_vblank_put(&crtc->base);
> -
>  	/*
>  	 * On VLV/CHV DSI the scanline counter would appear to
>  	 * increment approx. 1/3 of a scanline before start of vblank.
> @@ -634,6 +632,8 @@ void intel_pipe_update_start(struct intel_atomic_state
> *state,
>  	while (need_vlv_dsi_wa && scanline == vblank_start)
>  		scanline = intel_get_crtc_scanline(crtc);
> 
> +	drm_crtc_vblank_put(&crtc->base);
> +
>  	crtc->debug.scanline_start = scanline;
>  	crtc->debug.start_vbl_time = ktime_get();
>  	crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);
> --
> 2.41.0
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
index d5c3f6078e42..4df8927bb062 100644
--- a/drivers/gpu/drm/i915/display/intel_crtc.c
+++ b/drivers/gpu/drm/i915/display/intel_crtc.c
@@ -614,8 +614,6 @@  void intel_pipe_update_start(struct intel_atomic_state *state,
 
 	finish_wait(wq, &wait);
 
-	drm_crtc_vblank_put(&crtc->base);
-
 	/*
 	 * On VLV/CHV DSI the scanline counter would appear to
 	 * increment approx. 1/3 of a scanline before start of vblank.
@@ -634,6 +632,8 @@  void intel_pipe_update_start(struct intel_atomic_state *state,
 	while (need_vlv_dsi_wa && scanline == vblank_start)
 		scanline = intel_get_crtc_scanline(crtc);
 
+	drm_crtc_vblank_put(&crtc->base);
+
 	crtc->debug.scanline_start = scanline;
 	crtc->debug.start_vbl_time = ktime_get();
 	crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);