aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lvds.c
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2009-12-10 20:26:11 -0500
committerEric Anholt <eric@anholt.net>2009-12-16 16:23:38 -0500
commita2565377a5c31e25c77c7cabaf6752abe9a2d83a (patch)
tree4018ce6acf4b02a11c045aa3e5ab86090f8a47d6 /drivers/gpu/drm/i915/intel_lvds.c
parenta3cb5195f6db58dbebd8a31b877ddce082c9b63d (diff)
drm/i915: Update LVDS connector status when receiving ACPI LID event
Dirk reports that nothing is displayed on LVDS when using ubuntu 9.1 after close/reopen the LID. And I also reproduce this issue on another laptop. After some tests and debug, it seems that it is related with that the LVDS status is not updated in time in course of suspend/resume. Now the LID state is used to check whether the LVDS is connected or disconnected. And when the LID is closed, it means that the LVDS is disconnected. When it is reopened, it means that the LVDS is connected. At the same time on some distributions the LID event is also used to put the system into suspend state. When the LID is closed, the system will enter the suspend state. When the LID is reopened, the system will be resumed. In such case when the LID is closed, user-space script will receive the LID notification event and detect the LVDS as disconnected. Then the system will enter the suspended state. When the LID is reopened, the system will be resumed. As the LVDS status is not updated in course of resume, it will cause that the LVDS connector is marked as unused and disabled. After the resume is finished,user-space script will try to configure the display mode for LVDS. But unfortunately as the LVDS status is not updated in time and it is still marked as disconnected, the LVDS and its corresponding CRTC will be disabled again in the function of drm_helper_disable_unused_functions after changing mode for LVDS. So we had better check and update the status of LVDS connector after receiving the LID notication event. Then after the system is resumed from suspended state, we can set the display mode for LVDS correctly. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reported-by: Dirk Hohndel <hohndel@infradead.org> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> CC: stable@kernel.org Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lvds.c')
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index b3188a0b4979..f4b4aa242df1 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -686,7 +686,14 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
686 struct drm_i915_private *dev_priv = 686 struct drm_i915_private *dev_priv =
687 container_of(nb, struct drm_i915_private, lid_notifier); 687 container_of(nb, struct drm_i915_private, lid_notifier);
688 struct drm_device *dev = dev_priv->dev; 688 struct drm_device *dev = dev_priv->dev;
689 struct drm_connector *connector = dev_priv->int_lvds_connector;
689 690
691 /*
692 * check and update the status of LVDS connector after receiving
693 * the LID nofication event.
694 */
695 if (connector)
696 connector->status = connector->funcs->detect(connector);
690 if (!acpi_lid_open()) { 697 if (!acpi_lid_open()) {
691 dev_priv->modeset_on_lid = 1; 698 dev_priv->modeset_on_lid = 1;
692 return NOTIFY_OK; 699 return NOTIFY_OK;
@@ -1124,6 +1131,8 @@ out:
1124 DRM_DEBUG_KMS("lid notifier registration failed\n"); 1131 DRM_DEBUG_KMS("lid notifier registration failed\n");
1125 dev_priv->lid_notifier.notifier_call = NULL; 1132 dev_priv->lid_notifier.notifier_call = NULL;
1126 } 1133 }
1134 /* keep the LVDS connector */
1135 dev_priv->int_lvds_connector = connector;
1127 drm_sysfs_connector_add(connector); 1136 drm_sysfs_connector_add(connector);
1128 return; 1137 return;
1129 1138