public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 5/5] drm/i915/vlv: add valleyview_crtc_disable function
Date: Fri, 27 Sep 2013 22:05:58 +0200	[thread overview]
Message-ID: <20130927200557.GI26592@phenom.ffwll.local> (raw)
In-Reply-To: <1380311846-1581-5-git-send-email-jbarnes@virtuousgeek.org>

On Fri, Sep 27, 2013 at 12:57:26PM -0700, Jesse Barnes wrote:
> To handle disabling DP after the CPU pipe is disabled, per the
> workaround.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=58152
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

This also applies to g4x apparently and really encoder type checks in the
crtc code is just evil. Furthermore it seems to be already implemented, at
least that's my impression from reading intel_dp.c.
-Daniel


> ---
>  drivers/gpu/drm/i915/intel_display.c | 58 ++++++++++++++++++++++++++++++++----
>  1 file changed, 53 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 2c040cd..9a7136c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3873,6 +3873,57 @@ static void i9xx_pfit_disable(struct intel_crtc *crtc)
>  	I915_WRITE(PFIT_CONTROL, 0);
>  }
>  
> +static void valleyview_crtc_disable(struct drm_crtc *crtc)
> +{
> +	struct drm_device *dev = crtc->dev;
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> +	struct intel_encoder *encoder;
> +	int pipe = intel_crtc->pipe;
> +	int plane = intel_crtc->plane;
> +
> +	if (!intel_crtc->active)
> +		return;
> +
> +	for_each_encoder_on_crtc(dev, crtc, encoder)
> +		if (!(encoder->type == INTEL_OUTPUT_DISPLAYPORT ||
> +		      encoder->type == INTEL_OUTPUT_EDP))
> +			encoder->disable(encoder);
> +
> +	/* Give the overlay scaler a chance to disable if it's on this pipe */
> +	intel_crtc_wait_for_pending_flips(crtc);
> +	drm_vblank_off(dev, pipe);
> +
> +	if (dev_priv->fbc.plane == plane)
> +		intel_disable_fbc(dev);
> +
> +	intel_crtc_dpms_overlay(intel_crtc, false);
> +	intel_crtc_update_cursor(crtc, false);
> +	intel_disable_planes(crtc);
> +	intel_disable_plane(dev_priv, plane, pipe);
> +
> +	intel_disable_pipe(dev_priv, pipe);
> +
> +	for_each_encoder_on_crtc(dev, crtc, encoder)
> +		if (encoder->type == INTEL_OUTPUT_DISPLAYPORT ||
> +		    encoder->type == INTEL_OUTPUT_EDP)
> +			encoder->disable(encoder);
> +
> +	i9xx_pfit_disable(intel_crtc);
> +
> +	for_each_encoder_on_crtc(dev, crtc, encoder)
> +		if (encoder->post_disable)
> +			encoder->post_disable(encoder);
> +
> +	if (!intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI))
> +		vlv_disable_pll(dev_priv, pipe);
> +
> +	intel_crtc->active = false;
> +	intel_update_watermarks(crtc);
> +
> +	intel_update_fbc(dev);
> +}
> +
>  static void i9xx_crtc_disable(struct drm_crtc *crtc)
>  {
>  	struct drm_device *dev = crtc->dev;
> @@ -3908,10 +3959,7 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
>  		if (encoder->post_disable)
>  			encoder->post_disable(encoder);
>  
> -	if (IS_VALLEYVIEW(dev) && !intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI))
> -		vlv_disable_pll(dev_priv, pipe);
> -	else if (!IS_VALLEYVIEW(dev))
> -		i9xx_disable_pll(dev_priv, pipe);
> +	i9xx_disable_pll(dev_priv, pipe);
>  
>  	intel_crtc->active = false;
>  	intel_update_watermarks(crtc);
> @@ -10048,7 +10096,7 @@ static void intel_init_display(struct drm_device *dev)
>  		dev_priv->display.get_pipe_config = i9xx_get_pipe_config;
>  		dev_priv->display.crtc_mode_set = i9xx_crtc_mode_set;
>  		dev_priv->display.crtc_enable = valleyview_crtc_enable;
> -		dev_priv->display.crtc_disable = i9xx_crtc_disable;
> +		dev_priv->display.crtc_disable = valleyview_crtc_disable;
>  		dev_priv->display.off = i9xx_crtc_off;
>  		dev_priv->display.update_plane = i9xx_update_plane;
>  	} else {
> -- 
> 1.8.3.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

      reply	other threads:[~2013-09-27 20:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 19:57 [PATCH 1/5] drm/i915/vlv: reduce GT FIFO error info to a debug message Jesse Barnes
2013-09-27 19:57 ` [PATCH 2/5] drm/i915: use wait_event_timeout when waiting for flip completions Jesse Barnes
2013-09-27 20:45   ` Chris Wilson
2013-09-27 21:27     ` Jesse Barnes
2013-09-28  9:35   ` Daniel Vetter
2013-09-28 14:58     ` Jesse Barnes
2013-09-27 19:57 ` [PATCH 3/5] drm/i915/vlv: warn on bad VLV PLL divider values Jesse Barnes
2013-09-27 20:05   ` Chris Wilson
2013-09-27 20:11     ` Daniel Vetter
2013-09-27 20:17       ` Jesse Barnes
2013-09-27 19:57 ` [PATCH 4/5] drm/i915/vlv: untangle integrated clock source handling v2 Jesse Barnes
2013-09-27 19:57 ` [PATCH 5/5] drm/i915/vlv: add valleyview_crtc_disable function Jesse Barnes
2013-09-27 20:05   ` Daniel Vetter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130927200557.GI26592@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox