sna/gen2: Add a couple of assertions to track down a batch overflow
References: https://bugs.freedesktop.org/show_bug.cgi?id=55700 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
3680aa4976
commit
d2a26adc8e
|
|
@ -980,6 +980,7 @@ static void gen2_magic_ca_pass(struct sna *sna,
|
|||
dst = sna->kgem.batch + sna->kgem.nbatch;
|
||||
n = 1 + sna->render.vertex_index;
|
||||
sna->kgem.nbatch += n;
|
||||
assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(kgem));
|
||||
while (n--)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ static inline float pack_2s(int16_t x, int16_t y)
|
|||
|
||||
static inline int batch_space(struct sna *sna)
|
||||
{
|
||||
assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(kgem));
|
||||
assert(sna->kgem.nbatch + KGEM_BATCH_RESERVED < sna->kgem.surface);
|
||||
return sna->kgem.surface - sna->kgem.nbatch - KGEM_BATCH_RESERVED;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue