fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane
gcc doesn't appear to be smart enough to fold away the indirection here, even if you make fbLaneTable const. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
86ce626297
commit
3d35bd6b79
|
@ -81,7 +81,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FB_SHIFT == 6
|
#if FB_SHIFT == 6
|
||||||
CARD8 fb8Lane[256] = {
|
static const CARD8 fb8Lane[256] = {
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||||
21,
|
21,
|
||||||
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||||
|
@ -107,40 +107,32 @@ CARD8 fb8Lane[256] = {
|
||||||
242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
|
242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
|
||||||
};
|
};
|
||||||
|
|
||||||
CARD8 fb16Lane[256] = {
|
static const CARD8 fb16Lane[256] = {
|
||||||
0x00, 0x03, 0x0c, 0x0f,
|
0x00, 0x03, 0x0c, 0x0f,
|
||||||
0x30, 0x33, 0x3c, 0x3f,
|
0x30, 0x33, 0x3c, 0x3f,
|
||||||
0xc0, 0xc3, 0xcc, 0xcf,
|
0xc0, 0xc3, 0xcc, 0xcf,
|
||||||
0xf0, 0xf3, 0xfc, 0xff,
|
0xf0, 0xf3, 0xfc, 0xff,
|
||||||
};
|
};
|
||||||
|
|
||||||
CARD8 fb32Lane[16] = {
|
static const CARD8 fb32Lane[16] = {
|
||||||
0x00, 0x0f, 0xf0, 0xff,
|
0x00, 0x0f, 0xf0, 0xff,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FB_SHIFT == 5
|
#if FB_SHIFT == 5
|
||||||
CARD8 fb8Lane[16] = {
|
static const CARD8 fb8Lane[16] = {
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
|
||||||
};
|
};
|
||||||
|
|
||||||
CARD8 fb16Lane[16] = {
|
static const CARD8 fb16Lane[16] = {
|
||||||
0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 3, 12, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
CARD8 fb32Lane[16] = {
|
static const CARD8 fb32Lane[16] = {
|
||||||
0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CARD8 *fbLaneTable[33] = {
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
fb8Lane, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
fb16Lane, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
fb32Lane
|
|
||||||
};
|
|
||||||
|
|
||||||
void
|
void
|
||||||
fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */
|
fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */
|
||||||
int srcX, /* bit position of source */
|
int srcX, /* bit position of source */
|
||||||
|
@ -169,7 +161,7 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */
|
||||||
Bool transparent; /* accelerate 0 nop */
|
Bool transparent; /* accelerate 0 nop */
|
||||||
int srcinc; /* source units consumed */
|
int srcinc; /* source units consumed */
|
||||||
Bool endNeedsLoad = FALSE; /* need load for endmask */
|
Bool endNeedsLoad = FALSE; /* need load for endmask */
|
||||||
CARD8 *fbLane;
|
const CARD8 *fbLane;
|
||||||
int startbyte, endbyte;
|
int startbyte, endbyte;
|
||||||
|
|
||||||
if (dstBpp == 24) {
|
if (dstBpp == 24) {
|
||||||
|
@ -236,8 +228,14 @@ fbBltOne(FbStip * src, FbStride srcStride, /* FbStip units per scanline */
|
||||||
if (pixelsPerDst <= 8)
|
if (pixelsPerDst <= 8)
|
||||||
fbBits = fbStippleTable[pixelsPerDst];
|
fbBits = fbStippleTable[pixelsPerDst];
|
||||||
fbLane = 0;
|
fbLane = 0;
|
||||||
if (transparent && fgand == 0 && dstBpp >= 8)
|
if (transparent && fgand == 0) {
|
||||||
fbLane = fbLaneTable[dstBpp];
|
if (dstBpp == 8)
|
||||||
|
fbLane = fb8Lane;
|
||||||
|
if (dstBpp == 16)
|
||||||
|
fbLane = fb16Lane;
|
||||||
|
if (dstBpp == 32)
|
||||||
|
fbLane = fb32Lane;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compute total number of destination words written, but
|
* Compute total number of destination words written, but
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#define fb16Lane wfb16Lane
|
|
||||||
#define fb24_32CopyMtoN wfb24_32CopyMtoN
|
#define fb24_32CopyMtoN wfb24_32CopyMtoN
|
||||||
#define fb24_32CreateScreenResources wfb24_32CreateScreenResources
|
#define fb24_32CreateScreenResources wfb24_32CreateScreenResources
|
||||||
#define fb24_32GetImage wfb24_32GetImage
|
#define fb24_32GetImage wfb24_32GetImage
|
||||||
|
@ -7,8 +6,6 @@
|
||||||
#define fb24_32PutZImage wfb24_32PutZImage
|
#define fb24_32PutZImage wfb24_32PutZImage
|
||||||
#define fb24_32ReformatTile wfb24_32ReformatTile
|
#define fb24_32ReformatTile wfb24_32ReformatTile
|
||||||
#define fb24_32SetSpans wfb24_32SetSpans
|
#define fb24_32SetSpans wfb24_32SetSpans
|
||||||
#define fb32Lane wfb32Lane
|
|
||||||
#define fb8Lane wfb8Lane
|
|
||||||
#define fbAddTraps wfbAddTraps
|
#define fbAddTraps wfbAddTraps
|
||||||
#define fbAddTriangles wfbAddTriangles
|
#define fbAddTriangles wfbAddTriangles
|
||||||
#define fbAllocatePrivates wfbAllocatePrivates
|
#define fbAllocatePrivates wfbAllocatePrivates
|
||||||
|
@ -85,8 +82,6 @@
|
||||||
#define fbIn wfbIn
|
#define fbIn wfbIn
|
||||||
#define fbInitializeColormap wfbInitializeColormap
|
#define fbInitializeColormap wfbInitializeColormap
|
||||||
#define fbInitVisuals wfbInitVisuals
|
#define fbInitVisuals wfbInitVisuals
|
||||||
#define fbInstallColormap wfbInstallColormap
|
|
||||||
#define fbLaneTable wfbLaneTable
|
|
||||||
#define fbListInstalledColormaps wfbListInstalledColormaps
|
#define fbListInstalledColormaps wfbListInstalledColormaps
|
||||||
#define FbMergeRopBits wFbMergeRopBits
|
#define FbMergeRopBits wFbMergeRopBits
|
||||||
#define fbOddStipple wfbOddStipple
|
#define fbOddStipple wfbOddStipple
|
||||||
|
|
Loading…
Reference in New Issue
Block a user