aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-16 07:15:41 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-12-17 08:40:15 -0500
commit88afe715dd5469bc24ca7a19ac62dd3c241cab48 (patch)
treed63f9be31177aea602421891f771e48c756e5474
parenteb119bd612906519cacef2536a9a524c2da5f7fb (diff)
drm/i915: Clear the stolen fb before enabling
As the stolen memory region will contain the contents of whatever was last there, it invariably contains garbage. To be consistent with the shmemfs backed fb and the expectations of the fb layer, we need to clear the fb prior to installing it as an fbcon. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58111 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> [danvet: Fixup sparse __iomem confusion reported by Wu Fengguang.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 822896782cd0..71d55801c0d9 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -155,6 +155,13 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
155 drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); 155 drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
156 drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); 156 drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
157 157
158 /* If the object is shmemfs backed, it will have given us zeroed pages.
159 * If the object is stolen however, it will be full of whatever
160 * garbage was left in there.
161 */
162 if (ifbdev->ifb.obj->stolen)
163 memset_io(info->screen_base, 0, info->screen_size);
164
158 /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ 165 /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
159 166
160 DRM_DEBUG_KMS("allocated %dx%d fb: 0x%08x, bo %p\n", 167 DRM_DEBUG_KMS("allocated %dx%d fb: 0x%08x, bo %p\n",