sna: Correct typo in checking src extents before performing memcpy

A regression in
commit 6921abd810
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jul 18 16:21:27 2013 +0100

    sna: Add a fast path for the most common fallback for CPU-CPU blits

And add the full set of assertions to validate the memcpy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-07-20 18:08:22 +01:00
parent f915d4a224
commit f39d9ed092
1 changed files with 13 additions and 1 deletions

View File

@ -530,7 +530,7 @@ sna_composite_fb(CARD8 op,
region->extents.x1 + src_x + tx >= 0 &&
region->extents.y1 + src_y + ty >= 0 &&
region->extents.x2 + src_x + tx <= src->pDrawable->width &&
region->extents.x2 + src_y + ty <= src->pDrawable->height) {
region->extents.y2 + src_y + ty <= src->pDrawable->height) {
PixmapPtr dst_pixmap = get_drawable_pixmap(dst->pDrawable);
PixmapPtr src_pixmap = get_drawable_pixmap(src->pDrawable);
int nbox = RegionNumRects(region);
@ -545,6 +545,18 @@ sna_composite_fb(CARD8 op,
dst_x += tx, dst_y += ty;
do {
assert(box->x1 + src_x >= 0);
assert(box->x2 + src_x <= src_pixmap->drawable.width);
assert(box->y1 + src_y >= 0);
assert(box->y2 + src_y <= src_pixmap->drawable.height);
assert(box->x1 + dst_x >= 0);
assert(box->x2 + dst_x <= dst_pixmap->drawable.width);
assert(box->y1 + dst_y >= 0);
assert(box->y2 + dst_y <= dst_pixmap->drawable.height);
assert(box->x2 > box->x1 && box->y2 > box->y1);
memcpy_blt(src_pixmap->devPrivate.ptr,
dst_pixmap->devPrivate.ptr,
dst_pixmap->drawable.bitsPerPixel,