sna: Fix comparison of memcpy overlap to include x-offsets

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-09-04 23:52:42 +01:00
parent 7895416eab
commit 19e170aa6f
1 changed files with 7 additions and 8 deletions

View File

@ -287,19 +287,18 @@ fbBlt(FbBits *srcLine, FbStride srcStride, int srcX,
DBG(("%s fast blt, src_stride=%d, dst_stride=%d, width=%d (offset=%d)\n",
__FUNCTION__,
srcStride, dstStride, width,
srcLine - dstLine));
srcStride, dstStride, width, s - d));
if ((srcLine < dstLine && srcLine + width > dstLine) ||
(dstLine < srcLine && dstLine + width > srcLine))
if (width == srcStride && width == dstStride) {
width *= height;
height = 1;
}
if ((s < d && s + width > d) || (d < s && d + width > s))
func = memmove;
else
func = memcpy;
if (!upsidedown) {
if (srcStride == dstStride && srcStride == width) {
width *= height;
height = 1;
}
for (i = 0; i < height; i++)
func(d + i * dstStride,
s + i * srcStride,