Commit 88afe715 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

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=58111Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
[danvet: Fixup sparse __iomem confusion reported by Wu Fengguang.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent eb119bd6
...@@ -155,6 +155,13 @@ static int intelfb_create(struct intel_fbdev *ifbdev, ...@@ -155,6 +155,13 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
/* If the object is shmemfs backed, it will have given us zeroed pages.
* If the object is stolen however, it will be full of whatever
* garbage was left in there.
*/
if (ifbdev->ifb.obj->stolen)
memset_io(info->screen_base, 0, info->screen_size);
/* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
DRM_DEBUG_KMS("allocated %dx%d fb: 0x%08x, bo %p\n", DRM_DEBUG_KMS("allocated %dx%d fb: 0x%08x, bo %p\n",
......
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