Commit e7c64041 authored by Rob Clark's avatar Rob Clark

freedreno: add some debug_asserts() to catch insane offsets

Ofc won't catch *all* faults, but at least helpful for catching offsets
which are completely bogus.
Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
parent 1f2bc64f
......@@ -207,6 +207,7 @@ OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo,
DBG("ring[%p]: OUT_RELOC %04x: %p+%u << %d", ring,
(uint32_t)(ring->cur - ring->last_start), bo, offset, shift);
}
debug_assert(offset < fd_bo_size(bo));
fd_ringbuffer_reloc(ring, &(struct fd_reloc){
.bo = bo,
.flags = FD_RELOC_READ,
......@@ -224,6 +225,7 @@ OUT_RELOCW(struct fd_ringbuffer *ring, struct fd_bo *bo,
DBG("ring[%p]: OUT_RELOCW %04x: %p+%u << %d", ring,
(uint32_t)(ring->cur - ring->last_start), bo, offset, shift);
}
debug_assert(offset < fd_bo_size(bo));
fd_ringbuffer_reloc(ring, &(struct fd_reloc){
.bo = bo,
.flags = FD_RELOC_READ | FD_RELOC_WRITE,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment