public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 15/17] drm/i915: Steal power sequencer in vlv_power_sequencer_pipe()
Date: Tue, 28 Oct 2014 09:30:37 +0100	[thread overview]
Message-ID: <20141028083037.GE26941@phenom.ffwll.local> (raw)
In-Reply-To: <1413484199-21289-1-git-send-email-ville.syrjala@linux.intel.com>

On Thu, Oct 16, 2014 at 09:29:59PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> In case we fumble something and end up picking an already used power
> seqeuencer in vlv_power_sequencer_pipe() at least try to steal it
> gracefully. In theory this should never happen though.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Just an aside: I'm not terribly in favour of code "just in case" - it
tends to bitrot even faster than the code we actually use. But this
doesn't look too onerous, so I've merged it.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_dp.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 74a6514..b58c94f 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -114,6 +114,8 @@ static void intel_dp_link_down(struct intel_dp *intel_dp);
>  static bool edp_panel_vdd_on(struct intel_dp *intel_dp);
>  static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync);
>  static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp);
> +static void vlv_steal_power_sequencer(struct drm_device *dev,
> +				      enum pipe pipe);
>  
>  int
>  intel_dp_max_link_bw(struct intel_dp *intel_dp)
> @@ -412,9 +414,13 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_encoder *encoder;
>  	unsigned int pipes = (1 << PIPE_A) | (1 << PIPE_B);
> +	enum pipe pipe;
>  
>  	lockdep_assert_held(&dev_priv->pps_mutex);
>  
> +	/* We should never land here with regular DP ports */
> +	WARN_ON(!is_edp(intel_dp));
> +
>  	if (intel_dp->pps_pipe != INVALID_PIPE)
>  		return intel_dp->pps_pipe;
>  
> @@ -440,9 +446,12 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
>  	 * are two power sequencers and up to two eDP ports.
>  	 */
>  	if (WARN_ON(pipes == 0))
> -		return PIPE_A;
> +		pipe = PIPE_A;
> +	else
> +		pipe = ffs(pipes) - 1;
>  
> -	intel_dp->pps_pipe = ffs(pipes) - 1;
> +	vlv_steal_power_sequencer(dev, pipe);
> +	intel_dp->pps_pipe = pipe;
>  
>  	DRM_DEBUG_KMS("picked pipe %c power sequencer for port %c\n",
>  		      pipe_name(intel_dp->pps_pipe),
> -- 
> 2.0.4
> 
> _______________________________________________
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-10-28  8:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 18:27 [PATCH 00/17] drm/i915: Fix vlv/chv panel power sequencer ville.syrjala
2014-10-16 18:27 ` [PATCH 01/17] drm/i915: Warn if trying to register eDP on port != B/C on vlv/chv ville.syrjala
2014-10-17  9:47   ` Jani Nikula
2014-10-17 11:28     ` Ville Syrjälä
2014-10-17 17:26     ` Mika Kuoppala
2014-10-21 15:42       ` Daniel Vetter
2014-10-16 18:27 ` [PATCH 02/17] drm/i915: Warn if stealing power sequencer from an active eDP port ville.syrjala
2014-10-28  8:10   ` Daniel Vetter
2014-10-28  8:14     ` Ville Syrjälä
2014-10-28  8:34       ` Daniel Vetter
2014-10-28  9:07         ` Ville Syrjälä
2014-10-28 10:30           ` Daniel Vetter
2014-10-16 18:27 ` [PATCH 03/17] drm/i915: Remove high level intel_edp_vdd_{on, off}() from hpd/detect ville.syrjala
2014-10-16 18:27 ` [PATCH 04/17] drm/i915: Store power sequencer delays in intel_dp ville.syrjala
2014-10-16 18:27 ` [PATCH 05/17] drm/i915: Don't initialize power seqeuencer delays more than once ville.syrjala
2014-10-27 14:43   ` Imre Deak
2014-10-27 14:55     ` Ville Syrjälä
2014-10-28  8:12       ` Daniel Vetter
2014-10-16 18:27 ` [PATCH 06/17] drm/i915: Split power sequencer panel on/off functions to locked and unlocked variants ville.syrjala
2014-10-16 18:27 ` [PATCH 07/17] drm/i915: Hold the pps mutex across the whole panel power enable sequence ville.syrjala
2014-10-16 18:27 ` [PATCH 08/17] drm/i915: Wait for PHY port ready before link training on VLV/CHV ville.syrjala
2014-10-22 15:10   ` Todd Previte
2014-10-28  8:15     ` Daniel Vetter
2014-11-04 21:58       ` Todd Previte
2014-10-16 18:27 ` [PATCH 09/17] drm/i915: Fix eDP link training when switching pipes " ville.syrjala
2014-10-16 18:29 ` [PATCH 10/17] drm/i915: Kick the power sequencer before AUX transactions ville.syrjala
2014-10-16 18:29 ` [PATCH 11/17] drm/i915: Make sure DPLL is enabled when kicking the power sequencer on VLV/CHV ville.syrjala
2014-10-28  8:22   ` Daniel Vetter
2014-10-28  8:27     ` Ville Syrjälä
2014-10-28  8:55   ` [PATCH v2 " ville.syrjala
2014-10-28 11:20     ` [PATCH v3 " ville.syrjala
2014-10-16 18:29 ` [PATCH 12/17] drm/i915: Don't kick the power seqeuncer just to check if we have vdd/panel power ville.syrjala
2014-10-27 17:10   ` Imre Deak
2014-10-28  8:03     ` Ville Syrjälä
2014-10-28  8:07       ` Daniel Vetter
2014-10-28  8:26       ` Daniel Vetter
2014-10-16 18:29 ` [PATCH 13/17] drm/i915: Clear PPS port select when giving up the power sequencer ville.syrjala
2014-10-16 18:29 ` [PATCH 14/17] drm/i915: Warn if stealing non pipe A/B " ville.syrjala
2014-10-16 18:29 ` [PATCH 15/17] drm/i915: Steal power sequencer in vlv_power_sequencer_pipe() ville.syrjala
2014-10-28  8:30   ` Daniel Vetter [this message]
2014-10-16 18:30 ` [PATCH 16/17] drm/i915: Improve VDD/PPS debugs ville.syrjala
2014-10-16 18:30 ` [PATCH 17/17] drm/i915: Warn if panel power is already on when enabling it ville.syrjala
2014-10-27 17:56 ` [PATCH 00/17] drm/i915: Fix vlv/chv panel power sequencer Imre Deak
2014-10-28  8:32   ` Daniel Vetter

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=20141028083037.GE26941@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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