dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: chris@chris-wilson.co.uk
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/i915/lvds: Only act on lid notify when the device is on
Date: Thu, 21 Apr 2011 16:08:14 -0600	[thread overview]
Message-ID: <20110421220803.10321.68968.stgit@localhost6.localdomain6> (raw)

If we're using vga switcheroo, the device may be turned off
and poking at it can cause an oops.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

 drivers/gpu/drm/i915/intel_lvds.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index a562bd2..67cb076 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -539,6 +539,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
 	struct drm_device *dev = dev_priv->dev;
 	struct drm_connector *connector = dev_priv->int_lvds_connector;
 
+	if (dev->switch_power_state != DRM_SWITCH_POWER_ON)
+		return NOTIFY_OK;
+
 	/*
 	 * check and update the status of LVDS connector after receiving
 	 * the LID nofication event.

             reply	other threads:[~2011-04-21 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 22:08 Alex Williamson [this message]
2011-04-22  5:58 ` [PATCH] drm/i915/lvds: Only act on lid notify when the device is on Chris Wilson
2011-04-22  6:13   ` Dave Airlie
2011-04-22  6:26     ` Chris Wilson
2011-04-23 14:42   ` Alex Williamson
2011-04-24 10:05 ` Chris Wilson
2011-04-24 13:26   ` Alex Williamson

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=20110421220803.10321.68968.stgit@localhost6.localdomain6 \
    --to=alex.williamson@redhat.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox