? i830_exa.c Index: i830.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v retrieving revision 1.11 diff -u -r1.11 i830.h --- i830.h 20 May 2005 15:24:02 -0000 1.11 +++ i830.h 5 Aug 2005 04:11:01 -0000 @@ -69,6 +69,12 @@ #include "i830_dri.h" #endif +#if XF86EXA +#define I830_USE_EXA +#include "exa.h" +#else +#define I830_USE_XAA +#endif #include "common.h" /* I830 Video BIOS support */ @@ -265,13 +271,28 @@ I830RegRec SavedReg; I830RegRec ModeReg; + Bool useEXA; Bool noAccel; Bool SWCursor; Bool cursorOn; +#ifdef I830_USE_XAA XAAInfoRecPtr AccelInfoRec; +#endif xf86CursorInfoPtr CursorInfoRec; CloseScreenProcPtr CloseScreen; +#ifdef I830_USE_EXA + ExaDriverPtr EXADriverPtr; + /* For *Solid */ + int fillPitch, fillBpp, fillXoffs; + CARD32 fillDstBase; + /* For *Copy */ + int copySXoffs, copyDXoffs, copyBpp; + int copySPitch, copyDPitch; + CARD32 copySrcBase, copyDstBase; + int copyXdir, copyYdir; +#endif + I830WriteIndexedByteFunc writeControl; I830ReadIndexedByteFunc readControl; I830WriteByteFunc writeStandard; @@ -374,7 +395,7 @@ #define I830PTR(p) ((I830Ptr)((p)->driverPrivate)) #define I830REGPTR(p) (&(I830PTR(p)->ModeReg)) -#define I830_SELECT_FRONT 0 +#DEFINE I830_SELECT_FRONT 0 #define I830_SELECT_BACK 1 #define I830_SELECT_DEPTH 2 Index: i830_accel.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_accel.c,v retrieving revision 1.5 diff -u -r1.5 i830_accel.c --- i830_accel.c 11 Jul 2005 02:29:51 -0000 1.5 +++ i830_accel.c 5 Aug 2005 04:11:02 -0000 @@ -251,140 +251,488 @@ #endif static void I830RestoreAccelState(ScrnInfoPtr pScrn); - -/* The following function sets up the supported acceleration. Call it - * from the FbInit() function in the SVGA driver, or before ScreenInit - * in a monolithic server. +#ifdef I830_USE_EXA +void i830ScratchSave(ScreenPtr pScreen, ExaOffscreenArea *area); +Bool i830UploadToScreen(PixmapPtr pDst, char *src, int src_pitch); +Bool i830UploadToScratch(PixmapPtr pSrc, PixmapPtr pDst); +Bool i830DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch); + +/** + * i830EXASync - wait for a command to finish + * @pScreen: current screen + * @marker: marker command to wait for + * + * Wait for the command specified by @marker to finish, then return. */ +static void +i830EXASync(ScreenPtr pScreen, int marker) +{ + I830Ptr pI830 = I830PTR(pScrn); + + if (I810_DEBUG & (DEBUG_VERBOSE_ACCEL | DEBUG_VERBOSE_SYNC)) + ErrorF("I830EXASync\n"); + +#ifdef XF86DRI + /* VT switching tries to do this. */ + if (!pI830->LockHeld && pI830->directRenderingEnabled) + return; +#endif + + if (pI830->entityPrivate && !pI830->entityPrivate->RingRunning) + return; + + /* Send a flush instruction and then wait till the ring is empty. + * This is stronger than waiting for the blitter to finish as it also + * flushes the internal graphics caches. + */ + { + BEGIN_LP_RING(2); + OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE); + OUT_RING(MI_NOOP); /* pad to quadword */ + ADVANCE_LP_RING(); + } + + I830WaitLpRing(pScrn, pI830->LpRing->mem.Size - 8, 0); + + pI830->LpRing->space = pI830->LpRing->mem.Size - 8; + pI830->nextColorExpandBuf = 0; +} + +static Bool +i830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) +{ + ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + + pI830->BR[13] = ((XAAGetPatternROP(alu) << 16) | + (pScrn->displayWidth * pI830->cpp)); + + pI830->BR[16] = color; + + switch (pScrn->bitsPerPixel) { + case 8: + break; + case 16: + pI830->BR[13] |= (1 << 24); + break; + case 32: + pI830->BR[13] |= ((1 << 25) | (1 << 24)); + break; + } +} + +static void +i830EXASolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2) +{ + ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + int h = y2 - y1, w = x2 - x1; /* assumes x2 > x1 && y2 > y1 */ + + if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) + ErrorF("I830EXASolid (%d, %d)->(%d, %d)\n", x, y, x2, y2); + + { + BEGIN_LP_RING(6); + + if (pScrn->bitsPerPixel == 32) { + OUT_RING(COLOR_BLT_CMD | COLOR_BLT_WRITE_ALPHA | + COLOR_BLT_WRITE_RGB); + } else { + OUT_RING(COLOR_BLT_CMD); + } + OUT_RING(pI830->BR[13]); + OUT_RING((h << 16) | (w * pI830->cpp)); + OUT_RING(pI830->bufferOffset + (y * pScrn->displayWidth + x) * + pI830->cpp); + OUT_RING(pI830->BR[16]); + OUT_RING(0); + + ADVANCE_LP_RING(); + } +} + +static void +i830EXADoneSolid(PixmapPtr pPixmap) +{ +} + +static Bool +i830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir, + int alu, Pixel planemask) +{ + ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; + I810Ptr pI830 = I810PTR(pScrn); + CARD32 srcbase, dstbase; + + /* Planemask not supported */ + if((planemask & ((1 << pSrcPixmap->drawable.depth) - 1)) != + (1 << pSrcPixmap->drawable.depth) - 1) { + return FALSE; + } + + if((pDstPixmap->drawable.bitsPerPixel != 8) && + (pDstPixmap->drawable.bitsPerPixel != 16) && + (pDstPixmap->drawable.bitsPerPixel != 32)) + return FALSE; + + srcbase = (CARD32)((unsigned long)pSrcPixmap->devPrivate.ptr - + (unsigned long)pI830->FbBase + FBOFFSET); + /* TODO: If srcbase is not aligned, need to align it and fix x coordinates */ + if(srcbase & 0x0f) xf86DrvMsg(0, 0, "Copy: Bad source\n"); + pI830->copySXoffs = 0; + + dstbase = (CARD32)((unsigned long)pDstPixmap->devPrivate.ptr - + (unsigned long)pI830->FbBase + FBOFFSET); + /* TODO: If dstbase is not aligned, need to align it and fix x coordinates */ + if(dstbase & 0x0f) xf86DrvMsg(0, 0, "Copy: Bad dest\n"); + pI830->copyDXoffs = 0; + + /* TODO: Will there eventually be overlapping blits? + * If so, good night. Then we must calculate new base addresses + * which are identical for source and dest, otherwise + * the chips direction-logic will fail. Certainly funny + * to re-calculate x and y then... + */ + + i830SetupDSTColorDepth((pDstPixmap->drawable.bitsPerPixel >> 4) << 16); + i830CheckQueue(16 * 3); + i830SetupSRCPitchDSTRect((pSrcPixmap->devKind + 3) & ~3, (pDstPixmap->devKind + 3) & ~3, DEV_HEIGHT) + i830SetupROP(i830GetCopyROP(alu)) + i830SetupSRCDSTBase(srcbase, dstbase) + i830SyncWP + + return TRUE; +} + +static void +i830EXACopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width, int height) +{ + ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum]; + I810Ptr pI830 = I810PTR(pScrn); + + srcX += pI830->copySXoffs; + dstX += pI830->copyDXoffs; + + i830CheckQueue(16 * 2); + i830SetupSRCDSTXY(srcX, srcY, dstX, dstY) + i830SetRectDoCMD(width, height) + } + +static void +i830EXADoneCopy(PixmapPtr pDstPixmap) +{ +} + Bool -I830AccelInit(ScreenPtr pScreen) +i830EXAUploadToScreen(PixmapPtr pDst, char *src, int src_pitch) { - XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - I830Ptr pI830 = I830PTR(pScrn); - int i; - int width = 0; - int nr_buffers = 0; - unsigned char *ptr = NULL; + ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum]; + I810Ptr pI830 = I810PTR(pScrn); + unsigned char *dst = pDst->devPrivate.ptr; + int dst_pitch = pDst->devKind; + int size = src_pitch < dst_pitch ? src_pitch : dst_pitch; + int h = pDst->drawable.height; + + (pI830->SyncAccel)(pScrn); + + while(h--) { + i830MemCopyToVideoRam(pI830, dst, (unsigned char *)src, size); + src += src_pitch; + dst += dst_pitch; + } - if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) - ErrorF("I830AccelInit\n"); + return TRUE; +} - pI830->AccelInfoRec = infoPtr = XAACreateInfoRec(); - if (!infoPtr) - return FALSE; +Bool +i830EXAUploadToScratch(PixmapPtr pSrc, PixmapPtr pDst) +{ + ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum]; + I810Ptr pI830 = I810PTR(pScrn); + unsigned char *src, *dst; + int src_pitch = pSrc->devKind; + int dst_pitch, size, w, h, bytes; - pI830->bufferOffset = 0; - infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS | PIXMAP_CACHE; + w = pSrc->drawable.width; - /* Use the same sync function as the I830. - */ - infoPtr->Sync = I830Sync; + dst_pitch = ((w * (pSrc->drawable.bitsPerPixel >> 3)) + + pI830->EXADriverPtr->card.offscreenPitch - 1) & + ~(pI830->EXADriverPtr->card.offscreenPitch - 1); - /* Everything else is different enough to justify different functions */ - { - infoPtr->SolidFillFlags = NO_PLANEMASK; - infoPtr->SetupForSolidFill = I830SetupForSolidFill; - infoPtr->SubsequentSolidFillRect = I830SubsequentSolidFillRect; - } + size = dst_pitch * pSrc->drawable.height; - { - infoPtr->ScreenToScreenCopyFlags = (NO_PLANEMASK | NO_TRANSPARENCY); + if(size > pI830->exa_scratch->size) + return FALSE; - infoPtr->SetupForScreenToScreenCopy = I830SetupForScreenToScreenCopy; - infoPtr->SubsequentScreenToScreenCopy = - I830SubsequentScreenToScreenCopy; - } + pI830->exa_scratch_next = (pI830->exa_scratch_next + + pI830->EXADriverPtr->card.offscreenByteAlign - 1) & + ~(pI830->EXADriverPtr->card.offscreenByteAlign - 1); - { - infoPtr->SetupForMono8x8PatternFill = I830SetupForMono8x8PatternFill; - infoPtr->SubsequentMono8x8PatternFillRect = - I830SubsequentMono8x8PatternFillRect; + if(pI830->exa_scratch_next + size > + pI830->exa_scratch->offset + pI830->exa_scratch->size) { + (pI830->EXADriverPtr->accel.WaitMarker)(pSrc->drawable.pScreen, 0); + pI830->exa_scratch_next = pI830->exa_scratch->offset; + } - infoPtr->Mono8x8PatternFillFlags = (HARDWARE_PATTERN_PROGRAMMED_BITS | - HARDWARE_PATTERN_SCREEN_ORIGIN | - HARDWARE_PATTERN_PROGRAMMED_ORIGIN | - BIT_ORDER_IN_BYTE_MSBFIRST | - NO_PLANEMASK); + memcpy(pDst, pSrc, sizeof(*pDst)); + pDst->devKind = dst_pitch; + pDst->devPrivate.ptr = pI830->EXADriverPtr->card.memoryBase + pI830->exa_scratch_next; - } + pI830->exa_scratch_next += size; - /* On the primary screen */ - if (pI830->init == 0) { - if (pI830->Scratch.Size != 0) { - width = ((pScrn->displayWidth + 31) & ~31) / 8; - nr_buffers = pI830->Scratch.Size / width; - ptr = pI830->FbBase + pI830->Scratch.Start; - } - } else { - /* On the secondary screen */ - I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); - if (pI8301->Scratch2.Size != 0) { - width = ((pScrn->displayWidth + 31) & ~31) / 8; - nr_buffers = pI8301->Scratch2.Size / width; - /* We have to use the primary screen's FbBase, as that's where - * we allocated Scratch2, so we get the correct pointer */ - ptr = pI8301->FbBase + pI8301->Scratch2.Start; - } - } + src = pSrc->devPrivate.ptr; + src_pitch = pSrc->devKind; + dst = pDst->devPrivate.ptr; + + bytes = (src_pitch < dst_pitch) ? src_pitch : dst_pitch; + + h = pSrc->drawable.height; + + (pI830->SyncAccel)(pScrn); + + while(h--) { + i830MemCopyToVideoRam(pI830, dst, src, size); + src += src_pitch; + dst += dst_pitch; + } + + return TRUE; +} + +Bool +i830EXADownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch) +{ + ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum]; + I810Ptr pI830 = I810PTR(pScrn); + unsigned char *src = pSrc->devPrivate.ptr; + int src_pitch = pSrc->devKind; + int size = src_pitch < dst_pitch ? src_pitch : dst_pitch; + + (pI830->SyncAccel)(pScrn); + + while(h--) { + i830MemCopyFromVideoRam(pI830, (unsigned char *)dst, src, size); + src += src_pitch; + dst += dst_pitch; + } + + return TRUE; +} + +/* TODO: verify pitch, etc., support dual head */ +Bool I830EXAinit(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + + if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) + ErrorF("I830EXAInit\n"); + + if(pI830->useEXA) { + if(!(pI830->EXADriverPtr = xnfcalloc(sizeof(ExaDriverRec), 1))) { + pI830->noAccel = TRUE; + return FALSE; + } + } + + pI830->EXADriverPtr->card.memoryBase = pI830->FbBase; + pI830->EXADriverPtr->card.memorySize = pI830->TotalVideoRam; + pI830->EXADriverPtr->card.offScreenBase = pScrn->virtualX * pScrn->virtualY + * ((pScrn->bitsPerPixel + 7) / 8); + + if(pI830->EXADriverPtr->card.memorySize > + pI830->EXADriverPtr->card.offScreenBase) { + pI830->EXADriverPtr->card.flags = EXA_OFFSCREEN_PIXMAPS; + } else + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Not enough video RAM for " + "offscreen memory manager. Xv disabled\n"); + + /* Uhh... yes. */ + pI830->EXADriverPtr->card.offscreenByteAlign = 8; + pI830->EXADriverPtr->card.offscreenPitch = 4; + pI830->EXADriverPtr->card.maxX = 8191; + pI830->EXADriverPtr->card.maxY = 8191; + + /* Sync */ + pI830->EXADriverPtr->accel.WaitMarker = I830EXASync; + + /* Solid fill */ + pI830->EXADriverPtr->accel.PrepareSolid = I830PrepareSolid; + pI830->EXADriverPtr->accel.Solid = I830Solid; + pI830->EXADriverPtr->accel.DoneSolid = I830DoneSolid; + + /* Copy */ + pI830->EXADriverPtr->accel.PrepareCopy = I830PrepareCopy; + pI830->EXADriverPtr->accel.Copy = I830Copy; + pI830->EXADriverPtr->accel.DoneCopy = I830DoneCopy; + + /* Upload, download to/from Screen */ + pI830->EXADriverPtr->accel.UploadToScreen = I830UploadToScreen; + pI830->EXADriverPtr->accel.DownloadFromScreen = I830DownloadFromScreen; + + /* Really want Composite here... */ + + if(!exaDriverInit(pScreen, pI830->EXADriverPtr)) { + pI830->noAccel = TRUE; + return FALSE; + } + + /* Dual head? */ + return TRUE; +} +#endif /* I830_USE_EXA */ + +#ifdef I830_USE_XAA +Bool I830XAAInit(ScreenPtr pScreen) +{ + XAAInfoRecPtr infoPtr; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + int i; + int width = 0; + int nr_buffers = 0; + unsigned char *ptr = NULL; + + if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) + ErrorF("I830XAAInit\n"); + + if (!pI830->useEXA) { + pI830->AccelInfoRec = infoPtr = XAACreateInfoRec(); + if (!infoPtr) + return FALSE; + } + + pI830->bufferOffset = 0; + infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS | PIXMAP_CACHE; + + /* Use the same sync function as the I830. + */ + infoPtr->Sync = I830Sync; + + /* Everything else is different enough to justify different functions */ + { + infoPtr->SolidFillFlags = NO_PLANEMASK; + infoPtr->SetupForSolidFill = I830SetupForSolidFill; + infoPtr->SubsequentSolidFillRect = I830SubsequentSolidFillRect; + } - if (nr_buffers) { - pI830->NumScanlineColorExpandBuffers = nr_buffers; - pI830->ScanlineColorExpandBuffers = (unsigned char **) + { + infoPtr->ScreenToScreenCopyFlags = (NO_PLANEMASK | NO_TRANSPARENCY); + + infoPtr->SetupForScreenToScreenCopy = I830SetupForScreenToScreenCopy; + infoPtr->SubsequentScreenToScreenCopy = + I830SubsequentScreenToScreenCopy; + } + + { + infoPtr->SetupForMono8x8PatternFill = I830SetupForMono8x8PatternFill; + infoPtr->SubsequentMono8x8PatternFillRect = + I830SubsequentMono8x8PatternFillRect; + + infoPtr->Mono8x8PatternFillFlags = (HARDWARE_PATTERN_PROGRAMMED_BITS | + HARDWARE_PATTERN_SCREEN_ORIGIN | + HARDWARE_PATTERN_PROGRAMMED_ORIGIN | + BIT_ORDER_IN_BYTE_MSBFIRST | + NO_PLANEMASK); + + } + + /* On the primary screen */ + if (pI830->init == 0) { + if (pI830->Scratch.Size != 0) { + width = ((pScrn->displayWidth + 31) & ~31) / 8; + nr_buffers = pI830->Scratch.Size / width; + ptr = pI830->FbBase + pI830->Scratch.Start; + } + } else { + /* On the secondary screen */ + I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); + if (pI8301->Scratch2.Size != 0) { + width = ((pScrn->displayWidth + 31) & ~31) / 8; + nr_buffers = pI8301->Scratch2.Size / width; + /* We have to use the primary screen's FbBase, as that's where + * we allocated Scratch2, so we get the correct pointer */ + ptr = pI8301->FbBase + pI8301->Scratch2.Start; + } + } + + if (nr_buffers) { + pI830->NumScanlineColorExpandBuffers = nr_buffers; + pI830->ScanlineColorExpandBuffers = (unsigned char **) xnfcalloc(nr_buffers, sizeof(unsigned char *)); - for (i = 0; i < nr_buffers; i++, ptr += width) - pI830->ScanlineColorExpandBuffers[i] = ptr; + for (i = 0; i < nr_buffers; i++, ptr += width) + pI830->ScanlineColorExpandBuffers[i] = ptr; - infoPtr->ScanlineCPUToScreenColorExpandFillFlags = + infoPtr->ScanlineCPUToScreenColorExpandFillFlags = (NO_PLANEMASK | ROP_NEEDS_SOURCE | BIT_ORDER_IN_BYTE_MSBFIRST); - infoPtr->ScanlineColorExpandBuffers = (unsigned char **) + infoPtr->ScanlineColorExpandBuffers = (unsigned char **) xnfcalloc(1, sizeof(unsigned char *)); - infoPtr->NumScanlineColorExpandBuffers = 1; + infoPtr->NumScanlineColorExpandBuffers = 1; - infoPtr->ScanlineColorExpandBuffers[0] = + infoPtr->ScanlineColorExpandBuffers[0] = pI830->ScanlineColorExpandBuffers[0]; - pI830->nextColorExpandBuf = 0; + pI830->nextColorExpandBuf = 0; - infoPtr->SetupForScanlineCPUToScreenColorExpandFill = + infoPtr->SetupForScanlineCPUToScreenColorExpandFill = I830SetupForScanlineCPUToScreenColorExpandFill; - infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = + infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = I830SubsequentScanlineCPUToScreenColorExpandFill; - infoPtr->SubsequentColorExpandScanline = + infoPtr->SubsequentColorExpandScanline = I830SubsequentColorExpandScanline; #if DO_SCANLINE_IMAGE_WRITE - infoPtr->NumScanlineImageWriteBuffers = 1; - infoPtr->ScanlineImageWriteBuffers = infoPtr->ScanlineColorExpandBuffers; - infoPtr->SetupForScanlineImageWrite = I830SetupForScanlineImageWrite; - infoPtr->SubsequentScanlineImageWriteRect = + infoPtr->NumScanlineImageWriteBuffers = 1; + infoPtr->ScanlineImageWriteBuffers = infoPtr->ScanlineColorExpandBuffers; + infoPtr->SetupForScanlineImageWrite = I830SetupForScanlineImageWrite; + infoPtr->SubsequentScanlineImageWriteRect = I830SubsequentScanlineImageWriteRect; - infoPtr->SubsequentImageWriteScanline = I830SubsequentImageWriteScanline; - infoPtr->ScanlineImageWriteFlags = NO_GXCOPY | - NO_PLANEMASK | - ROP_NEEDS_SOURCE | - SCANLINE_PAD_DWORD; + infoPtr->SubsequentImageWriteScanline = I830SubsequentImageWriteScanline; + infoPtr->ScanlineImageWriteFlags = NO_GXCOPY | + NO_PLANEMASK | + ROP_NEEDS_SOURCE | + SCANLINE_PAD_DWORD; #endif - } + } - { - Bool shared_accel = FALSE; - int i; + { + Bool shared_accel = FALSE; + int i; - for(i = 0; i < pScrn->numEntities; i++) { - if(xf86IsEntityShared(pScrn->entityList[i])) - shared_accel = TRUE; - } - if(shared_accel == TRUE) - infoPtr->RestoreAccelState = I830RestoreAccelState; - } + for(i = 0; i < pScrn->numEntities; i++) { + if(xf86IsEntityShared(pScrn->entityList[i])) + shared_accel = TRUE; + } + if(shared_accel == TRUE) + infoPtr->RestoreAccelState = I830RestoreAccelState; + } - I830SelectBuffer(pScrn, I830_SELECT_FRONT); + I830SelectBuffer(pScrn, I830_SELECT_FRONT); + + return XAAInit(pScreen, infoPtr); +} +#endif /* I830_USE_XAA */ - return XAAInit(pScreen, infoPtr); +/* The following function sets up the supported acceleration. Call it + * from the FbInit() function in the SVGA driver, or before ScreenInit + * in a monolithic server. + */ +Bool +I830AccelInit(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + +#ifdef I830_USE_EXA + if (pI830->useEXA) + return I830EXAInit(pScreen); +#endif +#ifdef I830_USE_XAA + return I830_XAAInit(pScreen); +#endif } void