diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-13 17:09:25 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-13 17:09:25 +0100 |
commit | b10850af4125b8dbc36d13fa83f1dcce13ac6684 (patch) | |
tree | 909d26aa940ae90e6407435f678493a7178288d1 | |
parent | d5242565ef17cb4265177338df5b564b960e3692 (diff) |
sna/blt: Check for reloc overflow when initialising solid fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_blt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index a8d39bdc..1375a7a3 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -152,7 +152,14 @@ static bool sna_blt_fill_init(struct sna *sna, if (sna->blt_state.fill_bo != bo->handle || sna->blt_state.fill_pixel != pixel) { - uint32_t *b = kgem->batch + kgem->nbatch; + uint32_t *b; + + if (kgem->nreloc + 1 > KGEM_RELOC_SIZE(kgem)) { + _kgem_submit(kgem); + _kgem_set_mode(kgem, KGEM_BLT); + } + + b = kgem->batch + kgem->nbatch; b[0] = blt->cmd; b[1] = blt->br13; b[2] = 0; |