2003-11-14 17:48:57 +01:00
|
|
|
/*
|
2004-12-04 01:43:13 +01:00
|
|
|
* Copyright © 1998 Keith Packard
|
2003-11-14 17:48:57 +01:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
* the above copyright notice appear in all copies and that both that
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
* documentation, and that the name of Keith Packard not be used in
|
|
|
|
* advertising or publicity pertaining to distribution of the software without
|
|
|
|
* specific, written prior permission. Keith Packard makes no
|
|
|
|
* representations about the suitability of this software for any purpose. It
|
|
|
|
* is provided "as is" without express or implied warranty.
|
|
|
|
*
|
|
|
|
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
|
|
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
|
|
|
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
|
|
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
|
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2006-02-11 20:16:51 +01:00
|
|
|
#include <string.h>
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "fb.h"
|
|
|
|
|
|
|
|
#define InitializeShifts(sx,dx,ls,rs) { \
|
|
|
|
if (sx != dx) { \
|
|
|
|
if (sx > dx) { \
|
|
|
|
ls = sx - dx; \
|
|
|
|
rs = FB_UNIT - ls; \
|
|
|
|
} else { \
|
|
|
|
rs = dx - sx; \
|
|
|
|
ls = FB_UNIT - rs; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
fbBlt(FbBits * srcLine,
|
|
|
|
FbStride srcStride,
|
|
|
|
int srcX,
|
|
|
|
FbBits * dstLine,
|
|
|
|
FbStride dstStride,
|
|
|
|
int dstX,
|
|
|
|
int width,
|
|
|
|
int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
FbBits *src, *dst;
|
|
|
|
int leftShift, rightShift;
|
|
|
|
FbBits startmask, endmask;
|
|
|
|
FbBits bits, bits1;
|
|
|
|
int n, nmiddle;
|
|
|
|
Bool destInvarient;
|
|
|
|
int startbyte, endbyte;
|
|
|
|
|
|
|
|
FbDeclareMergeRop();
|
|
|
|
|
fb: fix fast-path blt detection
The width parameter is used to disable the blit fast-path (memcpy) when
source and destination rows overlap in memory. This check was added in [0].
Unfortunately, the calculation to determine if source and destination
lines overlapped was incorrect:
(1) it converts width from pixels to bytes, but width is actually in
bits, not pixels.
(2) it adds this byte offset to dst/srcLine, which implicitly converts
the offset from bytes to sizeof(FbBits).
Fix both of these by converting addresses to byte pointers and width
to bytes and doing comparisons on the resulting byte address.
For example:
A 32-bpp 1366 pixel-wide row will have
width = 1366 * 32 = 43712 bits
bpp = 32
(bpp >> 3) = 4
width * (bpp >> 3) = 174848 FbBits
(FbBits *)width => 699392 bytes
So, "careful" was true if the destination line was within 699392 bytes,
instead of just within its 1366 * 4 = 5464 byte row.
This bug causes us to take the slow path for large non-overlapping rows
that are "close" in memory. As a data point, XGetImage(1366x768) on my
ARM chromebook was taking ~140 ms, but with this fixed, it now takes
about 60 ms.
XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()
[0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
Author: Adam Jackson <ajax@redhat.com>
Date: Thu Apr 21 16:37:11 2011 -0400
fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right. That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption. Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)
v3: Convert to byte units
This first checks to make sure the blt is byte aligned, converts all
of the data to byte units and then compares for byte address range
overlap between source and dest.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2014-03-25 16:21:16 +01:00
|
|
|
if (alu == GXcopy && pm == FB_ALLONES &&
|
|
|
|
!(srcX & 7) && !(dstX & 7) && !(width & 7))
|
|
|
|
{
|
|
|
|
CARD8 *src_byte = (CARD8 *) srcLine + (srcX >> 3);
|
|
|
|
CARD8 *dst_byte = (CARD8 *) dstLine + (dstX >> 3);
|
|
|
|
FbStride src_byte_stride = srcStride << (FB_SHIFT - 3);
|
|
|
|
FbStride dst_byte_stride = dstStride << (FB_SHIFT - 3);
|
|
|
|
int width_byte = (width >> 3);
|
2006-01-18 20:42:56 +01:00
|
|
|
|
fb: fix fast-path blt detection
The width parameter is used to disable the blit fast-path (memcpy) when
source and destination rows overlap in memory. This check was added in [0].
Unfortunately, the calculation to determine if source and destination
lines overlapped was incorrect:
(1) it converts width from pixels to bytes, but width is actually in
bits, not pixels.
(2) it adds this byte offset to dst/srcLine, which implicitly converts
the offset from bytes to sizeof(FbBits).
Fix both of these by converting addresses to byte pointers and width
to bytes and doing comparisons on the resulting byte address.
For example:
A 32-bpp 1366 pixel-wide row will have
width = 1366 * 32 = 43712 bits
bpp = 32
(bpp >> 3) = 4
width * (bpp >> 3) = 174848 FbBits
(FbBits *)width => 699392 bytes
So, "careful" was true if the destination line was within 699392 bytes,
instead of just within its 1366 * 4 = 5464 byte row.
This bug causes us to take the slow path for large non-overlapping rows
that are "close" in memory. As a data point, XGetImage(1366x768) on my
ARM chromebook was taking ~140 ms, but with this fixed, it now takes
about 60 ms.
XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()
[0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
Author: Adam Jackson <ajax@redhat.com>
Date: Thu Apr 21 16:37:11 2011 -0400
fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right. That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption. Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)
v3: Convert to byte units
This first checks to make sure the blt is byte aligned, converts all
of the data to byte units and then compares for byte address range
overlap between source and dest.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2014-03-25 16:21:16 +01:00
|
|
|
/* Make sure there's no overlap; we can't use memcpy in that
|
|
|
|
* case as it's not well defined, so fall through to the
|
|
|
|
* general code
|
|
|
|
*/
|
|
|
|
if (src_byte + width_byte <= dst_byte ||
|
|
|
|
dst_byte + width_byte <= src_byte)
|
|
|
|
{
|
|
|
|
int i;
|
2011-04-21 22:37:11 +02:00
|
|
|
|
fb: fix fast-path blt detection
The width parameter is used to disable the blit fast-path (memcpy) when
source and destination rows overlap in memory. This check was added in [0].
Unfortunately, the calculation to determine if source and destination
lines overlapped was incorrect:
(1) it converts width from pixels to bytes, but width is actually in
bits, not pixels.
(2) it adds this byte offset to dst/srcLine, which implicitly converts
the offset from bytes to sizeof(FbBits).
Fix both of these by converting addresses to byte pointers and width
to bytes and doing comparisons on the resulting byte address.
For example:
A 32-bpp 1366 pixel-wide row will have
width = 1366 * 32 = 43712 bits
bpp = 32
(bpp >> 3) = 4
width * (bpp >> 3) = 174848 FbBits
(FbBits *)width => 699392 bytes
So, "careful" was true if the destination line was within 699392 bytes,
instead of just within its 1366 * 4 = 5464 byte row.
This bug causes us to take the slow path for large non-overlapping rows
that are "close" in memory. As a data point, XGetImage(1366x768) on my
ARM chromebook was taking ~140 ms, but with this fixed, it now takes
about 60 ms.
XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()
[0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
Author: Adam Jackson <ajax@redhat.com>
Date: Thu Apr 21 16:37:11 2011 -0400
fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right. That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption. Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)
v3: Convert to byte units
This first checks to make sure the blt is byte aligned, converts all
of the data to byte units and then compares for byte address range
overlap between source and dest.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2014-03-25 16:21:16 +01:00
|
|
|
if (!upsidedown)
|
|
|
|
for (i = 0; i < height; i++)
|
|
|
|
MEMCPY_WRAPPED(dst_byte + i * dst_byte_stride,
|
|
|
|
src_byte + i * src_byte_stride,
|
|
|
|
width_byte);
|
|
|
|
else
|
|
|
|
for (i = height - 1; i >= 0; i--)
|
|
|
|
MEMCPY_WRAPPED(dst_byte + i * dst_byte_stride,
|
|
|
|
src_byte + i * src_byte_stride,
|
|
|
|
width_byte);
|
2011-04-21 22:37:11 +02:00
|
|
|
|
fb: fix fast-path blt detection
The width parameter is used to disable the blit fast-path (memcpy) when
source and destination rows overlap in memory. This check was added in [0].
Unfortunately, the calculation to determine if source and destination
lines overlapped was incorrect:
(1) it converts width from pixels to bytes, but width is actually in
bits, not pixels.
(2) it adds this byte offset to dst/srcLine, which implicitly converts
the offset from bytes to sizeof(FbBits).
Fix both of these by converting addresses to byte pointers and width
to bytes and doing comparisons on the resulting byte address.
For example:
A 32-bpp 1366 pixel-wide row will have
width = 1366 * 32 = 43712 bits
bpp = 32
(bpp >> 3) = 4
width * (bpp >> 3) = 174848 FbBits
(FbBits *)width => 699392 bytes
So, "careful" was true if the destination line was within 699392 bytes,
instead of just within its 1366 * 4 = 5464 byte row.
This bug causes us to take the slow path for large non-overlapping rows
that are "close" in memory. As a data point, XGetImage(1366x768) on my
ARM chromebook was taking ~140 ms, but with this fixed, it now takes
about 60 ms.
XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()
[0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
Author: Adam Jackson <ajax@redhat.com>
Date: Thu Apr 21 16:37:11 2011 -0400
fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right. That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption. Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)
v3: Convert to byte units
This first checks to make sure the blt is byte aligned, converts all
of the data to byte units and then compares for byte address range
overlap between source and dest.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2014-03-25 16:21:16 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2006-01-18 20:42:56 +01:00
|
|
|
|
fb: fix fast-path blt detection
The width parameter is used to disable the blit fast-path (memcpy) when
source and destination rows overlap in memory. This check was added in [0].
Unfortunately, the calculation to determine if source and destination
lines overlapped was incorrect:
(1) it converts width from pixels to bytes, but width is actually in
bits, not pixels.
(2) it adds this byte offset to dst/srcLine, which implicitly converts
the offset from bytes to sizeof(FbBits).
Fix both of these by converting addresses to byte pointers and width
to bytes and doing comparisons on the resulting byte address.
For example:
A 32-bpp 1366 pixel-wide row will have
width = 1366 * 32 = 43712 bits
bpp = 32
(bpp >> 3) = 4
width * (bpp >> 3) = 174848 FbBits
(FbBits *)width => 699392 bytes
So, "careful" was true if the destination line was within 699392 bytes,
instead of just within its 1366 * 4 = 5464 byte row.
This bug causes us to take the slow path for large non-overlapping rows
that are "close" in memory. As a data point, XGetImage(1366x768) on my
ARM chromebook was taking ~140 ms, but with this fixed, it now takes
about 60 ms.
XGetImage() -> exaGetImage() -> fbGetImage -> fbBlt()
[0] commit e32cc0b4c85c78cd8743a6e1680dcc79054b57ce
Author: Adam Jackson <ajax@redhat.com>
Date: Thu Apr 21 16:37:11 2011 -0400
fb: Fix memcpy abuse
The memcpy fast path implicitly assumes that the copy walks
left-to-right. That's not something memcpy guarantees, and newer glibc
on some processors will indeed break that assumption. Since we walk a
line at a time, check the source and destination against the width of
the blit to determine whether we can be sloppy enough to allow memcpy.
(Having done this, we can remove the check for !reverse as well.)
v3: Convert to byte units
This first checks to make sure the blt is byte aligned, converts all
of the data to byte units and then compares for byte address range
overlap between source and dest.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
2014-03-25 16:21:16 +01:00
|
|
|
if (bpp == 24 && !FbCheck24Pix(pm)) {
|
|
|
|
fbBlt24(srcLine, srcStride, srcX, dstLine, dstStride, dstX,
|
|
|
|
width, height, alu, pm, reverse, upsidedown);
|
2006-01-18 20:42:56 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
FbInitializeMergeRop(alu, pm);
|
|
|
|
destInvarient = FbDestInvarientMergeRop();
|
2012-03-21 20:55:09 +01:00
|
|
|
if (upsidedown) {
|
|
|
|
srcLine += (height - 1) * (srcStride);
|
|
|
|
dstLine += (height - 1) * (dstStride);
|
|
|
|
srcStride = -srcStride;
|
|
|
|
dstStride = -dstStride;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
FbMaskBitsBytes(dstX, width, destInvarient, startmask, startbyte,
|
|
|
|
nmiddle, endmask, endbyte);
|
|
|
|
if (reverse) {
|
|
|
|
srcLine += ((srcX + width - 1) >> FB_SHIFT) + 1;
|
|
|
|
dstLine += ((dstX + width - 1) >> FB_SHIFT) + 1;
|
|
|
|
srcX = (srcX + width - 1) & FB_MASK;
|
|
|
|
dstX = (dstX + width - 1) & FB_MASK;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
srcLine += srcX >> FB_SHIFT;
|
|
|
|
dstLine += dstX >> FB_SHIFT;
|
|
|
|
srcX &= FB_MASK;
|
|
|
|
dstX &= FB_MASK;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
if (srcX == dstX) {
|
|
|
|
while (height--) {
|
|
|
|
src = srcLine;
|
|
|
|
srcLine += srcStride;
|
|
|
|
dst = dstLine;
|
|
|
|
dstLine += dstStride;
|
|
|
|
if (reverse) {
|
|
|
|
if (endmask) {
|
|
|
|
bits = READ(--src);
|
|
|
|
--dst;
|
|
|
|
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
|
|
|
|
}
|
|
|
|
n = nmiddle;
|
|
|
|
if (destInvarient) {
|
|
|
|
while (n--)
|
|
|
|
WRITE(--dst, FbDoDestInvarientMergeRop(READ(--src)));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
while (n--) {
|
|
|
|
bits = READ(--src);
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMergeRop(bits, READ(dst)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (startmask) {
|
|
|
|
bits = READ(--src);
|
|
|
|
--dst;
|
|
|
|
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (startmask) {
|
|
|
|
bits = READ(src++);
|
|
|
|
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
n = nmiddle;
|
|
|
|
if (destInvarient) {
|
2003-11-14 17:48:57 +01:00
|
|
|
#if 0
|
2012-03-21 20:55:09 +01:00
|
|
|
/*
|
|
|
|
* This provides some speedup on screen->screen blts
|
|
|
|
* over the PCI bus, usually about 10%. But fb
|
|
|
|
* isn't usually used for this operation...
|
|
|
|
*/
|
|
|
|
if (_ca2 + 1 == 0 && _cx2 == 0) {
|
|
|
|
FbBits t1, t2, t3, t4;
|
|
|
|
|
|
|
|
while (n >= 4) {
|
|
|
|
t1 = *src++;
|
|
|
|
t2 = *src++;
|
|
|
|
t3 = *src++;
|
|
|
|
t4 = *src++;
|
|
|
|
*dst++ = t1;
|
|
|
|
*dst++ = t2;
|
|
|
|
*dst++ = t3;
|
|
|
|
*dst++ = t4;
|
|
|
|
n -= 4;
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
while (n--)
|
|
|
|
WRITE(dst++, FbDoDestInvarientMergeRop(READ(src++)));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
while (n--) {
|
|
|
|
bits = READ(src++);
|
|
|
|
WRITE(dst, FbDoMergeRop(bits, READ(dst)));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (endmask) {
|
|
|
|
bits = READ(src);
|
|
|
|
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
if (srcX > dstX) {
|
|
|
|
leftShift = srcX - dstX;
|
|
|
|
rightShift = FB_UNIT - leftShift;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
rightShift = dstX - srcX;
|
|
|
|
leftShift = FB_UNIT - rightShift;
|
|
|
|
}
|
|
|
|
while (height--) {
|
|
|
|
src = srcLine;
|
|
|
|
srcLine += srcStride;
|
|
|
|
dst = dstLine;
|
|
|
|
dstLine += dstStride;
|
|
|
|
|
|
|
|
bits1 = 0;
|
|
|
|
if (reverse) {
|
|
|
|
if (srcX < dstX)
|
|
|
|
bits1 = READ(--src);
|
|
|
|
if (endmask) {
|
|
|
|
bits = FbScrRight(bits1, rightShift);
|
|
|
|
if (FbScrRight(endmask, leftShift)) {
|
|
|
|
bits1 = READ(--src);
|
|
|
|
bits |= FbScrLeft(bits1, leftShift);
|
|
|
|
}
|
|
|
|
--dst;
|
|
|
|
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
|
|
|
|
}
|
|
|
|
n = nmiddle;
|
|
|
|
if (destInvarient) {
|
|
|
|
while (n--) {
|
|
|
|
bits = FbScrRight(bits1, rightShift);
|
|
|
|
bits1 = READ(--src);
|
|
|
|
bits |= FbScrLeft(bits1, leftShift);
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoDestInvarientMergeRop(bits));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
while (n--) {
|
|
|
|
bits = FbScrRight(bits1, rightShift);
|
|
|
|
bits1 = READ(--src);
|
|
|
|
bits |= FbScrLeft(bits1, leftShift);
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMergeRop(bits, READ(dst)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (startmask) {
|
|
|
|
bits = FbScrRight(bits1, rightShift);
|
|
|
|
if (FbScrRight(startmask, leftShift)) {
|
|
|
|
bits1 = READ(--src);
|
|
|
|
bits |= FbScrLeft(bits1, leftShift);
|
|
|
|
}
|
|
|
|
--dst;
|
|
|
|
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (srcX > dstX)
|
|
|
|
bits1 = READ(src++);
|
|
|
|
if (startmask) {
|
|
|
|
bits = FbScrLeft(bits1, leftShift);
|
|
|
|
if (FbScrLeft(startmask, rightShift)) {
|
|
|
|
bits1 = READ(src++);
|
|
|
|
bits |= FbScrRight(bits1, rightShift);
|
|
|
|
}
|
|
|
|
FbDoLeftMaskByteMergeRop(dst, bits, startbyte, startmask);
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
n = nmiddle;
|
|
|
|
if (destInvarient) {
|
|
|
|
while (n--) {
|
|
|
|
bits = FbScrLeft(bits1, leftShift);
|
|
|
|
bits1 = READ(src++);
|
|
|
|
bits |= FbScrRight(bits1, rightShift);
|
|
|
|
WRITE(dst, FbDoDestInvarientMergeRop(bits));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
while (n--) {
|
|
|
|
bits = FbScrLeft(bits1, leftShift);
|
|
|
|
bits1 = READ(src++);
|
|
|
|
bits |= FbScrRight(bits1, rightShift);
|
|
|
|
WRITE(dst, FbDoMergeRop(bits, READ(dst)));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (endmask) {
|
|
|
|
bits = FbScrLeft(bits1, leftShift);
|
|
|
|
if (FbScrLeft(endmask, rightShift)) {
|
|
|
|
bits1 = READ(src);
|
|
|
|
bits |= FbScrRight(bits1, rightShift);
|
|
|
|
}
|
|
|
|
FbDoRightMaskByteMergeRop(dst, bits, endbyte, endmask);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef DEBUG_BLT24
|
|
|
|
#ifdef DEBUG_BLT24
|
|
|
|
|
|
|
|
static unsigned long
|
2012-03-21 20:55:09 +01:00
|
|
|
getPixel(char *src, int x)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
unsigned long l;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
l = 0;
|
2012-03-21 20:55:09 +01:00
|
|
|
memcpy(&l, src + x * 3, 3);
|
2003-11-14 17:48:57 +01:00
|
|
|
return l;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
fbBlt24Line(FbBits * src,
|
|
|
|
int srcX,
|
|
|
|
FbBits * dst, int dstX, int width, int alu, FbBits pm, Bool reverse)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
#ifdef DEBUG_BLT24
|
2012-03-21 20:55:09 +01:00
|
|
|
char *origDst = (char *) dst;
|
|
|
|
FbBits *origLine = dst + ((dstX >> FB_SHIFT) - 1);
|
|
|
|
int origNlw = ((width + FB_MASK) >> FB_SHIFT) + 3;
|
|
|
|
int origX = dstX / 24;
|
2003-11-14 17:48:57 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
|
|
|
|
int leftShift, rightShift;
|
|
|
|
FbBits startmask, endmask;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
FbBits bits, bits1;
|
|
|
|
FbBits mask;
|
|
|
|
|
|
|
|
int rot;
|
|
|
|
|
|
|
|
FbDeclareMergeRop();
|
|
|
|
|
|
|
|
FbInitializeMergeRop(alu, FB_ALLONES);
|
2003-11-14 17:48:57 +01:00
|
|
|
FbMaskBits(dstX, width, startmask, n, endmask);
|
|
|
|
#ifdef DEBUG_BLT24
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("dstX %d width %d reverse %d\n", dstX, width, reverse);
|
2003-11-14 17:48:57 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
if (reverse) {
|
|
|
|
src += ((srcX + width - 1) >> FB_SHIFT) + 1;
|
|
|
|
dst += ((dstX + width - 1) >> FB_SHIFT) + 1;
|
|
|
|
rot = FbFirst24Rot(((dstX + width - 8) & FB_MASK));
|
|
|
|
rot = FbPrev24Rot(rot);
|
2003-11-14 17:48:57 +01:00
|
|
|
#ifdef DEBUG_BLT24
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("dstX + width - 8: %d rot: %d\n", (dstX + width - 8) & FB_MASK,
|
|
|
|
rot);
|
2003-11-14 17:48:57 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
srcX = (srcX + width - 1) & FB_MASK;
|
|
|
|
dstX = (dstX + width - 1) & FB_MASK;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
src += srcX >> FB_SHIFT;
|
|
|
|
dst += dstX >> FB_SHIFT;
|
|
|
|
srcX &= FB_MASK;
|
|
|
|
dstX &= FB_MASK;
|
|
|
|
rot = FbFirst24Rot(dstX);
|
2003-11-14 17:48:57 +01:00
|
|
|
#ifdef DEBUG_BLT24
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("dstX: %d rot: %d\n", dstX, rot);
|
2003-11-14 17:48:57 +01:00
|
|
|
#endif
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
mask = FbRot24(pm, rot);
|
2003-11-14 17:48:57 +01:00
|
|
|
#ifdef DEBUG_BLT24
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("pm 0x%x mask 0x%x\n", pm, mask);
|
2003-11-14 17:48:57 +01:00
|
|
|
#endif
|
2012-03-21 20:55:09 +01:00
|
|
|
if (srcX == dstX) {
|
|
|
|
if (reverse) {
|
|
|
|
if (endmask) {
|
|
|
|
bits = READ(--src);
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
|
|
|
|
mask = FbPrev24Pix(mask);
|
|
|
|
}
|
|
|
|
while (n--) {
|
|
|
|
bits = READ(--src);
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
|
|
|
|
mask = FbPrev24Pix(mask);
|
|
|
|
}
|
|
|
|
if (startmask) {
|
|
|
|
bits = READ(--src);
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (startmask) {
|
|
|
|
bits = READ(src++);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
|
|
|
|
dst++;
|
|
|
|
mask = FbNext24Pix(mask);
|
|
|
|
}
|
|
|
|
while (n--) {
|
|
|
|
bits = READ(src++);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
|
|
|
|
dst++;
|
|
|
|
mask = FbNext24Pix(mask);
|
|
|
|
}
|
|
|
|
if (endmask) {
|
|
|
|
bits = READ(src);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
if (srcX > dstX) {
|
|
|
|
leftShift = srcX - dstX;
|
|
|
|
rightShift = FB_UNIT - leftShift;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
rightShift = dstX - srcX;
|
|
|
|
leftShift = FB_UNIT - rightShift;
|
|
|
|
}
|
|
|
|
|
|
|
|
bits1 = 0;
|
|
|
|
if (reverse) {
|
|
|
|
if (srcX < dstX)
|
|
|
|
bits1 = READ(--src);
|
|
|
|
if (endmask) {
|
|
|
|
bits = FbScrRight(bits1, rightShift);
|
|
|
|
if (FbScrRight(endmask, leftShift)) {
|
|
|
|
bits1 = READ(--src);
|
|
|
|
bits |= FbScrLeft(bits1, leftShift);
|
|
|
|
}
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
|
|
|
|
mask = FbPrev24Pix(mask);
|
|
|
|
}
|
|
|
|
while (n--) {
|
|
|
|
bits = FbScrRight(bits1, rightShift);
|
|
|
|
bits1 = READ(--src);
|
|
|
|
bits |= FbScrLeft(bits1, leftShift);
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
|
|
|
|
mask = FbPrev24Pix(mask);
|
|
|
|
}
|
|
|
|
if (startmask) {
|
|
|
|
bits = FbScrRight(bits1, rightShift);
|
|
|
|
if (FbScrRight(startmask, leftShift)) {
|
|
|
|
bits1 = READ(--src);
|
|
|
|
bits |= FbScrLeft(bits1, leftShift);
|
|
|
|
}
|
|
|
|
--dst;
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (srcX > dstX)
|
|
|
|
bits1 = READ(src++);
|
|
|
|
if (startmask) {
|
|
|
|
bits = FbScrLeft(bits1, leftShift);
|
|
|
|
bits1 = READ(src++);
|
|
|
|
bits |= FbScrRight(bits1, rightShift);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & startmask));
|
|
|
|
dst++;
|
|
|
|
mask = FbNext24Pix(mask);
|
|
|
|
}
|
|
|
|
while (n--) {
|
|
|
|
bits = FbScrLeft(bits1, leftShift);
|
|
|
|
bits1 = READ(src++);
|
|
|
|
bits |= FbScrRight(bits1, rightShift);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask));
|
|
|
|
dst++;
|
|
|
|
mask = FbNext24Pix(mask);
|
|
|
|
}
|
|
|
|
if (endmask) {
|
|
|
|
bits = FbScrLeft(bits1, leftShift);
|
|
|
|
if (FbScrLeft(endmask, rightShift)) {
|
|
|
|
bits1 = READ(src);
|
|
|
|
bits |= FbScrRight(bits1, rightShift);
|
|
|
|
}
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), mask & endmask));
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
#ifdef DEBUG_BLT24
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int firstx, lastx, x;
|
|
|
|
|
|
|
|
firstx = origX;
|
|
|
|
if (firstx)
|
|
|
|
firstx--;
|
|
|
|
lastx = origX + width / 24 + 1;
|
|
|
|
for (x = firstx; x <= lastx; x++)
|
|
|
|
ErrorF("%06x ", getPixel(origDst, x));
|
|
|
|
ErrorF("\n");
|
|
|
|
while (origNlw--)
|
|
|
|
ErrorF("%08x ", *origLine++);
|
|
|
|
ErrorF("\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
fbBlt24(FbBits * srcLine,
|
|
|
|
FbStride srcStride,
|
|
|
|
int srcX,
|
|
|
|
FbBits * dstLine,
|
|
|
|
FbStride dstStride,
|
|
|
|
int dstX,
|
|
|
|
int width,
|
|
|
|
int height, int alu, FbBits pm, Bool reverse, Bool upsidedown)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
if (upsidedown) {
|
|
|
|
srcLine += (height - 1) * srcStride;
|
|
|
|
dstLine += (height - 1) * dstStride;
|
|
|
|
srcStride = -srcStride;
|
|
|
|
dstStride = -dstStride;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
while (height--) {
|
|
|
|
fbBlt24Line(srcLine, srcX, dstLine, dstX, width, alu, pm, reverse);
|
|
|
|
srcLine += srcStride;
|
|
|
|
dstLine += dstStride;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
#ifdef DEBUG_BLT24
|
2012-03-21 20:55:09 +01:00
|
|
|
ErrorF("\n");
|
2003-11-14 17:48:57 +01:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#if FB_SHIFT == FB_STIP_SHIFT + 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Could be generalized to FB_SHIFT > FB_STIP_SHIFT + 1 by
|
|
|
|
* creating an ring of values stepped through for each line
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
fbBltOdd(FbBits * srcLine,
|
|
|
|
FbStride srcStrideEven,
|
|
|
|
FbStride srcStrideOdd,
|
|
|
|
int srcXEven,
|
|
|
|
int srcXOdd,
|
|
|
|
FbBits * dstLine,
|
|
|
|
FbStride dstStrideEven,
|
|
|
|
FbStride dstStrideOdd,
|
|
|
|
int dstXEven,
|
|
|
|
int dstXOdd, int width, int height, int alu, FbBits pm, int bpp)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
FbBits *src;
|
|
|
|
int leftShiftEven, rightShiftEven;
|
|
|
|
FbBits startmaskEven, endmaskEven;
|
|
|
|
int nmiddleEven;
|
|
|
|
|
|
|
|
FbBits *dst;
|
|
|
|
int leftShiftOdd, rightShiftOdd;
|
|
|
|
FbBits startmaskOdd, endmaskOdd;
|
|
|
|
int nmiddleOdd;
|
|
|
|
|
|
|
|
int leftShift, rightShift;
|
|
|
|
FbBits startmask, endmask;
|
|
|
|
int nmiddle;
|
|
|
|
|
|
|
|
int srcX, dstX;
|
|
|
|
|
|
|
|
FbBits bits, bits1;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
Bool destInvarient;
|
|
|
|
Bool even;
|
|
|
|
|
|
|
|
FbDeclareMergeRop();
|
|
|
|
|
|
|
|
FbInitializeMergeRop(alu, pm);
|
2003-11-14 17:48:57 +01:00
|
|
|
destInvarient = FbDestInvarientMergeRop();
|
|
|
|
|
|
|
|
srcLine += srcXEven >> FB_SHIFT;
|
|
|
|
dstLine += dstXEven >> FB_SHIFT;
|
|
|
|
srcXEven &= FB_MASK;
|
|
|
|
dstXEven &= FB_MASK;
|
|
|
|
srcXOdd &= FB_MASK;
|
|
|
|
dstXOdd &= FB_MASK;
|
|
|
|
|
|
|
|
FbMaskBits(dstXEven, width, startmaskEven, nmiddleEven, endmaskEven);
|
|
|
|
FbMaskBits(dstXOdd, width, startmaskOdd, nmiddleOdd, endmaskOdd);
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
even = TRUE;
|
|
|
|
InitializeShifts(srcXEven, dstXEven, leftShiftEven, rightShiftEven);
|
|
|
|
InitializeShifts(srcXOdd, dstXOdd, leftShiftOdd, rightShiftOdd);
|
2012-03-21 20:55:09 +01:00
|
|
|
while (height--) {
|
|
|
|
src = srcLine;
|
|
|
|
dst = dstLine;
|
|
|
|
if (even) {
|
|
|
|
srcX = srcXEven;
|
|
|
|
dstX = dstXEven;
|
|
|
|
startmask = startmaskEven;
|
|
|
|
endmask = endmaskEven;
|
|
|
|
nmiddle = nmiddleEven;
|
|
|
|
leftShift = leftShiftEven;
|
|
|
|
rightShift = rightShiftEven;
|
|
|
|
srcLine += srcStrideEven;
|
|
|
|
dstLine += dstStrideEven;
|
|
|
|
even = FALSE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
srcX = srcXOdd;
|
|
|
|
dstX = dstXOdd;
|
|
|
|
startmask = startmaskOdd;
|
|
|
|
endmask = endmaskOdd;
|
|
|
|
nmiddle = nmiddleOdd;
|
|
|
|
leftShift = leftShiftOdd;
|
|
|
|
rightShift = rightShiftOdd;
|
|
|
|
srcLine += srcStrideOdd;
|
|
|
|
dstLine += dstStrideOdd;
|
|
|
|
even = TRUE;
|
|
|
|
}
|
|
|
|
if (srcX == dstX) {
|
|
|
|
if (startmask) {
|
|
|
|
bits = READ(src++);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), startmask));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
n = nmiddle;
|
|
|
|
if (destInvarient) {
|
|
|
|
while (n--) {
|
|
|
|
bits = READ(src++);
|
|
|
|
WRITE(dst, FbDoDestInvarientMergeRop(bits));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
while (n--) {
|
|
|
|
bits = READ(src++);
|
|
|
|
WRITE(dst, FbDoMergeRop(bits, READ(dst)));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (endmask) {
|
|
|
|
bits = READ(src);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits, READ(dst), endmask));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
bits = 0;
|
|
|
|
if (srcX > dstX)
|
|
|
|
bits = READ(src++);
|
|
|
|
if (startmask) {
|
|
|
|
bits1 = FbScrLeft(bits, leftShift);
|
|
|
|
bits = READ(src++);
|
|
|
|
bits1 |= FbScrRight(bits, rightShift);
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits1, READ(dst), startmask));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
n = nmiddle;
|
|
|
|
if (destInvarient) {
|
|
|
|
while (n--) {
|
|
|
|
bits1 = FbScrLeft(bits, leftShift);
|
|
|
|
bits = READ(src++);
|
|
|
|
bits1 |= FbScrRight(bits, rightShift);
|
|
|
|
WRITE(dst, FbDoDestInvarientMergeRop(bits1));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
while (n--) {
|
|
|
|
bits1 = FbScrLeft(bits, leftShift);
|
|
|
|
bits = READ(src++);
|
|
|
|
bits1 |= FbScrRight(bits, rightShift);
|
|
|
|
WRITE(dst, FbDoMergeRop(bits1, READ(dst)));
|
|
|
|
dst++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (endmask) {
|
|
|
|
bits1 = FbScrLeft(bits, leftShift);
|
|
|
|
if (FbScrLeft(endmask, rightShift)) {
|
|
|
|
bits = READ(src);
|
|
|
|
bits1 |= FbScrRight(bits, rightShift);
|
|
|
|
}
|
|
|
|
WRITE(dst, FbDoMaskMergeRop(bits1, READ(dst), endmask));
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
fbBltOdd24(FbBits * srcLine,
|
|
|
|
FbStride srcStrideEven,
|
|
|
|
FbStride srcStrideOdd,
|
|
|
|
int srcXEven,
|
|
|
|
int srcXOdd,
|
|
|
|
FbBits * dstLine,
|
|
|
|
FbStride dstStrideEven,
|
|
|
|
FbStride dstStrideOdd,
|
|
|
|
int dstXEven, int dstXOdd, int width, int height, int alu, FbBits pm)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
Bool even = TRUE;
|
|
|
|
|
|
|
|
while (height--) {
|
|
|
|
if (even) {
|
|
|
|
fbBlt24Line(srcLine, srcXEven, dstLine, dstXEven,
|
|
|
|
width, alu, pm, FALSE);
|
|
|
|
srcLine += srcStrideEven;
|
|
|
|
dstLine += dstStrideEven;
|
|
|
|
even = FALSE;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fbBlt24Line(srcLine, srcXOdd, dstLine, dstXOdd,
|
|
|
|
width, alu, pm, FALSE);
|
|
|
|
srcLine += srcStrideOdd;
|
|
|
|
dstLine += dstStrideOdd;
|
|
|
|
even = TRUE;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if FB_STIP_SHIFT != FB_SHIFT
|
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
fbSetBltOdd(FbStip * stip,
|
|
|
|
FbStride stipStride,
|
|
|
|
int srcX,
|
|
|
|
FbBits ** bits,
|
|
|
|
FbStride * strideEven,
|
|
|
|
FbStride * strideOdd, int *srcXEven, int *srcXOdd)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int srcAdjust;
|
|
|
|
int strideAdjust;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* bytes needed to align source
|
|
|
|
*/
|
|
|
|
srcAdjust = (((int) stip) & (FB_MASK >> 3));
|
|
|
|
/*
|
|
|
|
* FbStip units needed to align stride
|
|
|
|
*/
|
|
|
|
strideAdjust = stipStride & (FB_MASK >> FB_STIP_SHIFT);
|
|
|
|
|
|
|
|
*bits = (FbBits *) ((char *) stip - srcAdjust);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (srcAdjust) {
|
|
|
|
*strideEven = FbStipStrideToBitsStride(stipStride + 1);
|
|
|
|
*strideOdd = FbStipStrideToBitsStride(stipStride);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
*srcXEven = srcX + (srcAdjust << 3);
|
|
|
|
*srcXOdd = srcX + (srcAdjust << 3) - (strideAdjust << FB_STIP_SHIFT);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
*strideEven = FbStipStrideToBitsStride(stipStride);
|
|
|
|
*strideOdd = FbStipStrideToBitsStride(stipStride + 1);
|
|
|
|
|
|
|
|
*srcXEven = srcX;
|
|
|
|
*srcXOdd = srcX + (strideAdjust << FB_STIP_SHIFT);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */
|
|
|
|
int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */
|
|
|
|
int dstX, int width, int height, int alu, FbBits pm, int bpp)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
#if FB_STIP_SHIFT != FB_SHIFT
|
|
|
|
if (FB_STIP_ODDSTRIDE(srcStride) || FB_STIP_ODDPTR(src) ||
|
2012-03-21 20:55:09 +01:00
|
|
|
FB_STIP_ODDSTRIDE(dstStride) || FB_STIP_ODDPTR(dst)) {
|
|
|
|
FbStride srcStrideEven, srcStrideOdd;
|
|
|
|
FbStride dstStrideEven, dstStrideOdd;
|
|
|
|
int srcXEven, srcXOdd;
|
|
|
|
int dstXEven, dstXOdd;
|
|
|
|
FbBits *s, *d;
|
|
|
|
int sx, dx;
|
|
|
|
|
|
|
|
src += srcX >> FB_STIP_SHIFT;
|
|
|
|
srcX &= FB_STIP_MASK;
|
|
|
|
dst += dstX >> FB_STIP_SHIFT;
|
|
|
|
dstX &= FB_STIP_MASK;
|
|
|
|
|
|
|
|
fbSetBltOdd(src, srcStride, srcX,
|
|
|
|
&s, &srcStrideEven, &srcStrideOdd, &srcXEven, &srcXOdd);
|
|
|
|
|
|
|
|
fbSetBltOdd(dst, dstStride, dstX,
|
|
|
|
&d, &dstStrideEven, &dstStrideOdd, &dstXEven, &dstXOdd);
|
|
|
|
|
|
|
|
if (bpp == 24 && !FbCheck24Pix(pm)) {
|
|
|
|
fbBltOdd24(s, srcStrideEven, srcStrideOdd,
|
|
|
|
srcXEven, srcXOdd,
|
|
|
|
d, dstStrideEven, dstStrideOdd,
|
|
|
|
dstXEven, dstXOdd, width, height, alu, pm);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fbBltOdd(s, srcStrideEven, srcStrideOdd,
|
|
|
|
srcXEven, srcXOdd,
|
|
|
|
d, dstStrideEven, dstStrideOdd,
|
|
|
|
dstXEven, dstXOdd, width, height, alu, pm, bpp);
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
fbBlt((FbBits *) src, FbStipStrideToBitsStride(srcStride),
|
|
|
|
srcX,
|
|
|
|
(FbBits *) dst, FbStipStrideToBitsStride(dstStride),
|
|
|
|
dstX, width, height, alu, pm, bpp, FALSE, FALSE);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|