It replaces tu_cs_reserve_space_assert and can be called at any
time to sanity check tu_cs.
tu_cs_emit_pkt4(cs, REG_A6XX_RB_LRZ_CNTL, 1);
tu_cs_emit(cs, 0x00000000);
- tu_cs_reserve_space_assert(cs);
+ tu_cs_sanity_check(cs);
}
static void
cs->bos[cs->bo_count++] = new_bo;
- cs->start = cs->cur = (uint32_t *) new_bo->map;
+ cs->start = cs->cur = cs->reserved_end = (uint32_t *) new_bo->map;
cs->end = cs->start + new_bo->size / sizeof(uint32_t);
return VK_SUCCESS;
cs->bos[0] = cs->bos[cs->bo_count - 1];
cs->bo_count = 1;
- cs->start = cs->cur = (uint32_t *) cs->bos[0]->map;
+ cs->start = cs->cur = cs->reserved_end = (uint32_t *) cs->bos[0]->map;
cs->end = cs->start + cs->bos[0]->size / sizeof(uint32_t);
}
* Assert that we did not exceed the reserved space.
*/
static inline void
-tu_cs_reserve_space_assert(struct tu_cs *cs)
+tu_cs_sanity_check(const struct tu_cs *cs)
{
+ assert(cs->start <= cs->cur);
assert(cs->cur <= cs->reserved_end);
+ assert(cs->reserved_end <= cs->end);
}
/**
{
uint32_t *start;
uint32_t *cur;
- uint32_t *end;
-
- /* for tu_cs_reserve_space_assert */
uint32_t *reserved_end;
+ uint32_t *end;
uint32_t next_bo_size;