[Mesa-dev] [PATCH 4/5] i965: Split batch emission from relocation functions.

Chris Wilson chris at chris-wilson.co.uk
Sat Jul 11 11:08:17 PDT 2015


On Fri, Jul 10, 2015 at 11:44:58AM -0700, Matt Turner wrote:
> So that everything writing to the batch between BEGIN_BATCH() and
> ADVANCE_BATCH() goes through OUT_BATCH.

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

> +#define OUT_RELOC64(buf, read_domains, write_domain, delta) do {        \
> +   uint64_t reloc64 = intel_batchbuffer_reloc64(brw, buf, read_domains, \
> +                                                write_domain, delta);   \
> +   OUT_BATCH(reloc64);                                                  \
> +   OUT_BATCH(reloc64 >> 32);                                            \
>  } while (0)

Is the compiler smart enough to convert this to movq?

The pointer emission variant at least makes it trivial to use
   *((uint64_t *)map)++ = reloc64
if so desired.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list