BoxRec boxes[512], *b = boxes, *const last_box = boxes+ARRAY_SIZE(boxes);
int16_t dx, dy;
- DBG(("%s x %d [(%d, %d)x(%d, %d)...]+(%d,%d), clipped?=%d\n",
- __FUNCTION__, n,
+ DBG(("%s pixmap=%ld x %d [(%d, %d)x(%d, %d)...]+(%d,%d), clipped?=%d\n",
+ __FUNCTION__, pixmap->drawable.serialNumber, n,
rect->x, rect->y, rect->width, rect->height,
drawable->x, drawable->y,
clipped));
r.x1 += dx; r.y1 += dy;
r.x2 += dx; r.y2 += dy;
}
+ DBG(("%s: using fill_one() fast path: (%d, %d), (%d, %d). alu=%d, pixel=%08x\n",
+ __FUNCTION__, r.x1, r.y1, r.x2, r.y2, gc->alu, pixel));
+
if (sna->render.fill_one(sna, pixmap, bo, pixel,
r.x1, r.y1, r.x2, r.y2,
gc->alu)) {
static uint32_t
get_pixel(PixmapPtr pixmap)
{
- DBG(("%s\n", __FUNCTION__));
+ DBG(("%s(pixmap=%ld)\n", __FUNCTION__, pixmap->drawable.serialNumber));
if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ))
return 0;
box.y1 = r->y + drawable->y;
box.x2 = bound(box.x1, r->width);
box.y2 = bound(box.y1, r->height);
+ DBG(("%s: rect=(%d, %d), (%d, %d), box=(%d, %d), (%d, %d)\n", __FUNCTION__,
+ r->x, r->y, r->width, r->height,
+ box.x1, box.y1, box.x2, box.y2));
r++;
c = find_clip_box_for_y(clip_start,
while (c != clip_end) {
BoxRec bb;
+ DBG(("%s: clip=(%d, %d), (%d, %d)\n", __FUNCTION__, c->x1, c->y1, c->x2, c->y2));
+
if (box.y2 <= c->y1)
break;
bb = box;
if (box_intersect(&bb, c++)) {
if (!kgem_check_batch(&sna->kgem, 3)) {
+ DBG(("%s: emitting split batch\n", __FUNCTION__));
_kgem_submit(&sna->kgem);
_kgem_set_mode(&sna->kgem, KGEM_BLT);
assert(bb.x2 + dx <= pixmap->drawable.width);
assert(bb.y2 + dy <= pixmap->drawable.height);
+ DBG(("%s: emit box=(%d, %d),(%d, %d) + (%d, %d), tile=(%d, %d) [relative to drawable: (%d, %d)]\n",
+ __FUNCTION__, bb.x1, bb.y1, bb.x2, bb.y2, dx, dy, tx, ty, bb.x1 - drawable->x, bb.y1 - drawable->y));
+
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
b[0] = br00;
sna->kgem.nbatch = unwind_batch;
sna->kgem.nreloc = unwind_reloc;
if (sna->kgem.nbatch == 0)
- kgem_bo_undo(&sna->kgem, bo);
+ kgem_bo_pair_undo(&sna->kgem, bo, tile_bo);
}
}
done:
static int next8(int x, int max)
{
- switch(x) {
- case 1: return MIN(1, max);
- case 2: return MIN(2, max);
- case 3:
- case 4: return MIN(4, max);
- case 5:
- case 6:
- case 7:
- case 8: return MIN(8, max);
- default: return x;
- }
+ if (x > 2 && x <= 4)
+ x = 4;
+ else if (x < 8)
+ x = 8;
+ return MIN(x, max);
}
static bool
int tile_width, tile_height;
int16_t dx, dy;
- DBG(("%s x %d [(%d, %d)x(%d, %d)...], clipped? %d\n",
- __FUNCTION__, n, rect->x, rect->y, rect->width, rect->height,
+ DBG(("%s pixmap=%ld, x %d [(%d, %d)x(%d, %d)...], clipped? %d\n",
+ __FUNCTION__, pixmap->drawable.serialNumber,
+ n, rect->x, rect->y, rect->width, rect->height,
clipped));
assert(tile->drawable.depth == drawable->depth);
if ((tile_width | tile_height) == 8) {
bool ret;
+ DBG(("%s: have 8x8 tile, using BLT fast path\n", __FUNCTION__));
+
tile_bo = sna_pixmap_get_source_bo(tile);
if (tile_bo == NULL) {
DBG(("%s: unable to move tile go GPU, fallback\n",
if (priv == NULL || priv->gpu_damage == NULL) {
w = next8(extents->x2 - extents->x1, w);
h = next8(extents->y2 - extents->y1, h);
- DBG(("%s: triming size for unattached tile: %dx%d\n",
- __FUNCTION__, w, h));
}
+ DBG(("%s: not 8x8, triming size for tile: %dx%d from %dx%d (area %dx%d)\n",
+ __FUNCTION__, w, h, tile_width, tile_height, extents->x2-extents->x1, extents->y2-extents->y1));
+
if ((w|h) < 0x10 && is_power_of_two(w) && is_power_of_two(h) &&
sna_poly_fill_rect_tiled_nxm_blt(drawable, bo, damage,
gc, n, rect,