diff options
author | Alex VillacĂs Lasso <alex@karlalex.palosanto.com> | 2009-04-11 19:12:31 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-05-27 17:59:48 -0400 |
commit | a5ad3e8f509ca07c429a43810cc3e2f80e70a1dc (patch) | |
tree | 8e500d0ae230c6ccf034a3f5735b77850550dcd8 /src/savage_video.c | |
parent | 0f4369c95b6ef948743c9b244709e454b8b8ef7f (diff) |
Implement use of Mastered Image Transfer through AGP for UploadToScreen EXA acceleration.
Under some conditions (documented in this patch), the UploadToScreen implementation can make use of the AGP scratch buffer used for XVideo as a convenient source for Mastered Image Transfer. The previous implementation is still available as a fallback for when AGP acceleration is not possible. This requires the AGP scratch buffer to be persistent, so the XVideo code is also made aware of an existing DRM mapping for the scratch buffer.
Diffstat (limited to 'src/savage_video.c')
-rw-r--r-- | src/savage_video.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/savage_video.c b/src/savage_video.c index bccb801..cf51ba0 100644 --- a/src/savage_video.c +++ b/src/savage_video.c @@ -1048,8 +1048,12 @@ SavageStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) if (pPriv->agpBufferMap != NULL) { SAVAGEDRIServerPrivatePtr pSAVAGEDRIServer = psav->DRIServerInfo; - drmUnmap(pPriv->agpBufferMap, pSAVAGEDRIServer->agpXVideo.size); - pSAVAGEDRIServer->agpXVideo.map = NULL; + + /* agpXVideo is reused to implement UploadToScreen in EXA */ + if (!psav->useEXA) { + drmUnmap(pPriv->agpBufferMap, pSAVAGEDRIServer->agpXVideo.size); + pSAVAGEDRIServer->agpXVideo.map = NULL; + } pPriv->agpBufferMap = NULL; pPriv->agpBufferOffset = 0; } @@ -1971,7 +1975,8 @@ SavagePutImage( pPriv->tried_agp = TRUE; if (pSAVAGEDRIServer->agpXVideo.size >= max(new_size, planarFrameSize)) { - if ( drmMap( psav->drmFD, + if (pSAVAGEDRIServer->agpXVideo.map == NULL && + drmMap( psav->drmFD, pSAVAGEDRIServer->agpXVideo.handle, pSAVAGEDRIServer->agpXVideo.size, &pSAVAGEDRIServer->agpXVideo.map ) < 0 ) { |