Skip to contentSkip to conversation

drm/i915: clear the stolen fb before resuming

PATCH Applied Jani Nikula 3 participants 3 messages May 7, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: clear the stolen fb before resuming

Similar to
commit 88afe715dd5469bc24ca7a19ac62dd3c241cab48

Author: Chris Wilson <[email protected]>
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

---
 drivers/gpu/drm/i915/intel_fb.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_fb.c +14 -2
index 0e19e57..6b7c3ca 100644
@@ -262,10 +262,22 @@ void intel_fbdev_fini(struct drm_device *dev)
 void intel_fbdev_set_suspend(struct drm_device *dev, int state)
 {
 	drm_i915_private_t *dev_priv = dev->dev_private;
-	if (!dev_priv->fbdev)
+	struct intel_fbdev *ifbdev = dev_priv->fbdev;
+	struct fb_info *info;
+
+	if (!ifbdev)
 		return;
 
-	fb_set_suspend(dev_priv->fbdev->helper.fbdev, state);
+	info = ifbdev->helper.fbdev;
+
+	/* On resume from hibernation: If the object is shmemfs backed, it has
+	 * been restored from swap. If the object is stolen however, it will be
+	 * full of whatever garbage was left in there.
+	 */
+	if (!state && ifbdev->ifb.obj->stolen)
+		memset_io(info->screen_base, 0, info->screen_size);
+
+	fb_set_suspend(info, state);
 }
 
 MODULE_LICENSE("GPL and additional rights");
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jani Nikula

Similar to
commit 88afe715dd5469bc24ca7a19ac62dd3c241cab48

Author: Chris Wilson <[email protected]>
Date:   Sun Dec 16 12:15:41 2012 +0000
Quoted 7 lines

drm/i915: Clear the stolen fb before enabling

but on the resume path.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=57191

I wish that "state" was given a more meaningful name and type.

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw
Quoted 8 lines · Chris Wilson
Quoted 7 lines · Jani Nikula

Similar to
commit 88afe715dd5469bc24ca7a19ac62dd3c241cab48

Author: Chris Wilson <[email protected]>
Date:   Sun Dec 16 12:15:41 2012 +0000

drm/i915: Clear the stolen fb before enabling

Quoted 8 lines
Quoted 5 lines

but on the resume path.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=57191

I wish that "state" was given a more meaningful name and type.

Picked up for -fixes (with a cc: stable for 3.9), thanks for the patch. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch