diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-10 13:30:54 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-10 19:12:58 +0100 |
commit | b22de0b01453884d5018e7e0faef439421fa63a0 (patch) | |
tree | 0685bb88f1bbfff4b6c7a9e166f2eee23fc42572 | |
parent | ebeebc2044610e6e31d9cef746c768d2e435f32c (diff) |
sna/blt: Suppress overwriting boxes through fill_boxes()
As the introduction of the unrolled fill_boxes() was bypassing the
effective optimisation in fill_one().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_blt.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index d82f417b..3d350b1d 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -1178,6 +1178,21 @@ Bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu, case 8: break; } + /* All too frequently one blt completely overwrites the previous */ + if (kgem->nbatch >= 6 && + (alu == GXcopy || alu == GXclear) && + kgem->batch[kgem->nbatch-6] == cmd && + kgem->batch[kgem->nbatch-4] == (box[0].y1 << 16 | box[0].x1) && + kgem->batch[kgem->nbatch-3] == (box[0].y2 << 16 | box[0].x2) && + kgem->reloc[kgem->nreloc-1].target_handle == bo->handle) { + DBG(("%s: replacing last fill\n", __FUNCTION__)); + kgem->batch[kgem->nbatch-5] = br13; + kgem->batch[kgem->nbatch-1] = color; + if (--nbox == 0) + return TRUE; + box++; + } + kgem_set_mode(kgem, KGEM_BLT); if (!kgem_check_batch(kgem, 6) || !kgem_check_bo_fenced(kgem, bo, NULL) || |