From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: [PATCH 2/3] drm/i915/vma: Mark vmas busy during execbuf lookup Date: Mon, 19 Aug 2013 23:14:14 -0700 Message-ID: <1376979255-17887-2-git-send-email-benjamin.widawsky@intel.com> References: <1376979255-17887-1-git-send-email-benjamin.widawsky@intel.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 232BAE5F63 for ; Mon, 19 Aug 2013 23:14:42 -0700 (PDT) In-Reply-To: <1376979255-17887-1-git-send-email-benjamin.widawsky@intel.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: intel-gfx@lists.freedesktop.org Cc: Ben Widawsky , Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org The exec_list is a somewhat fragile list containing all the VMAs we've looked up. It does processing in a multi-stage approach where elements on the list are expected to not be removed for the duration of the stages. The next patch will fix an oversight where destroying a VMA does not remove it from the exec_list. As such, we must mark the VMA busy for the multi stage execbuf or else the above assertion we mentioned cannot be guaranteed. NOTE: This patch isn't quite tested yet. It just fixes the theoretical issue. Cc: Chris Wilson Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 9b3b5f8..7d8c841 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -516,6 +516,8 @@ i915_gem_execbuffer_unreserve_vma(struct i915_vma *vma) i915_gem_object_unpin(obj); entry->flags &= ~(__EXEC_OBJECT_HAS_FENCE | __EXEC_OBJECT_HAS_PIN); + + vma->busy = 0; } static int @@ -535,6 +537,7 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring, bool need_fence, need_mappable; vma = list_first_entry(vmas, struct i915_vma, exec_list); + vma->busy = true; obj = vma->obj; entry = vma->exec_entry; -- 1.8.3.4