[Intel-gfx] [RFC PATCH 2/4] drm/i915: push DDI CRT underrun reporting on disable to encoder

Daniel Vetter daniel at ffwll.ch
Tue Jul 18 08:00:29 UTC 2017


On Wed, Jul 12, 2017 at 05:08:51PM +0300, Jani Nikula wrote:
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_crt.c     | 14 ++++++++++++++
>  drivers/gpu/drm/i915/intel_display.c |  8 --------
>  2 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 82bd149889ee..c5e5fda91412 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -204,6 +204,16 @@ static void pch_disable_crt(struct intel_encoder *encoder,
>  			    struct intel_crtc_state *old_crtc_state,
>  			    struct drm_connector_state *old_conn_state)
>  {
> +	struct drm_crtc *crtc = old_crtc_state->base.crtc;
> +	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +
> +	if (HAS_DDI(dev_priv)) {
> +		WARN_ON(!intel_crtc->config->has_pch_encoder);
> +
> +		intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
> +						      false);
> +	}
>  }

Same comments about just going with hsw_ variants for these, especially
when the pch one is empty (nuke that one maybe?). With that:

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

>  
>  static void pch_post_disable_crt(struct intel_encoder *encoder,
> @@ -225,6 +235,10 @@ static void hsw_post_disable_crt(struct intel_encoder *encoder,
>  	lpt_disable_iclkip(dev_priv);
>  
>  	intel_ddi_fdi_post_disable(encoder, old_crtc_state, old_conn_state);
> +
> +	WARN_ON(!old_crtc_state->has_pch_encoder);
> +
> +	intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, true);
>  }
>  
>  static void hsw_pre_pll_enable_crt(struct intel_encoder *encoder,
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 02448a86edeb..ec6391bdd308 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -5516,10 +5516,6 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
>  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  	enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder;
>  
> -	if (intel_crtc->config->has_pch_encoder)
> -		intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
> -						      false);
> -
>  	intel_encoders_disable(crtc, old_crtc_state, old_state);
>  
>  	drm_crtc_vblank_off(crtc);
> @@ -5544,10 +5540,6 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
>  		intel_ddi_disable_pipe_clock(intel_crtc->config);
>  
>  	intel_encoders_post_disable(crtc, old_crtc_state, old_state);
> -
> -	if (old_crtc_state->has_pch_encoder)
> -		intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A,
> -						      true);
>  }
>  
>  static void i9xx_pfit_enable(struct intel_crtc *crtc)
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list