summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Gordon <david.s.gordon@intel.com>2015-10-22 16:46:25 +0100
committerJohn Harrison <John.C.Harrison@Intel.com>2016-06-28 17:19:19 +0100
commit97764b08658612e5e86f87075563482603588cd8 (patch)
tree42fd0d62e3c50b177ae5bc1463ffee1e8dd31667
parent82706415b823db58c3259a2bab2d776b3ece636b (diff)
drm/i915: set request 'head' on allocation not in add_request()
The current setting of request 'head' in add_request() isn't useful and has been replaced for purposes of knowing how full the ring is by 'postfix'. So we can instead use 'head' to define and locate the entire range spanned by a request. Pictorially, head postfix tail | | | v v v ringbuffer: [......S......P.......I.....] where S, P, and I are the Start of the request, start of the Postfix, and the user-Interrupt respectively. To help with debugging, this request's tail should also be the next request's head, this showing that all ringbuffer usage is accounted for. For: VIZ-2021 Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 2e5434d2bed8..a866a9d0c8d9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2632,7 +2632,6 @@ void __i915_add_request(struct drm_i915_gem_request *request,
struct intel_engine_cs *engine;
struct drm_i915_private *dev_priv;
struct intel_ringbuffer *ringbuf;
- u32 request_start;
int ret;
if (WARN_ON(request == NULL))
@@ -2649,7 +2648,6 @@ void __i915_add_request(struct drm_i915_gem_request *request,
*/
intel_ring_reserved_space_use(ringbuf);
- request_start = intel_ring_get_tail(ringbuf);
/*
* Emit any outstanding flushes - execbuf can fail to emit the flush
* after having emitted the batchbuffer command. Hence we need to fix
@@ -2701,8 +2699,6 @@ void __i915_add_request(struct drm_i915_gem_request *request,
/* Not allowed to fail! */
WARN(ret, "emit|add_request failed: %d!\n", ret);
- request->head = request_start;
-
/* 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
@@ -3226,6 +3222,7 @@ __i915_gem_request_alloc(struct intel_engine_cs *engine,
i915_gem_request_cancel(req);
return ret;
}
+ req->head = intel_ring_get_tail(req->ringbuf);
*req_out = req;
return 0;