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

Matt Turner mattst88 at gmail.com
Mon Jul 13 14:51:47 PDT 2015


On Sat, Jul 11, 2015 at 11:08 AM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> 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?

It is not, but I'm not totally sure that's better -- an unaligned movq
might cross a cache boundary which is apparently pretty expensive.

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

I'll do some performance tests on top of my v3 series.


More information about the mesa-dev mailing list