diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-26 17:50:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-27 10:25:36 +0100 |
commit | 389241aa6469b2e64a58cc0527e3310fdc69ffb7 (patch) | |
tree | 70c11cd247cc0da68fd3e8bd79c0dc3e2035dba7 | |
parent | baf78fcddb87eba987163485ad8fd227fb244f29 (diff) |
sna: Suppress an overwritten fill
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_blt.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index bbe9dda3..8d07035d 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -1756,6 +1756,18 @@ Bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu, case 8: break; } + /* Compare first box against a previous fill */ + if (kgem->nbatch >= 6 && + (alu == GXcopy || alu == GXclear) && + kgem->reloc[kgem->nreloc-1].target_handle == dst_bo->handle && + kgem->batch[kgem->nbatch-6] == ((cmd & ~XY_SRC_COPY_BLT_CMD) | XY_COLOR_BLT_CMD) && + kgem->batch[kgem->nbatch-4] == ((uint32_t)(box->y1 + dst_dy) << 16 | (uint16_t)(box->x1 + dst_dx)) && + kgem->batch[kgem->nbatch-3] == ((uint32_t)(box->y2 + dst_dy) << 16 | (uint16_t)(box->x2 + dst_dx))) { + DBG(("%s: deleting last fill\n", __FUNCTION__)); + kgem->nbatch -= 6; + kgem->nreloc--; + } + kgem_set_mode(kgem, KGEM_BLT); if (!kgem_check_batch(kgem, 8) || !kgem_check_reloc(kgem, 2) || |