Module Name: xsrc Committed By: mrg Date: Thu Jul 9 06:53:37 UTC 2009
Modified Files: xsrc/external/mit/xf86-video-savage/dist/src: savage_dri.c Log Message: merge xf86-video-savage 2.3.0. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ xsrc/external/mit/xf86-video-savage/dist/src/savage_dri.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: xsrc/external/mit/xf86-video-savage/dist/src/savage_dri.c diff -u xsrc/external/mit/xf86-video-savage/dist/src/savage_dri.c:1.2 xsrc/external/mit/xf86-video-savage/dist/src/savage_dri.c:1.3 --- xsrc/external/mit/xf86-video-savage/dist/src/savage_dri.c:1.2 Thu Jul 2 04:14:05 2009 +++ xsrc/external/mit/xf86-video-savage/dist/src/savage_dri.c Thu Jul 9 06:53:37 2009 @@ -520,6 +520,15 @@ } } + if (psav->AGPforXv) { + pSAVAGEDRIServer->agpXVideo.offset = offset; + pSAVAGEDRIServer->agpXVideo.size = 2 * 1024 * 1024; /* Max XV image is 1024x1024x16bpp */ + offset += pSAVAGEDRIServer->agpXVideo.size; + } else { + pSAVAGEDRIServer->agpXVideo.offset = 0; + pSAVAGEDRIServer->agpXVideo.size = 0; + } + pSAVAGEDRIServer->agpTextures.offset = offset; pSAVAGEDRIServer->agpTextures.size = (pSAVAGEDRIServer->agp.size - offset); @@ -581,6 +590,25 @@ } } + /* XVideo buffer + */ + if (pSAVAGEDRIServer->agpXVideo.size != 0) { + if ( drmAddMap( psav->drmFD, + pSAVAGEDRIServer->agpXVideo.offset, + pSAVAGEDRIServer->agpXVideo.size, + DRM_AGP, 0, + &pSAVAGEDRIServer->agpXVideo.handle ) < 0 ) { + xf86DrvMsg( pScreen->myNum, X_ERROR, + "[agp] Could not add agpXVideo, will use framebuffer upload (slower) \n" ); + pSAVAGEDRIServer->agpXVideo.size = 0; + pSAVAGEDRIServer->agpXVideo.handle = 0; + } else { + xf86DrvMsg( pScreen->myNum, X_INFO, + "[agp] agpXVideo handle = 0x%08lx\n", + pSAVAGEDRIServer->agpXVideo.handle ); + } + } + /* AGP textures */ if ( drmAddMap( psav->drmFD, @@ -1278,6 +1306,12 @@ pSAVAGEDRIServer->aperture.map = NULL; } + if ( pSAVAGEDRIServer->agpXVideo.map ) { + drmUnmap( pSAVAGEDRIServer->agpXVideo.map, + pSAVAGEDRIServer->agpXVideo.size ); + pSAVAGEDRIServer->agpXVideo.map = NULL; + } + if ( pSAVAGEDRIServer->agpTextures.map ) { drmUnmap( pSAVAGEDRIServer->agpTextures.map, pSAVAGEDRIServer->agpTextures.size ); @@ -1293,6 +1327,9 @@ if (pSAVAGEDRIServer->aperture.handle) drmRmMap(psav->drmFD,pSAVAGEDRIServer->registers.handle); + if (pSAVAGEDRIServer->agpXVideo.handle) + drmRmMap(psav->drmFD,pSAVAGEDRIServer->agpXVideo.handle); + if (pSAVAGEDRIServer->agpTextures.handle) drmRmMap(psav->drmFD,pSAVAGEDRIServer->agpTextures.handle); @@ -1541,6 +1578,9 @@ psav->AccelInfoRec->NeedToSync = TRUE; } +/* Definition in savage_accel.c */ +int SavageGetCopyROP(int rop); + static void SAVAGEDRISetupForScreenToScreenCopy( ScrnInfoPtr pScrn, @@ -1554,7 +1594,7 @@ int cmd =0; cmd = BCI_CMD_RECT | BCI_CMD_DEST_PBD | BCI_CMD_SRC_PBD_COLOR; - BCI_CMD_SET_ROP( cmd, XAAGetCopyROP(rop) ); + BCI_CMD_SET_ROP( cmd, SavageGetCopyROP(rop) ); if (transparency_color != -1) cmd |= BCI_CMD_SEND_COLOR | BCI_CMD_SRC_TRANSPARENT;