diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2004-06-22 14:28:46 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2004-06-22 14:28:46 +0000 |
commit | 5ed7e6f8424236dd57d83f6ab1282693260969cb (patch) | |
tree | d34b866b0e45776b9eeeafb7663ba85c78853037 /src/i810_accel.c | |
parent | a46e95722d3c2b9dfb9eacf9a390a7c47d427773 (diff) |
i915 support
Dual Head support for i830, i855, i915.
ARGB cursor support (including i810) for all chipsets.
Diffstat (limited to 'src/i810_accel.c')
-rw-r--r-- | src/i810_accel.c | 85 |
1 files changed, 25 insertions, 60 deletions
diff --git a/src/i810_accel.c b/src/i810_accel.c index d8467424..ca74f966 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.19 2003/04/24 18:00:24 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.21 2004/01/02 20:22:17 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -48,47 +48,9 @@ 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, @@ -130,10 +92,7 @@ I810AccelInit(ScreenPtr pScreen) pI810->bufferOffset = 0; infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS; - /* 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; + infoPtr->Flags |= PIXMAP_CACHE; /* Sync */ @@ -227,7 +186,7 @@ int I810WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis) { I810Ptr pI810 = I810PTR(pScrn); - I810RingBuffer *ring = &(pI810->LpRing); + I810RingBuffer *ring = pI810->LpRing; int iters = 0; int start = 0; int now = 0; @@ -316,9 +275,9 @@ I810Sync(ScrnInfoPtr pScrn) ADVANCE_LP_RING(); } - I810WaitLpRing(pScrn, pI810->LpRing.mem.Size - 8, 0); + I810WaitLpRing(pScrn, pI810->LpRing->mem.Size - 8, 0); - pI810->LpRing.space = pI810->LpRing.mem.Size - 8; + pI810->LpRing->space = pI810->LpRing->mem.Size - 8; pI810->nextColorExpandBuf = 0; } @@ -334,7 +293,7 @@ I810SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, /* Color blit, p166 */ pI810->BR[13] = (BR13_SOLID_PATTERN | - (i810PatternRop[rop] << 16) | + (XAAPatternROP[rop] << 16) | (pScrn->displayWidth * pI810->cpp)); pI810->BR[16] = color; } @@ -380,7 +339,7 @@ I810SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, if (xdir == -1) pI810->BR[13] |= BR13_RIGHT_TO_LEFT; - pI810->BR[13] |= i810Rop[rop] << 16; + pI810->BR[13] |= XAACopyROP[rop] << 16; pI810->BR[18] = 0; } @@ -401,9 +360,12 @@ 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 + 4) && (w > 4)) - w = 4; + && (y2 - y1) >= 0 && (x2 - x1) <= (w + I810_MWIDTH) + && (w > I810_MWIDTH)) + w = I810_MWIDTH; do { if (pI810->BR[13] & BR13_PITCH_SIGN_BIT) { @@ -441,7 +403,10 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, break; x2 += w; x1 += w; - w = w_back; + if (w_back > I810_MWIDTH) + w = I810_MWIDTH; + else + w = w_back; } while (1); } @@ -460,9 +425,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] |= i810PatternRop[rop] << 16; + pI810->BR[13] |= XAAPatternROP[rop] << 16; if (bg == -1) - pI810->BR[13] |= BR13_MONO_TRANSPCY; + pI810->BR[13] |= BR13_MONO_PATN_TRANS; } static void @@ -524,7 +489,7 @@ I810SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, fg, bg, rop, planemask); pI810->BR[13] = (pScrn->displayWidth * pI810->cpp); - pI810->BR[13] |= i810Rop[rop] << 16; + pI810->BR[13] |= XAACopyROP[rop] << 16; pI810->BR[13] |= (1 << 27); if (bg == -1) pI810->BR[13] |= BR13_MONO_TRANSPCY; @@ -623,11 +588,11 @@ I810RefreshRing(ScrnInfoPtr pScrn) { I810Ptr pI810 = I810PTR(pScrn); - pI810->LpRing.head = INREG(LP_RING + RING_HEAD) & HEAD_ADDR; - pI810->LpRing.tail = INREG(LP_RING + RING_TAIL); - pI810->LpRing.space = pI810->LpRing.head - (pI810->LpRing.tail + 8); - if (pI810->LpRing.space < 0) - pI810->LpRing.space += pI810->LpRing.mem.Size; + pI810->LpRing->head = INREG(LP_RING + RING_HEAD) & HEAD_ADDR; + pI810->LpRing->tail = INREG(LP_RING + RING_TAIL); + pI810->LpRing->space = pI810->LpRing->head - (pI810->LpRing->tail + 8); + if (pI810->LpRing->space < 0) + pI810->LpRing->space += pI810->LpRing->mem.Size; pI810->AccelInfoRec->NeedToSync = TRUE; } |