aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-09-09 09:11:43 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2016-09-09 09:23:00 -0400
commita52abd2facfe8add456a075c2d9e254db071bf85 (patch)
tree63b06d7be33a4c35117fe062265aaae21d93c028 /drivers/gpu/drm
parentba49b2f8237b0241fb86660812c0b235580ac182 (diff)
drm/i915: Record the position of the workarounds in the tail of the request
Rather than blindly assuming we need to advance the tail for resubmitting the request via the ELSP, record the position. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-3-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_request.h15
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.c4
2 files changed, 11 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
index 91014de8bfbc..2faa3bb4c39b 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.h
+++ b/drivers/gpu/drm/i915/i915_gem_request.h
@@ -88,20 +88,23 @@ struct drm_i915_gem_request {
88 */ 88 */
89 u32 previous_seqno; 89 u32 previous_seqno;
90 90
91 /** Position in the ringbuffer of the start of the request */ 91 /** Position in the ring of the start of the request */
92 u32 head; 92 u32 head;
93 93
94 /** 94 /**
95 * Position in the ringbuffer of the start of the postfix. 95 * Position in the ring of the start of the postfix.
96 * This is required to calculate the maximum available ringbuffer 96 * This is required to calculate the maximum available ring space
97 * space without overwriting the postfix. 97 * without overwriting the postfix.
98 */ 98 */
99 u32 postfix; 99 u32 postfix;
100 100
101 /** Position in the ringbuffer of the end of the whole request */ 101 /** Position in the ring of the end of the whole request */
102 u32 tail; 102 u32 tail;
103 103
104 /** Preallocate space in the ringbuffer for the emitting the request */ 104 /** Position in the ring of the end of any workarounds after the tail */
105 u32 wa_tail;
106
107 /** Preallocate space in the ring for the emitting the request */
105 u32 reserved_space; 108 u32 reserved_space;
106 109
107 /** 110 /**
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 9bfe304c5256..d7fa9b3a55c3 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -482,8 +482,7 @@ static void execlists_unqueue(struct intel_engine_cs *engine)
482 * resubmit the request. See gen8_emit_request() for where we 482 * resubmit the request. See gen8_emit_request() for where we
483 * prepare the padding after the end of the request. 483 * prepare the padding after the end of the request.
484 */ 484 */
485 req0->tail += 8; 485 req0->tail = req0->wa_tail;
486 req0->tail &= req0->ring->size - 1;
487 } 486 }
488 487
489 execlists_elsp_submit_contexts(req0, req1); 488 execlists_elsp_submit_contexts(req0, req1);
@@ -711,6 +710,7 @@ intel_logical_ring_advance(struct drm_i915_gem_request *request)
711 intel_ring_emit(ring, MI_NOOP); 710 intel_ring_emit(ring, MI_NOOP);
712 intel_ring_emit(ring, MI_NOOP); 711 intel_ring_emit(ring, MI_NOOP);
713 intel_ring_advance(ring); 712 intel_ring_advance(ring);
713 request->wa_tail = ring->tail;
714 714
715 /* We keep the previous context alive until we retire the following 715 /* We keep the previous context alive until we retire the following
716 * request. This ensures that any the context object is still pinned 716 * request. This ensures that any the context object is still pinned