diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-03-20 09:14:39 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-03-20 09:14:39 +0100 |
commit | 1bdd376dbd57de8925244f0808f974d6d8cff39d (patch) | |
tree | 4eacba99068b381f658862428fc89a0090434ce6 /src/radeon_exa_funcs.c | |
parent | 3cfa3a5c8daf03aaad6fc30d275709f6eb717d29 (diff) |
radeon: Only sync to hardware when really necessary with EXA.
In particular, don't sync again after accelerated DownloadFromScreen, which
syncs implicitly. This avoids calling into the kernel when it's not necessary,
which can be relevant in some situations.
Diffstat (limited to 'src/radeon_exa_funcs.c')
-rw-r--r-- | src/radeon_exa_funcs.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c index 0d847d1c..c356de7c 100644 --- a/src/radeon_exa_funcs.c +++ b/src/radeon_exa_funcs.c @@ -59,14 +59,30 @@ #include "exa.h" +static int +FUNC_NAME(RADEONMarkSync)(ScreenPtr pScreen) +{ + RINFO_FROM_SCREEN(pScreen); + + TRACE; + + return ++info->exaSyncMarker; +} + static void FUNC_NAME(RADEONSync)(ScreenPtr pScreen, int marker) { + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RADEONInfoPtr info = RADEONPTR(pScrn); + TRACE; - FUNC_NAME(RADEONWaitForIdle)(xf86Screens[pScreen->myNum]); + if (info->exaMarkerSynced != marker) { + FUNC_NAME(RADEONWaitForIdle)(pScrn); + info->exaMarkerSynced = marker; + } - RADEONPTR(xf86Screens[pScreen->myNum])->engineMode = EXA_ENGINEMODE_UNKNOWN; + RADEONPTR(pScrn)->engineMode = EXA_ENGINEMODE_UNKNOWN; } static Bool @@ -444,6 +460,8 @@ FUNC_NAME(RADEONDownloadFromScreen)(PixmapPtr pSrc, int x, int y, int w, int h, drmCommandWriteRead(info->drmFD, DRM_RADEON_INDIRECT, &indirect, sizeof(drmRadeonIndirect)); + info->exaMarkerSynced = info->exaSyncMarker; + return TRUE; } #endif @@ -504,6 +522,7 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr pScreen) info->exa->Copy = FUNC_NAME(RADEONCopy); info->exa->DoneCopy = FUNC_NAME(RADEONDoneCopy); + info->exa->MarkSync = FUNC_NAME(RADEONMarkSync); info->exa->WaitMarker = FUNC_NAME(RADEONSync); info->exa->UploadToScreen = FUNC_NAME(RADEONUploadToScreen); info->exa->DownloadFromScreen = FUNC_NAME(RADEONDownloadFromScreen); |