From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Seperate fence pin counting from normal bind pin counting Date: Sun, 5 Jun 2011 22:55:29 +0200 Message-ID: <20110605205529.GA2691@phenom.ffwll.local> References: <1307177743-3195-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wy0-f177.google.com (mail-wy0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id D661F9E7FE for ; Sun, 5 Jun 2011 13:54:59 -0700 (PDT) Received: by wyb28 with SMTP id 28so3380878wyb.36 for ; Sun, 05 Jun 2011 13:54:59 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1307177743-3195-1-git-send-email-chris@chris-wilson.co.uk> 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 Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, Jun 04, 2011 at 09:55:43AM +0100, Chris Wilson wrote: > + ret = pin_and_fence_object(obj, ring); > + if (ret) { > + int ret_ignore; > + > + /* This can potentially raise a harmless > + * -EINVAL if we failed to bind in the above > + * call. It cannot raise -EINTR since we know > + * that the bo is freshly bound and so will > + * not need to be flushed or waited upon. > + */ > + ret_ignore = i915_gem_object_unbind(obj); > + (void)ret_ignore; > + WARN_ON(obj->gtt_space); > + break; > } Chris clarified my confusion about this piece of the patch on irc: It's required to ensure the "valid gtt_space implies that execbuffer_reserve holds a pin count ref on this object" invariant, which is used later on in the unwind loop. I think this should be mentioned in the comment. [The confusion mostly stemmed from the second (slightly different) unwind loop which is used in an earlier error path.] I couldn't poke any other holes into this (and I don't have clear ideas for straightening out the code-flow in execbuffer_reserve) so: Reviewed-by: Daniel Vetter -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48