diff options
Diffstat (limited to 'src/i810_accel.c')
-rw-r--r-- | src/i810_accel.c | 69 |
1 files changed, 52 insertions, 17 deletions
diff --git a/src/i810_accel.c b/src/i810_accel.c index 660180d9..d8467424 100644 --- a/src/i810_accel.c +++ b/src/i810_accel.c @@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.21 2004/01/02 20:22:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.19 2003/04/24 18:00:24 eich Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -48,9 +48,47 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86_ansic.h" #include "xf86.h" -#include "xaarop.h" + #include "i810.h" +static unsigned int i810Rop[16] = { + 0x00, /* GXclear */ + 0x88, /* GXand */ + 0x44, /* GXandReverse */ + 0xCC, /* GXcopy */ + 0x22, /* GXandInvert */ + 0xAA, /* GXnoop */ + 0x66, /* GXxor */ + 0xEE, /* GXor */ + 0x11, /* GXnor */ + 0x99, /* GXequiv */ + 0x55, /* GXinvert */ + 0xDD, /* GXorReverse */ + 0x33, /* GXcopyInvert */ + 0xBB, /* GXorInverted */ + 0x77, /* GXnand */ + 0xFF /* GXset */ +}; + +static unsigned int i810PatternRop[16] = { + 0x00, /* GXclear */ + 0xA0, /* GXand */ + 0x50, /* GXandReverse */ + 0xF0, /* GXcopy */ + 0x0A, /* GXandInvert */ + 0xAA, /* GXnoop */ + 0x5A, /* GXxor */ + 0xFA, /* GXor */ + 0x05, /* GXnor */ + 0xA5, /* GXequiv */ + 0x55, /* GXinvert */ + 0xF5, /* GXorReverse */ + 0x0F, /* GXcopyInvert */ + 0xAF, /* GXorInverted */ + 0x5F, /* GXnand */ + 0xFF /* GXset */ +}; + static void I810SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty, int fg, int bg, int rop, @@ -92,7 +130,10 @@ I810AccelInit(ScreenPtr pScreen) pI810->bufferOffset = 0; infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS; - infoPtr->Flags |= PIXMAP_CACHE; + /* There is a bit blt bug in 24 bpp. This is a problem, but + * at least without the pixmap cache we can pass the test suite */ + if (pScrn->depth != 24) + infoPtr->Flags |= PIXMAP_CACHE; /* Sync */ @@ -293,7 +334,7 @@ I810SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, /* Color blit, p166 */ pI810->BR[13] = (BR13_SOLID_PATTERN | - (XAAPatternROP[rop] << 16) | + (i810PatternRop[rop] << 16) | (pScrn->displayWidth * pI810->cpp)); pI810->BR[16] = color; } @@ -339,7 +380,7 @@ I810SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, if (xdir == -1) pI810->BR[13] |= BR13_RIGHT_TO_LEFT; - pI810->BR[13] |= XAACopyROP[rop] << 16; + pI810->BR[13] |= i810Rop[rop] << 16; pI810->BR[18] = 0; } @@ -360,12 +401,9 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, * This was developed empirically so it may not catch all * cases. */ -#define I810_MWIDTH 8 - if ( !(pI810->BR[13] & BR13_RIGHT_TO_LEFT) && (y2 - y1) < 3 - && (y2 - y1) >= 0 && (x2 - x1) <= (w + I810_MWIDTH) - && (w > I810_MWIDTH)) - w = I810_MWIDTH; + && (y2 - y1) >= 0 && (x2 - x1) <= (w + 4) && (w > 4)) + w = 4; do { if (pI810->BR[13] & BR13_PITCH_SIGN_BIT) { @@ -403,10 +441,7 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, break; x2 += w; x1 += w; - if (w_back > I810_MWIDTH) - w = I810_MWIDTH; - else - w = w_back; + w = w_back; } while (1); } @@ -425,9 +460,9 @@ I810SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty, pI810->BR[18] = bg; pI810->BR[19] = fg; pI810->BR[13] = (pScrn->displayWidth * pI810->cpp); - pI810->BR[13] |= XAAPatternROP[rop] << 16; + pI810->BR[13] |= i810PatternRop[rop] << 16; if (bg == -1) - pI810->BR[13] |= BR13_MONO_PATN_TRANS; + pI810->BR[13] |= BR13_MONO_TRANSPCY; } static void @@ -489,7 +524,7 @@ I810SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, fg, bg, rop, planemask); pI810->BR[13] = (pScrn->displayWidth * pI810->cpp); - pI810->BR[13] |= XAACopyROP[rop] << 16; + pI810->BR[13] |= i810Rop[rop] << 16; pI810->BR[13] |= (1 << 27); if (bg == -1) pI810->BR[13] |= BR13_MONO_TRANSPCY; |