get_drawable_deltas(drawable, pixmap, &dx, &dy);
{
- unsigned px = (0 - gc->patOrg.x - dx) & 7;
- unsigned py = (0 - gc->patOrg.y - dy) & 7;
+ int px, py;
+
+ px = (0 - gc->patOrg.x - drawable->x - dx) % 8;
+ if (px < 0)
+ px += 8;
+
+ py = (0 - gc->patOrg.y - drawable->y - dy) % 8;
+ if (py < 0)
+ py += 8;
DBG(("%s: pat offset (%d, %d)\n", __FUNCTION__ ,px, py));
+
br00 = XY_SCANLINE_BLT | px << 12 | py << 8 | 3 << 20;
br13 = bo->pitch;
if (sna->kgem.gen >= 040 && bo->tiling) {
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_MONO_PAT | (br00 & (BLT_DST_TILED | 0x7<<12 | 0x7<<8)) | 3<<20 | 8;
+ b[0] = XY_MONO_PAT | (br00 & 0x7f00) | 3<<20 | 8;
b[1] = br13;
b[2] = (r->y + dy) << 16 | (r->x + dx);
b[3] = (r->y + r->height + dy) << 16 | (r->x + r->width + dx);
b[9] = pat[1];
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_MONO_PAT | (br00 & (BLT_DST_TILED | 0x7<<12 | 0x7<<8)) | 3<<20 | 7;
+ b[0] = XY_MONO_PAT | (br00 & 0x7f00) | 3<<20 | 7;
b[1] = br13;
b[2] = (r->y + dy) << 16 | (r->x + dx);
b[3] = (r->y + r->height + dy) << 16 | (r->x + r->width + dx);