Commit 25fd6de3 authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Small tidy of gen8+ breadcrumb emission

Use a local to shrink a line under 80 columns, and refactor the common
emit_xcs_breadcrumb() wrapper of ggtt-write.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200504180507.6017-1-chris@chris-wilson.co.uk
parent 8757797f
...@@ -4641,8 +4641,7 @@ static u32 *emit_preempt_busywait(struct i915_request *request, u32 *cs) ...@@ -4641,8 +4641,7 @@ static u32 *emit_preempt_busywait(struct i915_request *request, u32 *cs)
} }
static __always_inline u32* static __always_inline u32*
gen8_emit_fini_breadcrumb_footer(struct i915_request *request, gen8_emit_fini_breadcrumb_tail(struct i915_request *request, u32 *cs)
u32 *cs)
{ {
*cs++ = MI_USER_INTERRUPT; *cs++ = MI_USER_INTERRUPT;
...@@ -4656,14 +4655,16 @@ gen8_emit_fini_breadcrumb_footer(struct i915_request *request, ...@@ -4656,14 +4655,16 @@ gen8_emit_fini_breadcrumb_footer(struct i915_request *request,
return gen8_emit_wa_tail(request, cs); return gen8_emit_wa_tail(request, cs);
} }
static u32 *gen8_emit_fini_breadcrumb(struct i915_request *request, u32 *cs) static u32 *emit_xcs_breadcrumb(struct i915_request *request, u32 *cs)
{ {
cs = gen8_emit_ggtt_write(cs, u32 addr = i915_request_active_timeline(request)->hwsp_offset;
request->fence.seqno,
i915_request_active_timeline(request)->hwsp_offset, return gen8_emit_ggtt_write(cs, request->fence.seqno, addr, 0);
0); }
return gen8_emit_fini_breadcrumb_footer(request, cs); static u32 *gen8_emit_fini_breadcrumb(struct i915_request *rq, u32 *cs)
{
return gen8_emit_fini_breadcrumb_tail(rq, emit_xcs_breadcrumb(rq, cs));
} }
static u32 *gen8_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs) static u32 *gen8_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs)
...@@ -4681,7 +4682,7 @@ static u32 *gen8_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs) ...@@ -4681,7 +4682,7 @@ static u32 *gen8_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs)
PIPE_CONTROL_FLUSH_ENABLE | PIPE_CONTROL_FLUSH_ENABLE |
PIPE_CONTROL_CS_STALL); PIPE_CONTROL_CS_STALL);
return gen8_emit_fini_breadcrumb_footer(request, cs); return gen8_emit_fini_breadcrumb_tail(request, cs);
} }
static u32 * static u32 *
...@@ -4697,7 +4698,7 @@ gen11_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs) ...@@ -4697,7 +4698,7 @@ gen11_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs)
PIPE_CONTROL_DC_FLUSH_ENABLE | PIPE_CONTROL_DC_FLUSH_ENABLE |
PIPE_CONTROL_FLUSH_ENABLE); PIPE_CONTROL_FLUSH_ENABLE);
return gen8_emit_fini_breadcrumb_footer(request, cs); return gen8_emit_fini_breadcrumb_tail(request, cs);
} }
/* /*
...@@ -4735,7 +4736,7 @@ static u32 *gen12_emit_preempt_busywait(struct i915_request *request, u32 *cs) ...@@ -4735,7 +4736,7 @@ static u32 *gen12_emit_preempt_busywait(struct i915_request *request, u32 *cs)
} }
static __always_inline u32* static __always_inline u32*
gen12_emit_fini_breadcrumb_footer(struct i915_request *request, u32 *cs) gen12_emit_fini_breadcrumb_tail(struct i915_request *request, u32 *cs)
{ {
*cs++ = MI_USER_INTERRUPT; *cs++ = MI_USER_INTERRUPT;
...@@ -4749,14 +4750,9 @@ gen12_emit_fini_breadcrumb_footer(struct i915_request *request, u32 *cs) ...@@ -4749,14 +4750,9 @@ gen12_emit_fini_breadcrumb_footer(struct i915_request *request, u32 *cs)
return gen8_emit_wa_tail(request, cs); return gen8_emit_wa_tail(request, cs);
} }
static u32 *gen12_emit_fini_breadcrumb(struct i915_request *request, u32 *cs) static u32 *gen12_emit_fini_breadcrumb(struct i915_request *rq, u32 *cs)
{ {
cs = gen8_emit_ggtt_write(cs, return gen12_emit_fini_breadcrumb_tail(rq, emit_xcs_breadcrumb(rq, cs));
request->fence.seqno,
i915_request_active_timeline(request)->hwsp_offset,
0);
return gen12_emit_fini_breadcrumb_footer(request, cs);
} }
static u32 * static u32 *
...@@ -4775,7 +4771,7 @@ gen12_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs) ...@@ -4775,7 +4771,7 @@ gen12_emit_fini_breadcrumb_rcs(struct i915_request *request, u32 *cs)
PIPE_CONTROL_FLUSH_ENABLE | PIPE_CONTROL_FLUSH_ENABLE |
PIPE_CONTROL_HDC_PIPELINE_FLUSH); PIPE_CONTROL_HDC_PIPELINE_FLUSH);
return gen12_emit_fini_breadcrumb_footer(request, cs); return gen12_emit_fini_breadcrumb_tail(request, cs);
} }
static void execlists_park(struct intel_engine_cs *engine) static void execlists_park(struct intel_engine_cs *engine)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment