public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Roland Dreier <roland@kernel.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drm/i915/lvds: don't restore hw state in the lid notifier for pch platforms
Date: Mon, 2 Dec 2013 15:10:59 +0100	[thread overview]
Message-ID: <20131202141059.GC27344@phenom.ffwll.local> (raw)
In-Reply-To: <1381308432-25628-1-git-send-email-daniel.vetter@ffwll.ch>

On Wed, Oct 09, 2013 at 10:47:12AM +0200, Daniel Vetter wrote:
> It's a pain for two reasons:
> - The vga plane redisablign requires actual legacy vgao i/o to pull
>   of. The hw engineers really botched this one here :(
> - There seem to be some BIOS out there which send out lid events when
>   unplugging. Together with our broken DP code, which disables the
>   port when the cable is lost, this results in an immediate modeset
>   call, which can hang on the wait for outstanding flips.
> 
> Cc: Roland Dreier <roland@kernel.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I've pimped the commit message a bit (added another bz reference) and
merged this one with Chris' irc-ack to dinq.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_lvds.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> index ae0c843..19d055d 100644
> --- a/drivers/gpu/drm/i915/intel_lvds.c
> +++ b/drivers/gpu/drm/i915/intel_lvds.c
> @@ -443,9 +443,19 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
>  	if (dev_priv->modeset_restore == MODESET_DONE)
>  		goto exit;
>  
> -	drm_modeset_lock_all(dev);
> -	intel_modeset_setup_hw_state(dev, true);
> -	drm_modeset_unlock_all(dev);
> +	/*
> +	 * Some old platform's BIOS love to wreak havoc while the lid is closed.
> +	 * We try to detect this here and undo any damage. The split for PCH
> +	 * platforms is rather conservative and a bit arbitrary expect that on
> +	 * those platforms VGA disabling requires actual legacy VGA I/O access,
> +	 * and as part of the cleanup in the hw state restore we also redisable
> +	 * the vga plane.
> +	 */
> +	if (!HAS_PCH_SPLIT(dev)) {
> +		drm_modeset_lock_all(dev);
> +		intel_modeset_setup_hw_state(dev, true);
> +		drm_modeset_unlock_all(dev);
> +	}
>  
>  	dev_priv->modeset_restore = MODESET_DONE;
>  
> -- 
> 1.8.4.rc3
> 

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

      parent reply	other threads:[~2013-12-02 14:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09  8:47 [PATCH] drm/i915/lvds: don't restore hw state in the lid notifier for pch platforms Daniel Vetter
2013-10-14 16:52 ` Roland Dreier
2013-10-14 17:14   ` Daniel Vetter
2013-10-14 17:31     ` Roland Dreier
2013-10-14 21:13       ` Daniel Vetter
2013-12-02 14:10 ` 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=20131202141059.GC27344@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=roland@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