From patchwork Wed Dec 2 11:43:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 64242 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB2BhVc9015387 for ; Wed, 2 Dec 2009 11:43:31 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 799DD9F4E1; Wed, 2 Dec 2009 03:43:30 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from orsmga101.jf.intel.com (mga06.intel.com [134.134.136.21]) by gabe.freedesktop.org (Postfix) with ESMTP id A3F5C9F3A3 for ; Wed, 2 Dec 2009 03:43:27 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 02 Dec 2009 03:42:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,327,1257148800"; d="scan'208";a="574921332" Received: from unknown (HELO localhost.localdomain) ([10.255.16.235]) by orsmga001.jf.intel.com with ESMTP; 02 Dec 2009 03:43:12 -0800 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Wed, 2 Dec 2009 11:43:15 +0000 Message-Id: <1259754196-12694-3-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1259754196-12694-1-git-send-email-chris@chris-wilson.co.uk> References: <1259754196-12694-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 2/3] intel: Remove the extra reference while validating the reloc tree 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/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index e0585ca..21bd563 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -187,7 +187,6 @@ static int drm_intel_gem_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode, uint32_t stride); -static void drm_intel_gem_bo_unreference_locked(drm_intel_bo *bo); static void drm_intel_gem_bo_unreference_locked_timed(drm_intel_bo *bo, time_t time); @@ -357,7 +356,6 @@ drm_intel_add_validate_buffer(drm_intel_bo *bo) bufmgr_gem->exec_objects[index].alignment = 0; bufmgr_gem->exec_objects[index].offset = 0; bufmgr_gem->exec_bos[index] = bo; - drm_intel_gem_bo_reference(bo); bufmgr_gem->exec_count++; } @@ -793,19 +791,6 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time) } } -static void drm_intel_gem_bo_unreference_locked(drm_intel_bo *bo) -{ - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - - assert(atomic_read(&bo_gem->refcount) > 0); - if (atomic_dec_and_test(&bo_gem->refcount)) { - struct timespec time; - - clock_gettime(CLOCK_MONOTONIC, &time); - drm_intel_gem_bo_unreference_final(bo, time.tv_sec); - } -} - static void drm_intel_gem_bo_unreference_locked_timed(drm_intel_bo *bo, time_t time) { @@ -1302,7 +1287,6 @@ drm_intel_gem_bo_exec(drm_intel_bo *bo, int used, /* Disconnect the buffer from the validate list */ bo_gem->validate_index = -1; - drm_intel_gem_bo_unreference_locked(bo); bufmgr_gem->exec_bos[i] = NULL; } bufmgr_gem->exec_count = 0;