diff mbox

display stays turned off after lid reopen

Message ID 1259141674.2552.17.camel@localhost.localdomain (mailing list archive)
State Accepted
Headers show

Commit Message

Zhao, Yakui Nov. 25, 2009, 9:34 a.m. UTC
None
diff mbox

Patch

check and update the status of LVDS connector after receiving the LID
notication event.
---
 drivers/gpu/drm/i915/i915_drv.h   |    2 ++
 drivers/gpu/drm/i915/intel_lvds.c |    9 +++++++++
 2 files changed, 11 insertions(+)

Index: linux-2.6/drivers/gpu/drm/i915/i915_drv.h
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/i915_drv.h	2009-11-25 16:56:16.000000000 +0800
+++ linux-2.6/drivers/gpu/drm/i915/i915_drv.h	2009-11-25 16:59:39.000000000 +0800
@@ -543,6 +543,8 @@ 
 	struct timer_list idle_timer;
 	bool busy;
 	u16 orig_clock;
+	/* check the connector status after receiving the LID event */
+	struct drm_connector *int_lvds_connector;
 } drm_i915_private_t;
 
 /** driver private structure attached to each drm_gem_object */
Index: linux-2.6/drivers/gpu/drm/i915/intel_lvds.c
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_lvds.c	2009-11-25 16:56:16.000000000 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_lvds.c	2009-11-25 17:26:34.000000000 +0800
@@ -679,7 +679,14 @@ 
 	struct drm_i915_private *dev_priv =
 		container_of(nb, struct drm_i915_private, lid_notifier);
 	struct drm_device *dev = dev_priv->dev;
+	struct drm_connector *connector = dev_priv->int_lvds_connector;
 
+	/*
+	 * check and update the status of LVDS connector after receiving
+	 * the LID nofication event.
+	 */
+	if (connector)
+		connector->status = connector->funcs->detect(connector);
 	if (!acpi_lid_open()) {
 		dev_priv->modeset_on_lid = 1;
 		return NOTIFY_OK;
@@ -1085,6 +1092,8 @@ 
 		DRM_DEBUG_KMS("lid notifier registration failed\n");
 		dev_priv->lid_notifier.notifier_call = NULL;
 	}
+	/* keep the LVDS connector */
+	dev_priv->int_lvds_connector = connector;
 	drm_sysfs_connector_add(connector);
 	return;