Skip to content

Commit f28cecc

Browse files
jnikulagregkh
authored andcommitted
drm/i915: clear the stolen fb before resuming
commit 1ffc528 upstream. Similar to commit 88afe71 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sun Dec 16 12:15:41 2012 +0000 drm/i915: Clear the stolen fb before enabling but on the resume path. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=57191 Reported-and-tested-by: Nikolay Amiantov <nikoamia@gmail.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 60724ed commit f28cecc

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎drivers/gpu/drm/i915/intel_fb.c‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,22 @@ void intel_fbdev_fini(struct drm_device *dev)
261261
void intel_fbdev_set_suspend(struct drm_device *dev, int state)
262262
{
263263
drm_i915_private_t *dev_priv = dev->dev_private;
264-
if (!dev_priv->fbdev)
264+
struct intel_fbdev *ifbdev = dev_priv->fbdev;
265+
struct fb_info *info;
266+
267+
if (!ifbdev)
265268
return;
266269

267-
fb_set_suspend(dev_priv->fbdev->helper.fbdev, state);
270+
info = ifbdev->helper.fbdev;
271+
272+
/* On resume from hibernation: If the object is shmemfs backed, it has
273+
* been restored from swap. If the object is stolen however, it will be
274+
* full of whatever garbage was left in there.
275+
*/
276+
if (!state && ifbdev->ifb.obj->stolen)
277+
memset_io(info->screen_base, 0, info->screen_size);
278+
279+
fb_set_suspend(info, state);
268280
}
269281

270282
MODULE_LICENSE("GPL and additional rights");

0 commit comments

Comments
 (0)