From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 2/2] drm/i915: Track unbound pages Date: Mon, 20 Aug 2012 10:36:09 +0100 Message-ID: <1345455372_2371@CP5-2952> References: <1344696088-24760-2-git-send-email-chris@chris-wilson.co.uk> <1345453239-12529-1-git-send-email-daniel.vetter@ffwll.ch> <1345453239-12529-2-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 30F0B9EF86 for ; Mon, 20 Aug 2012 02:36:18 -0700 (PDT) In-Reply-To: <1345453239-12529-2-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Intel Graphics Development Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org On Mon, 20 Aug 2012 11:00:39 +0200, Daniel Vetter wrote: > int > -i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj, > - gfp_t gfpmask) > +i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) > { > + struct drm_i915_private *dev_priv = obj->base.dev->dev_private; > int page_count, i; > struct address_space *mapping; > - struct inode *inode; > struct page *page; > + gfp_t gfp; > > if (obj->pages || obj->sg_table) > return 0; > > + /* Assert that the object is not currently in any GPU domain. As it > + * wasn't in the GTT, there shouldn't be any way it could have been in > + * a GPU cache > + */ > + BUG_ON(obj->base.read_domains & I915_GEM_GPU_DOMAINS); > + BUG_ON(obj->base.write_domain & I915_GEM_GPU_DOMAINS); > + > /* Get the list of pages out of our struct file. They'll be pinned > * at this point until we release them. > */ > page_count = obj->base.size / PAGE_SIZE; > - BUG_ON(obj->pages != NULL); > - obj->pages = drm_malloc_ab(page_count, sizeof(struct page *)); > + obj->pages = kmalloc(page_count*sizeof(struct page *), GFP_KERNEL); This is a silly one (by me). At one point the patch introduced i915_malloc() and replaced drm_malloc_ab() with it and then I reverted that after transitioning to using the sg_table everywhere. It needs to still be drm_malloc_ab() in this and the follow-on patches until it is replaced by sg_alloc_table(). -Chris -- Chris Wilson, Intel Open Source Technology Centre