[Intel-gfx] [PATCH 2/2] drm/i915: Consolidate gen8_emit_pipe_control
Chris Wilson
chris at chris-wilson.co.uk
Wed Feb 15 16:33:21 UTC 2017
On Wed, Feb 15, 2017 at 04:06:34PM +0000, Tvrtko Ursulin wrote:
> +static inline u32 *gen8_emit_pipe_control(u32 *batch, u32 flags, u32 offset)
> +{
> + static const u32 pc6[6] = { GFX_OP_PIPE_CONTROL(6), 0, 0, 0, 0, 0 };
> +
> + memcpy(batch, pc6, sizeof(pc6));
> +
> + batch[1] = flags;
> + batch[2] = offset;
> +
> + return batch + 6;
godbolt would seem to say it is best to use
static inline u32 *gen8_emit_pipe_control(u32 *batch, u32 flags, u32 offset)
{
batch[0] = GFX_OP_PIPE_CONTROL(6);
batch[1] = flags;
batch[2] = offset;
batch[3] = 0;
batch[4] = 0;
batch[5] = 0;
return batch + 6;
}
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list