From: Eric Anholt Date: Fri, 5 Mar 2010 20:40:45 +0000 (-0800) Subject: intel: Move the assertions about reloc delta from the macros to the function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=342a7f23bf76e21b049cba9ab97bf4aa640a5bfd;p=mesa.git intel: Move the assertions about reloc delta from the macros to the function. Cuts another 1800 bytes from the driver. --- diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index a7bfd62b285..9768b0deee7 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -210,6 +210,8 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, { int ret; + assert(delta < buffer->size); + if (batch->ptr - batch->map > batch->buf->size) printf ("bad relocation ptr %p map %p offset %d size %lu\n", batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); @@ -234,6 +236,8 @@ intel_batchbuffer_emit_reloc_fenced(struct intel_batchbuffer *batch, { int ret; + assert(delta < buffer->size); + if (batch->ptr - batch->map > batch->buf->size) printf ("bad relocation ptr %p map %p offset %d size %lu\n", batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 860aa1327a1..b7625b5b0d9 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -128,12 +128,10 @@ static INLINE uint32_t float_as_int(float f) float_as_int(f)) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ - assert((unsigned) (delta) < buf->size); \ intel_batchbuffer_emit_reloc(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0) #define OUT_RELOC_FENCED(buf, read_domains, write_domain, delta) do { \ - assert((unsigned) (delta) < buf->size); \ intel_batchbuffer_emit_reloc_fenced(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0)