diff options
author | Daniel Stone <daniel@fooishbar.org> | 2012-07-10 00:32:13 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-10 09:32:01 +0100 |
commit | 78dc0c04745ad4485b994f67833f4a155749f01d (patch) | |
tree | 361f33026ecf0a467d68c2ad7ba96fa4c3c8b925 /src/legacy | |
parent | 45ab003a5860fd4290df24739d2520fddfe27a8f (diff) |
i810: Make XAA optional
Don't build XAA when it's not available, or when we don't want it.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src/legacy')
-rw-r--r-- | src/legacy/i810/Makefile.am | 6 | ||||
-rw-r--r-- | src/legacy/i810/i810.h | 4 | ||||
-rw-r--r-- | src/legacy/i810/i810_dga.c | 15 | ||||
-rw-r--r-- | src/legacy/i810/i810_dri.c | 38 | ||||
-rw-r--r-- | src/legacy/i810/i810_driver.c | 13 | ||||
-rw-r--r-- | src/legacy/i810/i810_video.c | 2 |
6 files changed, 56 insertions, 22 deletions
diff --git a/src/legacy/i810/Makefile.am b/src/legacy/i810/Makefile.am index e7fa04f1..01cc2183 100644 --- a/src/legacy/i810/Makefile.am +++ b/src/legacy/i810/Makefile.am @@ -8,7 +8,6 @@ AM_CFLAGS = @CWARNFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ @PCIACCESS_CFLA $(NULL) liblegacy_i810_la_SOURCES = \ - i810_accel.c \ i810_common.h \ i810_cursor.c \ i810_dga.c \ @@ -20,6 +19,11 @@ liblegacy_i810_la_SOURCES = \ i810_video.c \ i810_wmark.c +if XAA +liblegacy_i810_la_SOURCES += \ + i810_accel.c +endif + if DRI liblegacy_i810_la_SOURCES +=\ i810_dri.c \ diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h index 874551be..512d07ee 100644 --- a/src/legacy/i810/i810.h +++ b/src/legacy/i810/i810.h @@ -42,7 +42,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "compiler.h" #include "xf86Pci.h" #include "i810_reg.h" +#ifdef HAVE_XAA #include "xaa.h" +#endif #include "xf86Cursor.h" #include "xf86xv.h" #include "vbe.h" @@ -202,7 +204,9 @@ typedef struct _I810Rec { I810RegRec SavedReg; I810RegRec ModeReg; +#ifdef XAA XAAInfoRecPtr AccelInfoRec; +#endif xf86CursorInfoPtr CursorInfoRec; CloseScreenProcPtr CloseScreen; ScreenBlockHandlerProcPtr BlockHandler; diff --git a/src/legacy/i810/i810_dga.c b/src/legacy/i810/i810_dga.c index 336588c6..e258360e 100644 --- a/src/legacy/i810/i810_dga.c +++ b/src/legacy/i810/i810_dga.c @@ -29,8 +29,6 @@ #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" -#include "xaa.h" -#include "xaalocal.h" #include "i810.h" #include "i810_reg.h" #include "dgaproc.h" @@ -39,11 +37,14 @@ static Bool I810_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, int *, int *, int *); static Bool I810_SetMode(ScrnInfoPtr, DGAModePtr); -static void I810_Sync(ScrnInfoPtr); static int I810_GetViewport(ScrnInfoPtr); static void I810_SetViewport(ScrnInfoPtr, int, int, int); + +#ifdef HAVE_XAA +static void I810_Sync(ScrnInfoPtr); static void I810_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void I810_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); +#endif #if 0 static void I810_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, @@ -57,9 +58,15 @@ DGAFunctionRec I810DGAFuncs = { I810_SetMode, I810_SetViewport, I810_GetViewport, +#ifdef HAVE_XAA I810_Sync, I810_FillRect, I810_BlitRect, +#else + NULL, + NULL, + NULL, +#endif #if 0 I810_BlitTransRect #else @@ -186,6 +193,7 @@ I810_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags) pI810->DGAViewportStatus = 0; } +#ifdef HAVE_XAA static void I810_FillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned long color) @@ -226,6 +234,7 @@ I810_BlitRect(ScrnInfoPtr pScrn, SET_SYNC_FLAG(pI810->AccelInfoRec); } } +#endif #if 0 static void diff --git a/src/legacy/i810/i810_dri.c b/src/legacy/i810/i810_dri.c index ba11245b..0f891bbf 100644 --- a/src/legacy/i810/i810_dri.c +++ b/src/legacy/i810/i810_dri.c @@ -379,7 +379,7 @@ I810DRIScreenInit(ScreenPtr pScreen) pI810DRI->regsSize = I810_REG_SIZE; if (drmAddMap(pI810->drmSubFD, (drm_handle_t) pI810->MMIOAddr, - pI810DRI->regsSize, DRM_REGISTERS, 0, + pI810DRI->regsSize, DRM_REGISTERS, 0, (drmAddress) &pI810DRI->regs) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAddMap(regs) failed\n"); DRICloseScreen(pScreen); @@ -421,7 +421,7 @@ I810DRIScreenInit(ScreenPtr pScreen) * under the DRI. */ - drmAgpAlloc(pI810->drmSubFD, 4096 * 1024, 1, NULL, + drmAgpAlloc(pI810->drmSubFD, 4096 * 1024, 1, NULL, (drmAddress) &dcacheHandle); pI810->dcacheHandle = dcacheHandle; @@ -507,7 +507,7 @@ I810DRIScreenInit(ScreenPtr pScreen) "[agp] GART: no dcache memory found\n"); } - drmAgpAlloc(pI810->drmSubFD, back_size, 0, NULL, + drmAgpAlloc(pI810->drmSubFD, back_size, 0, NULL, (drmAddress) &agpHandle); pI810->backHandle = agpHandle; @@ -564,10 +564,10 @@ I810DRIScreenInit(ScreenPtr pScreen) /* Now allocate and bind the agp space. This memory will include the * regular framebuffer as well as texture memory. */ - drmAgpAlloc(pI810->drmSubFD, sysmem_size, 0, NULL, + drmAgpAlloc(pI810->drmSubFD, sysmem_size, 0, NULL, (drmAddress)&agpHandle); pI810->sysmemHandle = agpHandle; - + if (agpHandle != DRM_AGP_NO_HANDLE) { if (drmAgpBind(pI810->drmSubFD, agpHandle, 0) == 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -610,7 +610,7 @@ I810DRIScreenInit(ScreenPtr pScreen) } drmAgpAlloc(pI810->drmSubFD, pI810->MC.Size, 0, NULL, (drmAddress) &agpHandle); - + pI810->xvmcHandle = agpHandle; if (agpHandle != DRM_AGP_NO_HANDLE) { @@ -634,7 +634,7 @@ I810DRIScreenInit(ScreenPtr pScreen) } drmAgpAlloc(pI810->drmSubFD, 4096, 2, - (unsigned long *)&pI810->CursorPhysical, + (unsigned long *)&pI810->CursorPhysical, (drmAddress) &agpHandle); pI810->cursorHandle = agpHandle; @@ -787,7 +787,7 @@ I810DRIScreenInit(ScreenPtr pScreen) pI810DRI->agp_buf_size = pI810->BufferMem.Size; if (drmAddMap(pI810->drmSubFD, (drm_handle_t) pI810->LpRing->mem.Start, - pI810->LpRing->mem.Size, DRM_AGP, 0, + pI810->LpRing->mem.Size, DRM_AGP, 0, (drmAddress) &pI810->ring_map) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAddMap(ring_map) failed. Disabling DRI.\n"); @@ -821,7 +821,7 @@ I810DRIScreenInit(ScreenPtr pScreen) } if (drmAddMap(pI810->drmSubFD, (drm_handle_t) pI810->TexMem.Start, - pI810->TexMem.Size, DRM_AGP, 0, + pI810->TexMem.Size, DRM_AGP, 0, (drmAddress) &pI810DRI->textures) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAddMap(textures) failed. Disabling DRI.\n"); @@ -975,7 +975,7 @@ I810DRIFinishScreenInit(ScreenPtr pScreen) */ if (info->allowPageFlip && info->drmMinor >= 3) { ShadowFBInit( pScreen, I810DRIRefreshArea ); - } + } else info->allowPageFlip = 0; return DRIFinishScreenInit(pScreen); @@ -1009,11 +1009,20 @@ I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType, } static void +I810DRISetNeedSync(ScrnInfoPtr pScrn) +{ +#ifdef HAVE_XAA + I810Ptr pI810 = I810PTR(pScrn); + if (pI810->AccelInfoRec) + pI810->AccelInfoRec->NeedToSync = TRUE; +#endif +} + +static void I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) { ScreenPtr pScreen = pWin->drawable.pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - I810Ptr pI810 = I810PTR(pScrn); BoxPtr pbox = REGION_RECTS(prgn); int nbox = REGION_NUM_RECTS(prgn); @@ -1041,8 +1050,7 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) } I810SelectBuffer(pScrn, I810_SELECT_FRONT); - if (pI810->AccelInfoRec) - pI810->AccelInfoRec->NeedToSync = TRUE; + I810DRISetNeedSync(pScrn); } /* This routine is a modified form of XAADoBitBlt with the calls to @@ -1058,7 +1066,6 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, { ScreenPtr pScreen = pParent->drawable.pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - I810Ptr pI810 = I810PTR(pScrn); BoxPtr pboxTmp, pboxNext, pboxBase; DDXPointPtr pptTmp, pptNew2 = NULL; int xdir, ydir; @@ -1201,8 +1208,7 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, free(pboxNew1); } - if (pI810->AccelInfoRec) - pI810->AccelInfoRec->NeedToSync = TRUE; + I810DRISetNeedSync(pScrn); } diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c index 141c19c2..df8f8e1b 100644 --- a/src/legacy/i810/i810_driver.c +++ b/src/legacy/i810/i810_driver.c @@ -68,6 +68,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86xv.h" #include <X11/extensions/Xv.h> #include "vbe.h" +#include "xf86fbman.h" #include "i810.h" @@ -1094,6 +1095,7 @@ DoRestore(ScrnInfoPtr scrn, vgaRegPtr vgaReg, I810RegPtr i810Reg, hwp->writeCrtc(hwp, IO_CTNL, temp); } +#ifdef HAVE_XAA static void I810SetRingRegs(ScrnInfoPtr scrn) { @@ -1113,6 +1115,7 @@ I810SetRingRegs(ScrnInfoPtr scrn) itemp |= ((pI810->LpRing->mem.Size - 4096) | RING_NO_REPORT | RING_VALID); OUTREG(LP_RING + RING_LEN, itemp); } +#endif static void I810Restore(ScrnInfoPtr scrn) @@ -1700,6 +1703,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL) return FALSE; } +#ifdef HAVE_XAA if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) { if (pI810->LpRing->mem.Size != 0) { I810SetRingRegs(scrn); @@ -1711,6 +1715,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL) I810EmitFlush(scrn); } } +#endif miInitializeBackingStore(screen); xf86SetBackingStore(screen); @@ -1938,11 +1943,13 @@ I810LeaveVT(VT_FUNC_ARGS_DECL) } #endif +#ifdef HAVE_XAA if (pI810->AccelInfoRec != NULL) { I810RefreshRing(scrn); I810Sync(scrn); pI810->AccelInfoRec->NeedToSync = FALSE; } +#endif I810Restore(scrn); if (!I810UnbindGARTMemory(scrn)) @@ -1961,14 +1968,18 @@ I810CloseScreen(CLOSE_SCREEN_ARGS_DECL) ScrnInfoPtr scrn = xf86ScreenToScrn(screen); vgaHWPtr hwp = VGAHWPTR(scrn); I810Ptr pI810 = I810PTR(scrn); +#ifdef HAVE_XAA XAAInfoRecPtr infoPtr = pI810->AccelInfoRec; +#endif if (scrn->vtSema == TRUE) { +#ifdef HAVE_XAA if (pI810->AccelInfoRec != NULL) { I810RefreshRing(scrn); I810Sync(scrn); pI810->AccelInfoRec->NeedToSync = FALSE; } +#endif I810Restore(scrn); vgaHWLock(hwp); } @@ -1993,12 +2004,14 @@ I810CloseScreen(CLOSE_SCREEN_ARGS_DECL) pI810->ScanlineColorExpandBuffers = NULL; } +#ifdef HAVE_XAA if (infoPtr) { if (infoPtr->ScanlineColorExpandBuffers) free(infoPtr->ScanlineColorExpandBuffers); XAADestroyInfoRec(infoPtr); pI810->AccelInfoRec = NULL; } +#endif if (pI810->CursorInfoRec) { xf86DestroyCursorInfoRec(pI810->CursorInfoRec); diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c index 56d04a48..4ebad661 100644 --- a/src/legacy/i810/i810_video.c +++ b/src/legacy/i810/i810_video.c @@ -49,8 +49,6 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i810.h" #include "xf86xv.h" #include <X11/extensions/Xv.h> -#include "xaa.h" -#include "xaalocal.h" #include "dixstruct.h" #include "fourcc.h" |