sna: Only flush after the BLT operation if we have more than 2 distinct bo

In order to preserve the optimisation of discarding incomplete batches,
we don't always want to immediately submit the batch after inserting the
first command. As we currently only cancel a batch if it only touches
the bo being discarded, we can skip the immediate flush if it only
accesses one bo and maybe be able to use the undo optimisation later.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-07-09 20:41:51 +01:00
parent d935912d9c
commit ccf0fdd56d
1 changed files with 5 additions and 5 deletions

View File

@ -85,7 +85,7 @@ static const uint8_t fill_ROP[] = {
static void nop_done(struct sna *sna, const struct sna_composite_op *op)
{
assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(&sna->kgem));
if (sna->kgem.nreloc && __kgem_ring_empty(&sna->kgem))
if (sna->kgem.nexec > 1 && __kgem_ring_empty(&sna->kgem))
_kgem_submit(&sna->kgem);
(void)op;
}
@ -95,7 +95,7 @@ static void gen6_blt_copy_done(struct sna *sna, const struct sna_composite_op *o
struct kgem *kgem = &sna->kgem;
assert(kgem->nbatch <= KGEM_BATCH_SIZE(kgem));
if (kgem->nreloc && __kgem_ring_empty(kgem)) {
if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) {
_kgem_submit(kgem);
return;
}
@ -2301,7 +2301,7 @@ static void convert_done(struct sna *sna, const struct sna_composite_op *op)
struct kgem *kgem = &sna->kgem;
assert(kgem->nbatch <= KGEM_BATCH_SIZE(kgem));
if (kgem->nreloc && __kgem_ring_empty(kgem))
if (kgem->nexec > 1 && __kgem_ring_empty(kgem))
_kgem_submit(kgem);
kgem_bo_destroy(kgem, op->src.bo);
@ -2800,7 +2800,7 @@ bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
}
} while (nbox);
if (kgem->nreloc && __kgem_ring_empty(kgem))
if (kgem->nexec > 1 && __kgem_ring_empty(kgem))
_kgem_submit(kgem);
return true;
@ -2989,7 +2989,7 @@ bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu,
} while (1);
}
if (kgem->nreloc && __kgem_ring_empty(kgem)) {
if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) {
_kgem_submit(kgem);
} else if (kgem->gen >= 060 && kgem_check_batch(kgem, 3)) {
uint32_t *b = kgem->batch + kgem->nbatch;