aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-03-21 06:25:52 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2017-03-21 10:21:50 -0400
commitfe085f13c7901203445fd2ab26c0f499313b8258 (patch)
treec960eafb07e11a856cb325ca82e71f45140f040b /drivers/gpu/drm/i915/intel_ringbuffer.c
parent899f6204c0f8117d33226e586d3a630b3cf9bce0 (diff)
drm/i915: Remove intel_ring.last_retired_head
Storing the position of the breadcrumb of the last retired request as a separate last_retired_head is superfluous as we always copy that into head prior to recalculation of the intel_ring.space. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170321102552.24357-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index d9b8d17c3fc6..0ca5ea7a9407 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -49,13 +49,7 @@ static int __intel_ring_space(int head, int tail, int size)
49 49
50void intel_ring_update_space(struct intel_ring *ring) 50void intel_ring_update_space(struct intel_ring *ring)
51{ 51{
52 if (ring->last_retired_head != -1) { 52 ring->space = __intel_ring_space(ring->head, ring->tail, ring->size);
53 ring->head = ring->last_retired_head;
54 ring->last_retired_head = -1;
55 }
56
57 ring->space = __intel_ring_space(ring->head & HEAD_ADDR,
58 ring->tail, ring->size);
59} 53}
60 54
61static int 55static int
@@ -618,12 +612,8 @@ static void reset_ring_common(struct intel_engine_cs *engine,
618 } 612 }
619 613
620 /* If the rq hung, jump to its breadcrumb and skip the batch */ 614 /* If the rq hung, jump to its breadcrumb and skip the batch */
621 if (request->fence.error == -EIO) { 615 if (request->fence.error == -EIO)
622 struct intel_ring *ring = request->ring; 616 request->ring->head = request->postfix;
623
624 ring->head = request->postfix;
625 ring->last_retired_head = -1;
626 }
627 } else { 617 } else {
628 engine->legacy_active_context = NULL; 618 engine->legacy_active_context = NULL;
629 } 619 }
@@ -1392,7 +1382,6 @@ intel_engine_create_ring(struct intel_engine_cs *engine, int size)
1392 if (IS_I830(engine->i915) || IS_I845G(engine->i915)) 1382 if (IS_I830(engine->i915) || IS_I845G(engine->i915))
1393 ring->effective_size -= 2 * CACHELINE_BYTES; 1383 ring->effective_size -= 2 * CACHELINE_BYTES;
1394 1384
1395 ring->last_retired_head = -1;
1396 intel_ring_update_space(ring); 1385 intel_ring_update_space(ring);
1397 1386
1398 vma = intel_ring_create_vma(engine->i915, size); 1387 vma = intel_ring_create_vma(engine->i915, size);
@@ -1571,10 +1560,8 @@ void intel_legacy_submission_resume(struct drm_i915_private *dev_priv)
1571 struct intel_engine_cs *engine; 1560 struct intel_engine_cs *engine;
1572 enum intel_engine_id id; 1561 enum intel_engine_id id;
1573 1562
1574 for_each_engine(engine, dev_priv, id) { 1563 for_each_engine(engine, dev_priv, id)
1575 engine->buffer->head = engine->buffer->tail; 1564 engine->buffer->head = engine->buffer->tail;
1576 engine->buffer->last_retired_head = -1;
1577 }
1578} 1565}
1579 1566
1580static int ring_request_alloc(struct drm_i915_gem_request *request) 1567static int ring_request_alloc(struct drm_i915_gem_request *request)