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 <mika.kuoppala at intel.com> > --- > @@ -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