From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 4/6] drm/i915: don't memset the fb buffer if preallocated Date: Sat, 14 Dec 2013 12:28:49 +0100 Message-ID: <20131214112849.GL9804@phenom.ffwll.local> References: <1386880917-2951-1-git-send-email-jbarnes@virtuousgeek.org> <1386880917-2951-4-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 16C31FABF9 for ; Sat, 14 Dec 2013 03:27:57 -0800 (PST) Received: by mail-ea0-f173.google.com with SMTP id o10so1299976eaj.18 for ; Sat, 14 Dec 2013 03:27:57 -0800 (PST) Content-Disposition: inline In-Reply-To: <1386880917-2951-4-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Dec 12, 2013 at 12:41:55PM -0800, Jesse Barnes wrote: > We want to preserve the BIOS/bootloader contents for later. > > Signed-off-by: Jesse Barnes > --- > drivers/gpu/drm/i915/intel_fbdev.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c > index db75f22..53675d2 100644 > --- a/drivers/gpu/drm/i915/intel_fbdev.c > +++ b/drivers/gpu/drm/i915/intel_fbdev.c > @@ -132,6 +132,7 @@ static int intelfb_create(struct drm_fb_helper *helper, > struct drm_framebuffer *fb; > struct drm_i915_gem_object *obj; > int size, ret; > + bool prealloc = false; > > mutex_lock(&dev->struct_mutex); > > @@ -142,6 +143,7 @@ static int intelfb_create(struct drm_fb_helper *helper, > goto out_unlock; > } else { > DRM_DEBUG_KMS("re-using BIOS fb\n"); > + prealloc = true; > sizes->fb_width = intel_fb->base.width; > sizes->fb_height = intel_fb->base.height; > } > @@ -203,7 +205,7 @@ static int intelfb_create(struct drm_fb_helper *helper, > * If the object is stolen however, it will be full of whatever > * garbage was left in there. > */ > - if (ifbdev->fb->obj->stolen) > + if (ifbdev->fb->obj->stolen && !prealloc) > memset_io(info->screen_base, 0, info->screen_size); Shouldn't we just move this into intelfb_alloc? Now that allocating our own fb isn't the only way any more to get at one this code + comment above looks a bit misplaced. -Daniel > > /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ > -- > 1.8.4.2 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch