intel: Move the assertions about reloc delta from the macros to the function.

Cuts another 1800 bytes from the driver.
This commit is contained in:
Eric Anholt
2010-03-05 12:40:45 -08:00
parent 8a9d8bd52a
commit 342a7f23bf
2 changed files with 4 additions and 2 deletions
@@ -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);
@@ -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)