i965: Use batch->bo->size in brw_emit_reloc assertion.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 30 Aug 2017 08:04:48 +0000 (01:04 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Sep 2017 23:17:36 +0000 (16:17 -0700)
This makes the assertion safe against batchbuffers growing.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
src/mesa/drivers/dri/i965/intel_batchbuffer.c

index cd118f6c6fcfb618e41291ca01829bda4905e91a..276fe458a133b10354d2ac659b50431d85a14d47 100644 (file)
@@ -806,7 +806,7 @@ brw_emit_reloc(struct intel_batchbuffer *batch, uint32_t batch_offset,
    }
 
    /* Check args */
-   assert(batch_offset <= BATCH_SZ - sizeof(uint32_t));
+   assert(batch_offset <= batch->bo->size - sizeof(uint32_t));
 
    unsigned int index = add_exec_bo(batch, target);
    struct drm_i915_gem_exec_object2 *entry = &batch->validation_list[index];