Commit 3fa016a0 authored by Dave Airlie's avatar Dave Airlie

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: default avatarKeith Packard <keithp@keithp.com>
Reported-by: default avatarPetr Tesarik <kernel@tesarici.cz>
Reported-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Reported-by: Lots of misc segfaults after hibernate across the world.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=37142Tested-by: default avatarDave Airlie <airlied@redhat.com>
Tested-by: default avatarBojan Smojver <bojan@rexursive.com>
Tested-by: default avatarAndreas Hartmann <andihartmann@01019freenet.de>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent d936622c
...@@ -467,6 +467,10 @@ static int i915_drm_freeze(struct drm_device *dev) ...@@ -467,6 +467,10 @@ static int i915_drm_freeze(struct drm_device *dev)
/* Modeset on resume, not lid events */ /* Modeset on resume, not lid events */
dev_priv->modeset_on_lid = 0; dev_priv->modeset_on_lid = 0;
console_lock();
intel_fbdev_set_suspend(dev, 1);
console_unlock();
return 0; return 0;
} }
...@@ -539,6 +543,9 @@ static int i915_drm_thaw(struct drm_device *dev) ...@@ -539,6 +543,9 @@ static int i915_drm_thaw(struct drm_device *dev)
dev_priv->modeset_on_lid = 0; dev_priv->modeset_on_lid = 0;
console_lock();
intel_fbdev_set_suspend(dev, 0);
console_unlock();
return error; return error;
} }
......
...@@ -382,7 +382,7 @@ extern int intel_framebuffer_init(struct drm_device *dev, ...@@ -382,7 +382,7 @@ extern int intel_framebuffer_init(struct drm_device *dev,
struct drm_i915_gem_object *obj); struct drm_i915_gem_object *obj);
extern int intel_fbdev_init(struct drm_device *dev); extern int intel_fbdev_init(struct drm_device *dev);
extern void intel_fbdev_fini(struct drm_device *dev); extern void intel_fbdev_fini(struct drm_device *dev);
extern void intel_fbdev_set_suspend(struct drm_device *dev, int state);
extern void intel_prepare_page_flip(struct drm_device *dev, int plane); extern void intel_prepare_page_flip(struct drm_device *dev, int plane);
extern void intel_finish_page_flip(struct drm_device *dev, int pipe); extern void intel_finish_page_flip(struct drm_device *dev, int pipe);
extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane); extern void intel_finish_page_flip_plane(struct drm_device *dev, int plane);
......
...@@ -254,6 +254,16 @@ void intel_fbdev_fini(struct drm_device *dev) ...@@ -254,6 +254,16 @@ void intel_fbdev_fini(struct drm_device *dev)
kfree(dev_priv->fbdev); kfree(dev_priv->fbdev);
dev_priv->fbdev = NULL; dev_priv->fbdev = NULL;
} }
void intel_fbdev_set_suspend(struct drm_device *dev, int state)
{
drm_i915_private_t *dev_priv = dev->dev_private;
if (!dev_priv->fbdev)
return;
fb_set_suspend(dev_priv->fbdev->helper.fbdev, state);
}
MODULE_LICENSE("GPL and additional rights"); MODULE_LICENSE("GPL and additional rights");
void intel_fb_output_poll_changed(struct drm_device *dev) void intel_fb_output_poll_changed(struct drm_device *dev)
......
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