[03/10] drm/i915: Move assert_vblank_disabled() into intel_crtc_vblank_on()
diff mbox series

Message ID 20191112141503.1116-4-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>

Move the assert_vblank_disabled() into intel_crtc_vblank_on()
so that we don't have to inline it all over.

This does mean we now assert_vblank_disabled() during readout as well
but that is totally fine as it happens after drm_crtc_vblank_reset().
One can even argue it's what we want to do anyway to make sure
the reset actually happened.

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

Comments

Manasi Navare Nov. 14, 2019, 12:05 a.m. UTC | #1
On Tue, Nov 12, 2019 at 04:14:56PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Move the assert_vblank_disabled() into intel_crtc_vblank_on()
> so that we don't have to inline it all over.
> 
> This does mean we now assert_vblank_disabled() during readout as well
> but that is totally fine as it happens after drm_crtc_vblank_reset().
> One can even argue it's what we want to do anyway to make sure
> the reset actually happened.

Yes this makes total sense to me and double checking with the code
it looks fine to have it during the readout after drm_crtc_vblank_reset()
hence,

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

Manasi

> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 194029ff8617..89d150b45520 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -1826,6 +1826,7 @@ static void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
>  
> +	assert_vblank_disabled(&crtc->base);
>  	drm_crtc_set_max_vblank_count(&crtc->base,
>  				      intel_crtc_max_vblank_count(crtc_state));
>  	drm_crtc_vblank_on(&crtc->base);
> @@ -6535,7 +6536,6 @@ static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,
>  	if (pipe_config->has_pch_encoder)
>  		ironlake_pch_enable(state, pipe_config);
>  
> -	assert_vblank_disabled(crtc);
>  	intel_crtc_vblank_on(pipe_config);
>  
>  	intel_encoders_enable(state, intel_crtc);
> @@ -6689,7 +6689,6 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
>  	if (intel_crtc_has_type(pipe_config, INTEL_OUTPUT_DP_MST))
>  		intel_ddi_set_vc_payload_alloc(pipe_config, true);
>  
> -	assert_vblank_disabled(crtc);
>  	intel_crtc_vblank_on(pipe_config);
>  
>  	intel_encoders_enable(state, intel_crtc);
> @@ -7068,7 +7067,6 @@ static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,
>  	dev_priv->display.initial_watermarks(state, pipe_config);
>  	intel_enable_pipe(pipe_config);
>  
> -	assert_vblank_disabled(crtc);
>  	intel_crtc_vblank_on(pipe_config);
>  
>  	intel_encoders_enable(state, intel_crtc);
> @@ -7128,7 +7126,6 @@ static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,
>  		intel_update_watermarks(intel_crtc);
>  	intel_enable_pipe(pipe_config);
>  
> -	assert_vblank_disabled(crtc);
>  	intel_crtc_vblank_on(pipe_config);
>  
>  	intel_encoders_enable(state, intel_crtc);
> -- 
> 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 194029ff8617..89d150b45520 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -1826,6 +1826,7 @@  static void intel_crtc_vblank_on(const struct intel_crtc_state *crtc_state)
 {
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 
+	assert_vblank_disabled(&crtc->base);
 	drm_crtc_set_max_vblank_count(&crtc->base,
 				      intel_crtc_max_vblank_count(crtc_state));
 	drm_crtc_vblank_on(&crtc->base);
@@ -6535,7 +6536,6 @@  static void ironlake_crtc_enable(struct intel_crtc_state *pipe_config,
 	if (pipe_config->has_pch_encoder)
 		ironlake_pch_enable(state, pipe_config);
 
-	assert_vblank_disabled(crtc);
 	intel_crtc_vblank_on(pipe_config);
 
 	intel_encoders_enable(state, intel_crtc);
@@ -6689,7 +6689,6 @@  static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
 	if (intel_crtc_has_type(pipe_config, INTEL_OUTPUT_DP_MST))
 		intel_ddi_set_vc_payload_alloc(pipe_config, true);
 
-	assert_vblank_disabled(crtc);
 	intel_crtc_vblank_on(pipe_config);
 
 	intel_encoders_enable(state, intel_crtc);
@@ -7068,7 +7067,6 @@  static void valleyview_crtc_enable(struct intel_crtc_state *pipe_config,
 	dev_priv->display.initial_watermarks(state, pipe_config);
 	intel_enable_pipe(pipe_config);
 
-	assert_vblank_disabled(crtc);
 	intel_crtc_vblank_on(pipe_config);
 
 	intel_encoders_enable(state, intel_crtc);
@@ -7128,7 +7126,6 @@  static void i9xx_crtc_enable(struct intel_crtc_state *pipe_config,
 		intel_update_watermarks(intel_crtc);
 	intel_enable_pipe(pipe_config);
 
-	assert_vblank_disabled(crtc);
 	intel_crtc_vblank_on(pipe_config);
 
 	intel_encoders_enable(state, intel_crtc);