diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-18 09:38:03 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-18 09:41:24 +0100 |
commit | 88cb1968b6dbf3edfa885da9503e91124af46007 (patch) | |
tree | f51a82c5a7a25d618eb2ff907f2b51d6d8d82855 /src/sna/fb | |
parent | 36f2e46619598e9bca4fe1207aa2f157bfa1ecf4 (diff) |
sna: Add more DBG for fallback processing
Hunting the lost box...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/fb')
-rw-r--r-- | src/sna/fb/fbbitmap.c | 11 | ||||
-rw-r--r-- | src/sna/fb/fbblt.c | 5 | ||||
-rw-r--r-- | src/sna/fb/fbclip.c | 11 | ||||
-rw-r--r-- | src/sna/fb/fbclip.h | 25 | ||||
-rw-r--r-- | src/sna/fb/fbfill.c | 30 | ||||
-rw-r--r-- | src/sna/fb/fbtile.c | 27 |
6 files changed, 53 insertions, 56 deletions
diff --git a/src/sna/fb/fbbitmap.c b/src/sna/fb/fbbitmap.c index fa5d0320..07587280 100644 --- a/src/sna/fb/fbbitmap.c +++ b/src/sna/fb/fbbitmap.c @@ -37,6 +37,11 @@ static inline void add(RegionPtr region, r->x1 = x1; r->y1 = y1; r->x2 = x2; r->y2 = y2; + DBG(("%s[%d/%d]: (%d, %d), (%d, %d)\n", + __FUNCTION__, + region->data->numRects, region->data->size, + x1, y1, x2, y2)); + if (x1 < region->extents.x1) region->extents.x1 = x1; if (x2 > region->extents.x2) @@ -138,5 +143,11 @@ fbBitmapToRegion(PixmapPtr pixmap) } else region->extents.x1 = region->extents.x2 = 0; + DBG(("%s: region extents=(%d, %d), (%d, %d) x %d\n", + __FUNCTION__, + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2, + RegionNumRects(region))); + return region; } diff --git a/src/sna/fb/fbblt.c b/src/sna/fb/fbblt.c index fd55c85a..3b3fa485 100644 --- a/src/sna/fb/fbblt.c +++ b/src/sna/fb/fbblt.c @@ -285,7 +285,10 @@ fbBlt(FbBits *srcLine, FbStride srcStride, int srcX, s += srcX >> 3; d += dstX >> 3; - DBG(("%s fast blt\n", __FUNCTION__)); + DBG(("%s fast blt, src_stride=%d, dst_stride=%d, width=%d (offset=%d)\n", + __FUNCTION__, + srcStride, dstStride, width, + srcLine - dstLine)); if ((srcLine < dstLine && srcLine + width > dstLine) || (dstLine < srcLine && dstLine + width > srcLine)) diff --git a/src/sna/fb/fbclip.c b/src/sna/fb/fbclip.c index 8d9c4dbe..5a71b0cf 100644 --- a/src/sna/fb/fbclip.c +++ b/src/sna/fb/fbclip.c @@ -76,11 +76,16 @@ fbClipBoxes(const RegionRec *region, const BoxRec *box, const BoxRec **end) c0 = (const BoxRec *)region->data + 1; c1 = c0 + region->data->numRects; - if (c0->y2 <= box->y1) + if (c0->y2 <= box->y1) { + DBG(("%s: first clip (%d, %d), (%d, %d) before box (%d, %d), (%d, %d)\n", + __FUNCTION__, + c0->x1, c0->y1, c0->x2, c0->y2, + box->x1, box->y1, box->x2, box->y2)); c0 = find_clip_row_for_y(c0, c1, box->y1); + } - DBG(("%s: c0=(%d, %d),(%d, %d)\n", - __FUNCTION__, c0->x1, c0->y1, c0->x2, c0->y2)); + DBG(("%s: c0=(%d, %d),(%d, %d) x %ld\n", + __FUNCTION__, c0->x1, c0->y1, c0->x2, c0->y2, c1 - c0)); *end = c1; return c0; diff --git a/src/sna/fb/fbclip.h b/src/sna/fb/fbclip.h index feb2d2c4..f07e63ca 100644 --- a/src/sna/fb/fbclip.h +++ b/src/sna/fb/fbclip.h @@ -46,6 +46,13 @@ box_intersect(BoxPtr a, const BoxRec *b) return a->x1 < a->x2 && a->y1 < a->y2; } +#define run_box(b, c) \ + DBG(("%s: box=(%d, %d), (%d, %d), clip=(%d, %d), (%d, %d)\n", \ + __FUNCTION__, (b)->x1, (b)->y1, (b)->x2, (b)->y2, (c)->x1, (c)->y1, (c)->x2, (c)->y2)); \ + if ((b)->y2 <= (c)->y1) break; \ + if ((b)->x1 >= (c)->x2) continue; \ + if ((b)->x2 <= (c)->x1) { if ((b)->y2 <= (c)->y2) break; continue; } + static inline void fbDrawableRun(DrawablePtr d, GCPtr gc, const BoxRec *box, void (*func)(DrawablePtr, GCPtr, const BoxRec *b, void *data), @@ -55,14 +62,7 @@ fbDrawableRun(DrawablePtr d, GCPtr gc, const BoxRec *box, for (c = fbClipBoxes(gc->pCompositeClip, box, &end); c != end; c++) { BoxRec b; - if (box->x1 >= c->x2) - continue; - if (box->x2 <= c->x1) { - if (box->y2 <= c->y2) - break; - else - continue; - } + run_box(box, c); b = *box; if (box_intersect(&b, c)) @@ -77,14 +77,7 @@ fbDrawableRunUnclipped(DrawablePtr d, GCPtr gc, const BoxRec *box, { const BoxRec *c, *end; for (c = fbClipBoxes(gc->pCompositeClip, box, &end); c != end; c++) { - if (box->x1 >= c->x2) - continue; - if (box->x2 <= c->x1) { - if (box->y2 <= c->y2) - break; - else - continue; - } + run_box(box, c); func(d, gc, c, data); } } diff --git a/src/sna/fb/fbfill.c b/src/sna/fb/fbfill.c index 3df1f9c8..a9ae2bcd 100644 --- a/src/sna/fb/fbfill.c +++ b/src/sna/fb/fbfill.c @@ -141,28 +141,14 @@ fbFill(DrawablePtr drawable, GCPtr gc, int x, int y, int width, int height) case FillTiled: { - PixmapPtr pTile = gc->tile.pixmap; - FbBits *tile; - FbStride tileStride; - int tileBpp; - int tileWidth; - int tileHeight; - _X_UNUSED int tileXoff, tileYoff; - - fbGetDrawable(&pTile->drawable, tile, - tileStride, tileBpp, tileXoff, tileYoff); - tileWidth = pTile->drawable.width; - tileHeight = pTile->drawable.height; - fbTile(dst + (y + dstYoff) * dstStride, - dstStride, - (x + dstXoff) * dstBpp, - width * dstBpp, height, - tile, - tileStride, - tileWidth * tileBpp, - tileHeight, - gc->alu, pgc->pm, - dstBpp, + PixmapPtr tile = gc->tile.pixmap; + + fbTile(dst + (y + dstYoff) * dstStride, dstStride, + (x + dstXoff) * dstBpp, width * dstBpp, height, + tile->devPrivate.ptr, tile->devKind / sizeof(FbBits), + tile->drawable.width * tile->drawable.bitsPerPixel, + tile->drawable.height, + gc->alu, pgc->pm, dstBpp, (gc->patOrg.x + drawable->x + dstXoff) * dstBpp, gc->patOrg.y + drawable->y - y); break; diff --git a/src/sna/fb/fbtile.c b/src/sna/fb/fbtile.c index 5586553e..c3506716 100644 --- a/src/sna/fb/fbtile.c +++ b/src/sna/fb/fbtile.c @@ -99,30 +99,29 @@ fbOddTile(FbBits *dst, FbStride dstStride, int dstX, int xRot, int yRot) { int tileX, tileY; - int widthTmp; - int h, w; int x, y; + DBG(("%s tile=%dx%d, size=%dx%d\n", __FUNCTION__, + tileWidth, tileHeight, width, height)); + modulus(-yRot, tileHeight, tileY); y = 0; while (height) { - h = tileHeight - tileY; + int ww = width; + int h = tileHeight - tileY; if (h > height) h = height; height -= h; - widthTmp = width; x = dstX; modulus(dstX - xRot, tileWidth, tileX); - while (widthTmp) { - w = tileWidth - tileX; - if (w > widthTmp) - w = widthTmp; - widthTmp -= w; - fbBlt(tile + tileY * tileStride, - tileStride, - tileX, - dst + y * dstStride, - dstStride, x, w, h, alu, pm, bpp, FALSE, FALSE); + while (ww) { + int w = tileWidth - tileX; + if (w > ww) + w = ww; + ww -= w; + fbBlt(tile + tileY * tileStride, tileStride, tileX, + dst + y * dstStride, dstStride, + x, w, h, alu, pm, bpp, FALSE, FALSE); x += w; tileX = 0; } |