From 7ef4760d052848687ec4444167514f0bbb852fa0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 19 Apr 2012 23:27:51 +0100 Subject: [PATCH] drm/i915: Run deferred hotplug events upon restoring fbcon on lastclose() When the DRM client exits and returns control to fbcon, we should check to see if we have a pending hotplug event to reconfigure the framebuffer. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42194 Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_fb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index cfcabc7..3b0c58c 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c @@ -284,17 +284,23 @@ void intel_fb_output_poll_changed(struct drm_device *dev) void intel_fb_restore_mode(struct drm_device *dev) { - int ret; drm_i915_private_t *dev_priv = dev->dev_private; struct drm_mode_config *config = &dev->mode_config; + struct drm_fb_helper *helper = &dev_priv->fbdev->helper; struct drm_plane *plane; + int ret; mutex_lock(&dev->mode_config.mutex); - ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper); + ret = drm_fb_helper_restore_fbdev_mode(helper); if (ret) DRM_DEBUG("failed to restore crtc mode\n"); + if (helper->delayed_hotplug) { + helper->delayed_hotplug = false; + drm_fb_helper_hotplug_event(helper); + } + /* Be sure to shut off any planes that may be active */ list_for_each_entry(plane, &config->plane_list, head) plane->funcs->disable_plane(plane); -- 1.7.10