From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 3/4] drm/i915: Cleanup handling of last_fenced_seqno Date: Sat, 19 Mar 2011 23:09:49 +0000 Message-ID: <1bdc18$ju35br@fmsmga002.fm.intel.com> References: <1300487719-26578-1-git-send-email-chris@chris-wilson.co.uk> <1300487719-26578-4-git-send-email-chris@chris-wilson.co.uk> <20110319225510.GD16343@viiv.ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id A28EC9E77E for ; Sat, 19 Mar 2011 16:09:52 -0700 (PDT) In-Reply-To: <20110319225510.GD16343@viiv.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: Daniel Vetter Cc: Andy Whitcroft , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, 19 Mar 2011 23:55:11 +0100, Daniel Vetter wrote: > A few nitpicks below. > > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > > index 5201f82..2dbf8f7 100644 > > --- a/drivers/gpu/drm/i915/i915_gem.c > > +++ b/drivers/gpu/drm/i915/i915_gem.c > > @@ -2461,13 +2461,15 @@ i915_gem_object_flush_fence(struct drm_i915_gem_object *obj, > > obj->fenced_gpu_access = false; > > } > > > > + if (obj->last_fenced_seqno && > > + ring_passed_seqno(obj->ring, obj->last_fenced_seqno)) > > + obj->last_fenced_seqno = 0; > > This only avoids running the request retiring logic. Without this there are a > few more things to simplify, I think: Not strictly. We only do i915_wait_request() if changing rings, yet we want to check if the object has any outstanding fences for an optimisation later (writing the fence register immediately whenever possible). > > if (obj->last_fenced_seqno && pipelined != obj->ring) { > > - if (!ring_passed_seqno(obj->ring, obj->last_fenced_seqno)) { > > - ret = i915_wait_request(obj->ring, > > - obj->last_fenced_seqno); > > - if (ret) > > - return ret; > > - } > > + ret = i915_wait_request(obj->ring, > > + obj->last_fenced_seqno); > > + if (ret) > > + return ret; > > > > obj->last_fenced_seqno = 0; > > Can't we move that (and the other copies) to move_off_active? No, because the obj may remain active even after the wait. > > > @@ -2648,15 +2650,18 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj, > > old->last_fenced_seqno); > > } > > Above here is the imo unnecessary clause mentioned in a previous patch. ECONTEXT? -Chris -- Chris Wilson, Intel Open Source Technology Centre