From: Ben Widawsky Subject: Re: [PATCH 5/5] drm/i915: Convert execbuf code to use vmas Date: Mon, 12 Aug 2013 18:50:40 -0700 Message-ID: <20130813015039.GB19697@bwidawsk.net> References: <1376111536-12461-1-git-send-email-benjamin.widawsky@intel.com> <1376111536-12461-5-git-send-email-benjamin.widawsky@intel.com> <20130810091320.GH3561@cantiga.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 8622AE743D for ; Mon, 12 Aug 2013 18:50:43 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130810091320.GH3561@cantiga.alporthouse.com> 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: Chris Wilson , Ben Widawsky , Intel GFX List-Id: intel-gfx@lists.freedesktop.org On Sat, Aug 10, 2013 at 10:13:20AM +0100, Chris Wilson wrote: > On Fri, Aug 09, 2013 at 10:12:16PM -0700, Ben Widawsky wrote: > > static int > > i915_gem_execbuffer_move_to_gpu(struct intel_ring_buffer *ring, > > - struct list_head *objects) > > + struct list_head *vmas) > > { > > - struct drm_i915_gem_object *obj; > > + struct i915_vma *vma; > > uint32_t flush_domains = 0; > > int ret; > > > > - list_for_each_entry(obj, objects, exec_list) { > > - ret = i915_gem_object_sync(obj, ring); > > + list_for_each_entry(vma, vmas, exec_list) { > > + ret = i915_gem_object_sync(vma->obj, ring); > > if (ret) > > return ret; > > > > - if (obj->base.write_domain & I915_GEM_DOMAIN_CPU) > > - i915_gem_clflush_object(obj); > > + if (vma->obj->base.write_domain & I915_GEM_DOMAIN_CPU) > > + i915_gem_clflush_object(vma->obj); > > > > - flush_domains |= obj->base.write_domain; > > + flush_domains |= vma->obj->base.write_domain; > > This, and a few more places, will be neater with a local > struct drm_i915_gem_object *obj = vma->obj; > -Chris > I got this and the other fixed you requested for needs_reloc_mappable. I only found one other place that had more than one instance of vma->obj though. i915_gem_execbuffer_unreserve_vma i915_gem_execbuffer_move_to_gpu Please let me know if I missed one. -- Ben Widawsky, Intel Open Source Technology Center