sna: Add some more debugging to find the source of a read-boxes error

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-28 10:56:57 +00:00
parent 3bf81241cb
commit 337635ab97
1 changed files with 14 additions and 0 deletions

View File

@ -100,6 +100,20 @@ void sna_read_boxes(struct sna *sna,
__FUNCTION__, nbox, src_bo->handle, src_dx, src_dy,
dst->drawable.width, dst->drawable.height, dst_dx, dst_dy));
#ifndef NDEBUG
for (n = 0; n < nbox; n++) {
if (box[n].x1 + src_dx < 0 || box[n].y1 + src_dy < 0 ||
(box[n].x2 + src_dx) * dst->drawable.bitsPerPixel/8 > src_bo->pitch ||
(box[n].y2 + src_dy) * src_bo->pitch > src_bo->size)
{
FatalError("source out-of-bounds box[%d]=(%d, %d), (%d, %d) + (%d, %d), pitch=%d, size=%d\n",
box[n].x1, box[n].y1,
box[n].x2, box[n].y2,
src_bo->pitch, src_bo->size);
}
}
#endif
if (DEBUG_NO_IO || kgem->wedged || src_bo->tiling == I915_TILING_Y) {
read_boxes_inplace(kgem,
src_bo, src_dx, src_dy,