Mesa (master): i965: Use batch->bo->size in brw_emit_reloc assertion.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Sep 14 23:21:02 UTC 2017


Module: Mesa
Branch: master
Commit: 343aa09a22ea61c4d2177eb5b19bce1b5c24292c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=343aa09a22ea61c4d2177eb5b19bce1b5c24292c

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Aug 30 01:04:48 2017 -0700

i965: Use batch->bo->size in brw_emit_reloc assertion.

This makes the assertion safe against batchbuffers growing.

Reviewed-by: Matt Turner <mattst88 at gmail.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

---

 src/mesa/drivers/dri/i965/intel_batchbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index cd118f6c6f..276fe458a1 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -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];




More information about the mesa-commit mailing list