diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-03 00:24:50 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-03 08:54:50 +0100 |
commit | 413c9f7111c605a3842d4d0a85f8cf01470e5faa (patch) | |
tree | b8f36395e0fd4e070eae2572de39284d08e97644 /src/sna | |
parent | 1067335305a6b8123217518085f70a77b7f0334f (diff) |
sna/blt: Suppress repeated SETUP_BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/kgem.c | 1 | ||||
-rw-r--r-- | src/sna/sna.h | 4 | ||||
-rw-r--r-- | src/sna/sna_blt.c | 7 | ||||
-rw-r--r-- | src/sna/sna_io.c | 2 |
4 files changed, 14 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index c31e71fd..fb24563d 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -92,6 +92,7 @@ static void kgem_sna_reset(struct kgem *kgem) struct sna *sna = container_of(kgem, struct sna, kgem); sna->render.reset(sna); + sna->blt_state.fill_bo = 0; } static void kgem_sna_flush(struct kgem *kgem) diff --git a/src/sna/sna.h b/src/sna/sna.h index 091fed5e..189e3d4d 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -234,6 +234,10 @@ struct sna { void *WakeupData; CloseScreenProcPtr CloseScreen; + struct { + uint32_t fill_bo; + uint32_t fill_pixel; + } blt_state; union { struct gen2_render_state gen2; struct gen3_render_state gen3; diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index aff8fac4..d82f8451 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -149,6 +149,8 @@ static bool sna_blt_fill_init(struct sna *sna, _kgem_set_mode(kgem, KGEM_BLT); } + if (sna->blt_state.fill_bo != bo->handle || + sna->blt_state.fill_pixel != pixel) { uint32_t *b = kgem->batch + kgem->nbatch; b[0] = blt->cmd; @@ -165,6 +167,9 @@ static bool sna_blt_fill_init(struct sna *sna, b[7] = 0; b[8] = 0; kgem->nbatch += 9; + + sna->blt_state.fill_bo = bo->handle; + sna->blt_state.fill_pixel = pixel; } return TRUE; @@ -260,6 +265,7 @@ static Bool sna_blt_copy_init(struct sna *sna, if (!kgem_check_bo_fenced(kgem, src, dst, NULL)) _kgem_submit(kgem); + sna->blt_state.fill_bo = 0; return TRUE; } @@ -1273,6 +1279,7 @@ Bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu, } while (nbox); _kgem_set_mode(kgem, KGEM_BLT); + sna->blt_state.fill_bo = 0; return TRUE; } diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c index 649a359b..321247a2 100644 --- a/src/sna/sna_io.c +++ b/src/sna/sna_io.c @@ -234,6 +234,7 @@ void sna_read_boxes(struct sna *sna, } while (--nbox); assert(src - (char *)ptr == dst_bo->size); kgem_bo_destroy(kgem, dst_bo); + sna->blt_state.fill_bo = 0; } static void write_boxes_inplace(struct kgem *kgem, @@ -401,6 +402,7 @@ void sna_write_boxes(struct sna *sna, } while (nbox); _kgem_set_mode(kgem, KGEM_BLT); + sna->blt_state.fill_bo = 0; } struct kgem_bo *sna_replace(struct sna *sna, |