From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 4/7] drm/i915: add batch bo to i915_add_request() Date: Wed, 12 Jun 2013 11:09:50 +0100 Message-ID: <20130612100950.GC32648@cantiga.alporthouse.com> References: <1371029734-10355-1-git-send-email-mika.kuoppala@intel.com> <1371029734-10355-4-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (s16502780.onlinehome-server.info [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id D0CBBE6080 for ; Wed, 12 Jun 2013 03:09:56 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1371029734-10355-4-git-send-email-mika.kuoppala@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: Mika Kuoppala Cc: intel-gfx@lists.freedesktop.org, miku@iki.fi List-Id: intel-gfx@lists.freedesktop.org On Wed, Jun 12, 2013 at 12:35:31PM +0300, Mika Kuoppala wrote: > In order to track down a batch buffer and context which > caused the ring to hang, store reference to bo into the request struct. > Request can also cause gpu to hang after the batch in the flush section > in the ring. To detect this add start of the flush portion offset into the > request. > > Signed-off-by: Mika Kuoppala > --- > @@ -2041,8 +2043,10 @@ int __i915_add_request(struct intel_ring_buffer *ring, > > request->seqno = intel_ring_get_seqno(ring); > request->ring = ring; > + request->head = request_start; > request->tail = request_ring_position; > request->ctx = ring->last_context; > + request->batch_obj = obj; This could do with a comment explaining the lifetimes of the request vs batch_obj, and so justifying why we do not need a reference count. /* Whilst this request exists, batch_obj will be on the * active_list, and so will hold the active reference. Only when this * request is retired will the the batch_obj be moved onto the * inactive_list and lose its active reference. Hence we do not need * to explicitly hold another reference here. */ -Chris -- Chris Wilson, Intel Open Source Technology Centre