diff --git a/src/panfrost/lib/genxml/cs_builder.h b/src/panfrost/lib/genxml/cs_builder.h index d197091367e..6d5c601815a 100644 --- a/src/panfrost/lib/genxml/cs_builder.h +++ b/src/panfrost/lib/genxml/cs_builder.h @@ -452,6 +452,9 @@ cs_alloc_ins(struct cs_builder *b, uint32_t num_instrs) } } + /* Make sure the instruction sequence fits in a single chunk. */ + assert(b->cur_chunk.buffer.capacity >= num_instrs); + /* If the current chunk runs out of space, allocate a new one and jump to it. * We actually do this a few instructions before running out, because the * sequence to jump to a new queue takes multiple instructions.