stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lyude <cpaul@redhat.com>
Cc: stable@vger.kernel.org, Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	David Airlie <airlied@linux.ie>,
	"open list:INTEL DRM DRIVERS (excluding Poulsbo, Moorestow...),
	dri-devel@lists.freedesktop.org (open list:INTEL DRM DRIVERS
	(excluding Poulsbo, Moorestow...),
	linux-kernel@vger.kernel.org (open list))"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v3 2/2] drm/i915/vlv: Reset the ADPA in vlv_display_power_well_init()
Date: Mon, 18 Apr 2016 18:09:25 +0300	[thread overview]
Message-ID: <20160418150925.GG4329@intel.com> (raw)
In-Reply-To: <1460988036-26226-1-git-send-email-cpaul@redhat.com>

On Mon, Apr 18, 2016 at 10:00:36AM -0400, Lyude wrote:
> While VGA hotplugging worked(ish) before, it looks like that was mainly
> because we'd unintentionally enable it in
> valleyview_crt_detect_hotplug() when we did a force trigger. This
> doesn't work reliably enough because whenever the display powerwell on
> vlv gets disabled, the values set in VLV_ADPA get cleared and
> consequently VGA hotplugging gets disabled. This causes bugs such as one
> we found on an Intel NUC, where doing the following sequence of
> hotplugs:
> 
>       - Disconnect all monitors
>       - Connect VGA
>       - Disconnect VGA
>       - Connect HDMI
> 
> Would result in VGA hotplugging becoming disabled, due to the powerwells
> getting toggled in the process of connecting HDMI.
> 
> Changes since v2:
>  - Use intel_encoder structs instead of drm_encoder structs
> 
> Changes since v1:
>  - Instead of handling the register writes ourself, we just reuse
>    intel_crt_detect()
>  - Instead of resetting the ADPA during display IRQ installation, we now
>    reset them in vlv_display_power_well_init()
> 
> CC: stable@vger.kernel.org
> Signed-off-by: Lyude <cpaul@redhat.com>
> ---
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 80e8bd4..0eae08a 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -902,6 +902,7 @@ static bool vlv_power_well_enabled(struct drm_i915_private *dev_priv,
>  
>  static void vlv_display_power_well_init(struct drm_i915_private *dev_priv)
>  {
> +	struct intel_encoder *encoder;
>  	enum pipe pipe;
>  
>  	/*
> @@ -935,6 +936,12 @@ static void vlv_display_power_well_init(struct drm_i915_private *dev_priv)
>  
>  	intel_hpd_init(dev_priv);
>  
> +	/* Re-enable the ADPA, if we have one */
> +	for_each_intel_encoder(dev_priv->dev, encoder) {
> +		if (encoder->type == INTEL_OUTPUT_ANALOG)
> +			encoder->base.funcs->reset(&encoder->base);

intel_crt_reset(&encoder->base) would be much easier to navigate.
Or if we want to be a bit more verbose we could call it
intel_crt_hpd_init() or somesuch.

With that 
Reviewed-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>

Before we push these, I think we'll need to do a bit more work to
make sure we don't end up in an infinite crt hpd loop (already
happend to me a few times). I'll polish up my hacks for that and
send them out...

> +	}
> +
>  	i915_redisable_vga_power_on(dev_priv->dev);
>  }
>  
> -- 
> 2.5.5

-- 
Ville Syrj�l�
Intel OTC

  reply	other threads:[~2016-04-18 15:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 20:46 [PATCH] drm/i915/vlv: Enable/disable VGA hotplugging properly Lyude
2016-04-14 17:59 ` Ville Syrjälä
2016-04-15 13:47   ` Lyude Paul
2016-04-15 15:49     ` Ville Syrjälä
2016-04-15 17:06       ` Lyude Paul
2016-04-15 19:40 ` [PATCH v2 1/2] drm/i915/vlv: Make intel_crt_reset() per-encoder Lyude
2016-04-15 19:40   ` [PATCH v2 2/2] drm/i915/vlv: Reset the ADPA in vlv_display_power_well_init() Lyude
2016-04-18  8:34     ` Ville Syrjälä
2016-04-18 14:00       ` [PATCH v3 " Lyude
2016-04-18 15:09         ` Ville Syrjälä [this message]
2016-04-19 20:40           ` [PATCH v4 2/3] " Lyude
2016-04-18  8:32   ` [PATCH v2 1/2] drm/i915/vlv: Make intel_crt_reset() per-encoder Ville Syrjälä

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=20160418150925.GG4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=cpaul@redhat.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).