Commit c291be9d authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Hold mode_config lock whilst changing mode for lastclose()

Upon lastclose(), we switch back to the fbcon configuration. This
requires taking the mode_config lock in order to serialise the change
with output probing elsewhere.
Reported-by: default avatarOleksij Rempel <bug-track@fisher-privat.net>
References: https://bugs.freedesktop.org/show_bug.cgi?id=48652Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: stable@kernel.org
Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-Off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent f9bef081
...@@ -279,6 +279,8 @@ void intel_fb_restore_mode(struct drm_device *dev) ...@@ -279,6 +279,8 @@ void intel_fb_restore_mode(struct drm_device *dev)
struct drm_mode_config *config = &dev->mode_config; struct drm_mode_config *config = &dev->mode_config;
struct drm_plane *plane; struct drm_plane *plane;
mutex_lock(&dev->mode_config.mutex);
ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper); ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
if (ret) if (ret)
DRM_DEBUG("failed to restore crtc mode\n"); DRM_DEBUG("failed to restore crtc mode\n");
...@@ -286,4 +288,6 @@ void intel_fb_restore_mode(struct drm_device *dev) ...@@ -286,4 +288,6 @@ void intel_fb_restore_mode(struct drm_device *dev)
/* Be sure to shut off any planes that may be active */ /* Be sure to shut off any planes that may be active */
list_for_each_entry(plane, &config->plane_list, head) list_for_each_entry(plane, &config->plane_list, head)
plane->funcs->disable_plane(plane); plane->funcs->disable_plane(plane);
mutex_unlock(&dev->mode_config.mutex);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment