summaryrefslogtreecommitdiff
path: root/src/savage_dri.c
diff options
context:
space:
mode:
authorAlex VillacĂ­s Lasso <a_villacis@palosanto.com>2009-01-16 16:20:23 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-01-16 16:20:23 -0500
commit50bcd4bd6f32ed2fd9631b3607a203a187b2e4a2 (patch)
tree7b2a57c6de6ba2b2cdcc58ecc84386fc4c3cc5ee /src/savage_dri.c
parent91d5c09c891c944ae4188ecac607ebdb44ed81d7 (diff)
Add AGPforXv Option
Instructs the BCI Xv pixel formatter to use AGP memory as a scratch buffer for Xv image upload
Diffstat (limited to 'src/savage_dri.c')
-rw-r--r--src/savage_dri.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/savage_dri.c b/src/savage_dri.c
index 0d40222..216c915 100644
--- a/src/savage_dri.c
+++ b/src/savage_dri.c
@@ -520,6 +520,15 @@ static Bool SAVAGEDRIAgpInit(ScreenPtr pScreen)
}
}
+ 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 @@ static Bool SAVAGEDRIAgpInit(ScreenPtr pScreen)
}
}
+ /* 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 @@ void SAVAGEDRICloseScreen( ScreenPtr pScreen )
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 @@ void SAVAGEDRICloseScreen( ScreenPtr pScreen )
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);