[02/10] drm/i915: Add intel_crtc_vblank_off()
diff mbox series

Message ID 20191112141503.1116-3-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • drm/i915: Cleanups around .crtc_enable/disable()
Related show

Commit Message

Ville Syrjälä Nov. 12, 2019, 2:14 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

We already have intel_crtc_vblank_on(). Add a counterpart so we
don't have to inline the disable+assert all over.

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

Comments

Manasi Navare Nov. 13, 2019, 11:50 p.m. UTC | #1
On Tue, Nov 12, 2019 at 04:14:55PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> We already have intel_crtc_vblank_on(). Add a counterpart so we
> don't have to inline the disable+assert all over.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

LGTM,

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>

Manasi

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index da01fa6928a2..194029ff8617 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -1831,6 +1831,12 @@ static void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state)
>  	drm_crtc_vblank_on(&crtc->base);
>  }
>  
> +static void intel_crtc_vblank_off(struct intel_crtc *crtc)
> +{
> +	drm_crtc_vblank_off(&crtc->base);
> +	assert_vblank_disabled(&crtc->base);
> +}
> +
>  static void intel_enable_pipe(const struct intel_crtc_state *new_crtc_state)
>  {
>  	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
> @@ -6736,8 +6742,7 @@ static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,
>  
>  	intel_encoders_disable(state, intel_crtc);
>  
> -	drm_crtc_vblank_off(crtc);
> -	assert_vblank_disabled(crtc);
> +	intel_crtc_vblank_off(intel_crtc);
>  
>  	intel_disable_pipe(old_crtc_state);
>  
> @@ -6786,8 +6791,7 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
>  
>  	intel_encoders_disable(state, intel_crtc);
>  
> -	drm_crtc_vblank_off(crtc);
> -	assert_vblank_disabled(crtc);
> +	intel_crtc_vblank_off(intel_crtc);
>  
>  	/* XXX: Do the pipe assertions at the right place for BXT DSI. */
>  	if (!transcoder_is_dsi(cpu_transcoder))
> @@ -7163,8 +7167,7 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
>  
>  	intel_encoders_disable(state, intel_crtc);
>  
> -	drm_crtc_vblank_off(crtc);
> -	assert_vblank_disabled(crtc);
> +	intel_crtc_vblank_off(intel_crtc);
>  
>  	intel_disable_pipe(old_crtc_state);
>  
> -- 
> 2.23.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index da01fa6928a2..194029ff8617 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1831,6 +1831,12 @@  static void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state)
 	drm_crtc_vblank_on(&crtc->base);
 }
 
+static void intel_crtc_vblank_off(struct intel_crtc *crtc)
+{
+	drm_crtc_vblank_off(&crtc->base);
+	assert_vblank_disabled(&crtc->base);
+}
+
 static void intel_enable_pipe(const struct intel_crtc_state *new_crtc_state)
 {
 	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
@@ -6736,8 +6742,7 @@  static void ironlake_crtc_disable(struct intel_crtc_state *old_crtc_state,
 
 	intel_encoders_disable(state, intel_crtc);
 
-	drm_crtc_vblank_off(crtc);
-	assert_vblank_disabled(crtc);
+	intel_crtc_vblank_off(intel_crtc);
 
 	intel_disable_pipe(old_crtc_state);
 
@@ -6786,8 +6791,7 @@  static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
 
 	intel_encoders_disable(state, intel_crtc);
 
-	drm_crtc_vblank_off(crtc);
-	assert_vblank_disabled(crtc);
+	intel_crtc_vblank_off(intel_crtc);
 
 	/* XXX: Do the pipe assertions at the right place for BXT DSI. */
 	if (!transcoder_is_dsi(cpu_transcoder))
@@ -7163,8 +7167,7 @@  static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
 
 	intel_encoders_disable(state, intel_crtc);
 
-	drm_crtc_vblank_off(crtc);
-	assert_vblank_disabled(crtc);
+	intel_crtc_vblank_off(intel_crtc);
 
 	intel_disable_pipe(old_crtc_state);