From patchwork Fri Jan 15 12:24:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 73157 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0FCOYes003349 for ; Fri, 15 Jan 2010 12:24:34 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 782759F4D4; Fri, 15 Jan 2010 04:24:34 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.ffwll.ch (cable-static-49-187.intergga.ch [157.161.49.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 549439F4E1 for ; Fri, 15 Jan 2010 04:24:25 -0800 (PST) Received: by mail.ffwll.ch (Postfix, from userid 1000) id A177B20C231; Fri, 15 Jan 2010 13:24:24 +0100 (CET) X-Spam-ASN: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on orange.ffwll.ch X-Spam-Level: X-Spam-Hammy: 0.000-+--struct, 0.000-+--signed-off-by, 0.000-+--signedoffby X-Spam-Status: No, score=-1.2 required=6.0 tests=ALL_TRUSTED,AWL,BAYES_00, FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Spammy: 0.967-+--H*m:ffwll, 0.964-+--H*Ad:U*daniel.vetter, 0.953-+--H*r:mail.ffwll.ch Received: from biene (unknown [192.168.23.129]) by mail.ffwll.ch (Postfix) with ESMTP id 12F9720C224; Fri, 15 Jan 2010 13:23:56 +0100 (CET) Received: from daniel by biene with local (Exim 4.71) (envelope-from ) id 1NVlE3-0003hV-7P; Fri, 15 Jan 2010 13:24:27 +0100 From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Fri, 15 Jan 2010 13:24:16 +0100 Message-Id: <929126816da9516827b8850d4c0c4dcd08cf3587.1263558064.git.daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.6.6 In-Reply-To: <218f84ba918f387762e080160db19fbf90b63462.1263558064.git.daniel.vetter@ffwll.ch> References: <74471ded981086a7e563554dd9d0ea490fb31a88.1263558064.git.daniel.vetter@ffwll.ch> <102f9fb63e13a34928c5fd4c1c42f2c578357d65.1263558064.git.daniel.vetter@ffwll.ch> <696000111f936935bff77e578594e1adbadd4811.1263558064.git.daniel.vetter@ffwll.ch> <4b6704aae352dc67313813a3aff309a51c84d8e8.1263558064.git.daniel.vetter@ffwll.ch> <218f84ba918f387762e080160db19fbf90b63462.1263558064.git.daniel.vetter@ffwll.ch> In-Reply-To: References: Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 09/11] drm/i915: fixup execbuf failure path X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6bf4481..23fae9a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3718,7 +3718,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, struct drm_i915_gem_object *obj_priv; struct drm_clip_rect *cliprects = NULL; struct drm_i915_gem_relocation_entry *relocs; - int ret = 0, ret2, i, pinned = 0; + int ret = 0, ret2, i, pinned = 0, referenced; uint64_t exec_offset; uint32_t seqno, flush_domains, reloc_index; int pin_tries, flips; @@ -3787,6 +3787,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, DRM_ERROR("Invalid object handle %d at index %d\n", exec_list[i].handle, i); ret = -EBADF; + referenced = i + 1; goto err; } @@ -3795,11 +3796,13 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, DRM_ERROR("Object %p appears more than once in object list\n", object_list[i]); ret = -EBADF; + referenced = i + 1; goto err; } obj_priv->in_execbuffer = true; flips += atomic_read(&obj_priv->pending_flip); } + referenced = args->buffer_count; if (flips > 0) { ret = i915_gem_wait_for_pending_flip(dev, object_list, @@ -3980,7 +3983,7 @@ err: for (i = 0; i < pinned; i++) i915_gem_object_unpin(object_list[i]); - for (i = 0; i < args->buffer_count; i++) { + for (i = 0; i < referenced; i++) { if (object_list[i]) { obj_priv = object_list[i]->driver_private; obj_priv->in_execbuffer = false;