Skip to content

Commit 3fa016a

Browse files
committed
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 <[email protected]> Reported-by: Petr Tesarik <[email protected]> Reported-by: Stanislaw Gruszka <[email protected]> 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 <[email protected]> Tested-by: Bojan Smojver <[email protected]> Tested-by: Andreas Hartmann <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
1 parent d936622 commit 3fa016a

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

drivers/gpu/drm/i915/i915_drv.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ static int i915_drm_freeze(struct drm_device *dev)
467467
/* Modeset on resume, not lid events */
468468
dev_priv->modeset_on_lid = 0;
469469

470+
console_lock();
471+
intel_fbdev_set_suspend(dev, 1);
472+
console_unlock();
473+
470474
return 0;
471475
}
472476

@@ -539,6 +543,9 @@ static int i915_drm_thaw(struct drm_device *dev)
539543

540544
dev_priv->modeset_on_lid = 0;
541545

546+
console_lock();
547+
intel_fbdev_set_suspend(dev, 0);
548+
console_unlock();
542549
return error;
543550
}
544551

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ extern int intel_framebuffer_init(struct drm_device *dev,
382382
struct drm_i915_gem_object *obj);
383383
extern int intel_fbdev_init(struct drm_device *dev);
384384
extern void intel_fbdev_fini(struct drm_device *dev);
385-
385+
extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
386386
extern void intel_prepare_page_flip(struct drm_device *dev, int plane);
387387
extern void intel_finish_page_flip(struct drm_device *dev, int pipe);
388388
extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane);

drivers/gpu/drm/i915/intel_fb.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,16 @@ void intel_fbdev_fini(struct drm_device *dev)
254254
kfree(dev_priv->fbdev);
255255
dev_priv->fbdev = NULL;
256256
}
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+
257267
MODULE_LICENSE("GPL and additional rights");
258268

259269
void intel_fb_output_poll_changed(struct drm_device *dev)

0 commit comments

Comments
 (0)