[PATCH] drm/i915/lvds: Only act on lid notify when the device is on

Alex Williamson alex.williamson at redhat.com
Thu Apr 21 15:08:14 PDT 2011


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 at 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.



More information about the dri-devel mailing list