Index: programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v retrieving revision 1.13 diff -u -d -r1.13 i830_dri.c --- programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c 21 Oct 2005 18:40:19 -0000 1.13 +++ programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c 27 Oct 2005 23:04:53 -0000 @@ -607,6 +607,10 @@ I830Ptr pI830 = I830PTR(pScrn); DRIInfoPtr pDRIInfo = pI830->pDRIInfo; I830DRIPtr pI830DRI = pDRIInfo->devPrivate; + const unsigned long total_agp_size = pI830->BackBuffer.Size + + pI830->DepthBuffer.Size + pI830->LpRing->mem.Size + + pI830->TexMem.Size; + unsigned long agp_handle; DPRINTF(PFX, "I830DRIDoMappings\n"); pI830DRI->regsSize = I830_REG_SIZE; @@ -625,10 +629,38 @@ pI830->backPitch = pScrn->displayWidth; +#if 1 + if (drmAgpAcquire(pI830->drmSubFD) < 0) { + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[agp] drmAgpAquire failed (%s). Disabling DRI.\n", + errno, strerror(errno)); + DRICloseScreen(pScreen); + return FALSE; + } + + if (drmAgpEnable(pI830->drmSubFD, 0) < 0) { + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[agp] drmAgpEnable failed (%s). Disabling DRI.\n", + errno, strerror(errno)); + DRICloseScreen(pScreen); + return FALSE; + } +#endif + + if (drmAgpAlloc(pI830->drmSubFD, total_agp_size, DRM_AGP, + NULL, & agp_handle)) { + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[drm] drmAgpAlloc failed (%s). Disabling DRI.\n", + errno, strerror(errno)); + DRICloseScreen(pScreen); + return FALSE; + } + + pI830DRI->backbufferSize = pI830->BackBuffer.Size; if (drmAddMap(pI830->drmSubFD, - (drm_handle_t)pI830->BackBuffer.Start + pI830->LinearAddr, + (drm_handle_t)pI830->BackBuffer.Start /*+ pI830->LinearAddr*/, pI830->BackBuffer.Size, DRM_AGP, 0, &pI830DRI->backbuffer) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -641,7 +673,7 @@ pI830DRI->depthbufferSize = pI830->DepthBuffer.Size; if (drmAddMap(pI830->drmSubFD, - (drm_handle_t)pI830->DepthBuffer.Start + pI830->LinearAddr, + (drm_handle_t)pI830->DepthBuffer.Start /*+ pI830->LinearAddr*/, pI830->DepthBuffer.Size, DRM_AGP, 0, &pI830DRI->depthbuffer) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -654,7 +686,7 @@ if (drmAddMap(pI830->drmSubFD, - (drm_handle_t)pI830->LpRing->mem.Start + pI830->LinearAddr, + (drm_handle_t)pI830->LpRing->mem.Start /*+ pI830->LinearAddr*/, pI830->LpRing->mem.Size, DRM_AGP, 0, &pI830->ring_map) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -669,7 +701,7 @@ pI830DRI->logTextureGranularity = pI830->TexGranularity; if (drmAddMap(pI830->drmSubFD, - (drm_handle_t)pI830->TexMem.Start + pI830->LinearAddr, + (drm_handle_t)pI830->TexMem.Start /*+ pI830->LinearAddr*/, pI830->TexMem.Size, DRM_AGP, 0, &pI830DRI->textures) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR,