Commit 0a03726ca982129b1e054f0e8c34ca7eea348acd

Authored by Linus Torvalds

Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull the intel i915 hibernation memory corruption fix from Dave Airlie:
 "I tracked down the misc memory corruption after i915 hibernate to the
  blinking fbcon cursor, and realised the i915 driver wasn't doing the
  fbdev suspend/resume calls at all.  nouveau and radeon have done these
  calls for a long time.

  This has been fairly well tested and is definitely the main culprit in
  hibernate not working."

Yay.

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/i915: suspend fbdev device around suspend/hibernate

Showing 3 changed files Side-by-side Diff

drivers/gpu/drm/i915/i915_drv.c
... ... @@ -467,6 +467,10 @@
467 467 /* Modeset on resume, not lid events */
468 468 dev_priv->modeset_on_lid = 0;
469 469  
  470 + console_lock();
  471 + intel_fbdev_set_suspend(dev, 1);
  472 + console_unlock();
  473 +
470 474 return 0;
471 475 }
472 476  
... ... @@ -539,6 +543,9 @@
539 543  
540 544 dev_priv->modeset_on_lid = 0;
541 545  
  546 + console_lock();
  547 + intel_fbdev_set_suspend(dev, 0);
  548 + console_unlock();
542 549 return error;
543 550 }
544 551  
drivers/gpu/drm/i915/intel_drv.h
... ... @@ -382,7 +382,7 @@
382 382 struct drm_i915_gem_object *obj);
383 383 extern int intel_fbdev_init(struct drm_device *dev);
384 384 extern void intel_fbdev_fini(struct drm_device *dev);
385   -
  385 +extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
386 386 extern void intel_prepare_page_flip(struct drm_device *dev, int plane);
387 387 extern void intel_finish_page_flip(struct drm_device *dev, int pipe);
388 388 extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane);
drivers/gpu/drm/i915/intel_fb.c
... ... @@ -254,6 +254,16 @@
254 254 kfree(dev_priv->fbdev);
255 255 dev_priv->fbdev = NULL;
256 256 }
  257 +
  258 +void intel_fbdev_set_suspend(struct drm_device *dev, int state)
  259 +{
  260 + drm_i915_private_t *dev_priv = dev->dev_private;
  261 + if (!dev_priv->fbdev)
  262 + return;
  263 +
  264 + fb_set_suspend(dev_priv->fbdev->helper.fbdev, state);
  265 +}
  266 +
257 267 MODULE_LICENSE("GPL and additional rights");
258 268  
259 269 void intel_fb_output_poll_changed(struct drm_device *dev)