All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Egbert Eich <eich@suse.de>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/5] drm/i915: Try to avoid pps_{lock, unlock}() on DP ports
Date: Mon, 24 Nov 2014 20:28:10 +0200	[thread overview]
Message-ID: <874mto3139.fsf@intel.com> (raw)
In-Reply-To: <1416849387-20984-2-git-send-email-eich@suse.de>

On Mon, 24 Nov 2014, Egbert Eich <eich@suse.de> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 48 ++++++++++++++++++++++++-----------------
>  1 file changed, 28 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 81f959d..a24c8cc7 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -807,17 +807,19 @@ intel_dp_aux_ch(struct intel_dp *intel_dp,
>  	uint32_t status;
>  	int try, clock = 0;
>  	bool has_aux_irq = HAS_AUX_IRQ(dev);
> -	bool vdd;
> +	bool vdd = false;
>  
> -	pps_lock(intel_dp);
> +	if (is_edp(intel_dp)) {
> +		pps_lock(intel_dp);

Why not add is_edp() into pps_lock()? The lockdep stuff in
edp_panel_vdd_on() could be moved after the is_edp() check.

BR,
Jani.

>  
> -	/*
> -	 * We will be called with VDD already enabled for dpcd/edid/oui reads.
> -	 * In such cases we want to leave VDD enabled and it's up to upper layers
> -	 * to turn it off. But for eg. i2c-dev access we need to turn it on/off
> -	 * ourselves.
> -	 */
> -	vdd = edp_panel_vdd_on(intel_dp);
> +		/*
> +		 * We will be called with VDD already enabled for dpcd/edid/oui reads.
> +		 * In such cases we want to leave VDD enabled and it's up to upper layers
> +		 * to turn it off. But for eg. i2c-dev access we need to turn it on/off
> +		 * ourselves.
> +		 */
> +		vdd = edp_panel_vdd_on(intel_dp);
> +	}
>  
>  	/* dp aux is extremely sensitive to irq latency, hence request the
>  	 * lowest possible wakeup latency and so prevent the cpu from going into
> @@ -924,10 +926,12 @@ out:
>  	pm_qos_update_request(&dev_priv->pm_qos, PM_QOS_DEFAULT_VALUE);
>  	intel_aux_display_runtime_put(dev_priv);
>  
> -	if (vdd)
> -		edp_panel_vdd_off(intel_dp, false);
> +	if (is_edp(intel_dp)) {
> +		if (vdd)
> +			edp_panel_vdd_off(intel_dp, false);
>  
> -	pps_unlock(intel_dp);
> +		pps_unlock(intel_dp);
> +	}
>  
>  	return ret;
>  }
> @@ -2291,18 +2295,22 @@ static void intel_enable_dp(struct intel_encoder *encoder)
>  	if (WARN_ON(dp_reg & DP_PORT_EN))
>  		return;
>  
> -	pps_lock(intel_dp);
> +	if (is_edp(intel_dp)) {
> +		pps_lock(intel_dp);
>  
> -	if (IS_VALLEYVIEW(dev))
> -		vlv_init_panel_power_sequencer(intel_dp);
> +		if (IS_VALLEYVIEW(dev))
> +			vlv_init_panel_power_sequencer(intel_dp);
>  
> -	intel_dp_enable_port(intel_dp);
> +		intel_dp_enable_port(intel_dp);
>  
> -	edp_panel_vdd_on(intel_dp);
> -	edp_panel_on(intel_dp);
> -	edp_panel_vdd_off(intel_dp, true);
> +		edp_panel_vdd_on(intel_dp);
> +		edp_panel_on(intel_dp);
> +		edp_panel_vdd_off(intel_dp, true);
>  
> -	pps_unlock(intel_dp);
> +		pps_unlock(intel_dp);
> +	} else {
> +		intel_dp_enable_port(intel_dp);
> +	}
>  
>  	if (IS_VALLEYVIEW(dev))
>  		vlv_wait_port_ready(dev_priv, dp_to_dig_port(intel_dp));
> -- 
> 1.8.4.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-11-24 18:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 17:16 [PATCH 0/5] drm/i915 Avoid long delays when reading EDID on eDP Egbert Eich
2014-11-24 17:16 ` [PATCH 1/5] drm/i915: Try to avoid pps_{lock, unlock}() on DP ports Egbert Eich
2014-11-24 18:28   ` Jani Nikula [this message]
2014-11-24 17:16 ` [PATCH 2/5] drm/DP: Create pointer to generic DPCD access function Egbert Eich
2014-11-24 17:16 ` [PATCH 3/5] drm/DP: Export drm_dp_i2c_xfer() DP helper function Egbert Eich
2014-11-24 17:16 ` [PATCH 4/5] drm/DP: Export drm_dp_dpcd_access() " Egbert Eich
2014-11-24 17:16 ` [PATCH 5/5] drm/i915/eDP: Move pps_lock() and edp_panel_vdd_on() to top Egbert Eich
2014-11-25  9:08 ` [PATCH 0/5] drm/i915 Avoid long delays when reading EDID on eDP Jani Nikula
2014-11-25 13:13 ` Daniel Vetter
2014-11-25 17:20   ` Egbert Eich
2014-11-26  8:57     ` 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=874mto3139.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=eich@suse.de \
    --cc=intel-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.