Commit 884ceace authored by Kenneth Graunke's avatar Kenneth Graunke Committed by Daniel Vetter

drm/i915: Refactor Broadwell PIPE_CONTROL emission into a helper.

We'll want to reuse this for a workaround.
Signed-off-by: default avatarKenneth Graunke <kenneth@whitecape.org>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
[danvet: Rmove now unused int.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 69bbeb4a
...@@ -379,13 +379,33 @@ gen7_render_ring_flush(struct intel_engine_cs *ring, ...@@ -379,13 +379,33 @@ gen7_render_ring_flush(struct intel_engine_cs *ring,
return 0; return 0;
} }
static int
gen8_emit_pipe_control(struct intel_engine_cs *ring,
u32 flags, u32 scratch_addr)
{
int ret;
ret = intel_ring_begin(ring, 6);
if (ret)
return ret;
intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(6));
intel_ring_emit(ring, flags);
intel_ring_emit(ring, scratch_addr);
intel_ring_emit(ring, 0);
intel_ring_emit(ring, 0);
intel_ring_emit(ring, 0);
intel_ring_advance(ring);
return 0;
}
static int static int
gen8_render_ring_flush(struct intel_engine_cs *ring, gen8_render_ring_flush(struct intel_engine_cs *ring,
u32 invalidate_domains, u32 flush_domains) u32 invalidate_domains, u32 flush_domains)
{ {
u32 flags = 0; u32 flags = 0;
u32 scratch_addr = ring->scratch.gtt_offset + 2 * CACHELINE_BYTES; u32 scratch_addr = ring->scratch.gtt_offset + 2 * CACHELINE_BYTES;
int ret;
flags |= PIPE_CONTROL_CS_STALL; flags |= PIPE_CONTROL_CS_STALL;
...@@ -404,20 +424,7 @@ gen8_render_ring_flush(struct intel_engine_cs *ring, ...@@ -404,20 +424,7 @@ gen8_render_ring_flush(struct intel_engine_cs *ring,
flags |= PIPE_CONTROL_GLOBAL_GTT_IVB; flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;
} }
ret = intel_ring_begin(ring, 6); return gen8_emit_pipe_control(ring, flags, scratch_addr);
if (ret)
return ret;
intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(6));
intel_ring_emit(ring, flags);
intel_ring_emit(ring, scratch_addr);
intel_ring_emit(ring, 0);
intel_ring_emit(ring, 0);
intel_ring_emit(ring, 0);
intel_ring_advance(ring);
return 0;
} }
static void ring_write_tail(struct intel_engine_cs *ring, static void ring_write_tail(struct intel_engine_cs *ring,
......
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