[Intel-gfx] [PATCH 29/40] drm/i915: Refactor Broadwell PIPE_CONTROL emission into a helper.
Jesse Barnes
jbarnes at virtuousgeek.org
Tue Jul 29 18:59:53 CEST 2014
On Sat, 28 Jun 2014 02:04:20 +0300
ville.syrjala at linux.intel.com wrote:
> From: Kenneth Graunke <kenneth at whitecape.org>
>
> We'll want to reuse this for a workaround.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> drivers/gpu/drm/i915/intel_ringbuffer.c | 36 ++++++++++++++++++++-------------
> 1 file changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 2faef26..97796b1 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -381,6 +381,27 @@ gen7_render_ring_flush(struct intel_engine_cs *ring,
> }
>
> 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
> gen8_render_ring_flush(struct intel_engine_cs *ring,
> u32 invalidate_domains, u32 flush_domains)
> {
> @@ -405,20 +426,7 @@ gen8_render_ring_flush(struct intel_engine_cs *ring,
> flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;
> }
>
> - 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;
> -
> + return gen8_emit_pipe_control(ring, flags, scratch_addr);
> }
>
> static void ring_write_tail(struct intel_engine_cs *ring,
Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>
--
Jesse Barnes, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list