aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-03-28 05:48:49 -0400
committerDave Airlie <airlied@redhat.com>2012-03-29 02:44:27 -0400
commit3fa016a0b5c5237e9c387fc3249592b2cb5391c6 (patch)
tree7633de525107d0ce289039fdf136b3dbc4eedd22
parentd936622c36273a9ecfbb4aacf26cd29405995159 (diff)
drm/i915: suspend fbdev device around suspend/hibernate
Looking at hibernate overwriting I though it looked like a cursor, so I tracked down this missing piece to stop the cursor blink timer. I've no idea if this is sufficient to fix the hibernate problems people are seeing, but please test it. Both radeon and nouveau have done this for a long time. I've run this personally all night hib/resume cycles with no fails. Reviewed-by: Keith Packard <keithp@keithp.com> Reported-by: Petr Tesarik <kernel@tesarici.cz> Reported-by: Stanislaw Gruszka <sgruszka@redhat.com> Reported-by: Lots of misc segfaults after hibernate across the world. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=37142 Tested-by: Dave Airlie <airlied@redhat.com> Tested-by: Bojan Smojver <bojan@rexursive.com> Tested-by: Andreas Hartmann <andihartmann@01019freenet.de> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c7
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h2
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c10
3 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0694e170a338..1a7559b59997 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -467,6 +467,10 @@ static int i915_drm_freeze(struct drm_device *dev)
467 /* Modeset on resume, not lid events */ 467 /* Modeset on resume, not lid events */
468 dev_priv->modeset_on_lid = 0; 468 dev_priv->modeset_on_lid = 0;
469 469
470 console_lock();
471 intel_fbdev_set_suspend(dev, 1);
472 console_unlock();
473
470 return 0; 474 return 0;
471} 475}
472 476
@@ -539,6 +543,9 @@ static int i915_drm_thaw(struct drm_device *dev)
539 543
540 dev_priv->modeset_on_lid = 0; 544 dev_priv->modeset_on_lid = 0;
541 545
546 console_lock();
547 intel_fbdev_set_suspend(dev, 0);
548 console_unlock();
542 return error; 549 return error;
543} 550}
544 551
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 9cec6c3937fa..5a14149b3794 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -382,7 +382,7 @@ extern int intel_framebuffer_init(struct drm_device *dev,
382 struct drm_i915_gem_object *obj); 382 struct drm_i915_gem_object *obj);
383extern int intel_fbdev_init(struct drm_device *dev); 383extern int intel_fbdev_init(struct drm_device *dev);
384extern void intel_fbdev_fini(struct drm_device *dev); 384extern void intel_fbdev_fini(struct drm_device *dev);
385 385extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
386extern void intel_prepare_page_flip(struct drm_device *dev, int plane); 386extern void intel_prepare_page_flip(struct drm_device *dev, int plane);
387extern void intel_finish_page_flip(struct drm_device *dev, int pipe); 387extern void intel_finish_page_flip(struct drm_device *dev, int pipe);
388extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane); 388extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane);
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 2d8766978388..19ecd78b8a2c 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -254,6 +254,16 @@ void intel_fbdev_fini(struct drm_device *dev)
254 kfree(dev_priv->fbdev); 254 kfree(dev_priv->fbdev);
255 dev_priv->fbdev = NULL; 255 dev_priv->fbdev = NULL;
256} 256}
257
258void 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
257MODULE_LICENSE("GPL and additional rights"); 267MODULE_LICENSE("GPL and additional rights");
258 268
259void intel_fb_output_poll_changed(struct drm_device *dev) 269void intel_fb_output_poll_changed(struct drm_device *dev)