diff options
author | Eric Anholt <eric@anholt.net> | 2007-08-17 17:49:21 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-08-17 17:49:21 -0700 |
commit | bd874b11bbfe582aebd3115771f90807e75afc31 (patch) | |
tree | 51ade2208298a99fbe9ec9f4abbe1bf252c6d47a /src/i830_exa.c | |
parent | 9ad33dd65a79277ef75a6e95373614852725f5a9 (diff) |
Replace AA allocator usage with i830_memory.c for RandR rotation.
This requires EXA 2.2 (server 1.3) for rotated performance with EXA, because
the i830_memory.c allocation may not fall within what EXA considers the
offscreen area, so the PixmapIsOffscreen hook is needed.
Diffstat (limited to 'src/i830_exa.c')
-rw-r--r-- | src/i830_exa.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/i830_exa.c b/src/i830_exa.c index fdf94d7a..fa50da0f 100644 --- a/src/i830_exa.c +++ b/src/i830_exa.c @@ -124,6 +124,22 @@ i830_pixmap_tiled(PixmapPtr pPixmap) return FALSE; } +Bool +i830_exa_pixmap_is_offscreen(PixmapPtr pPixmap) +{ + ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum]; + I830Ptr pI830 = I830PTR(pScrn); + + if ((void *)pPixmap->devPrivate.ptr >= (void *)pI830->FbBase && + (void *)pPixmap->devPrivate.ptr < + (void *)(pI830->FbBase + pI830->FbMapSize)) + { + return TRUE; + } else { + return FALSE; + } +} + /** * I830EXASync - wait for a command to finish * @pScreen: current screen @@ -456,7 +472,17 @@ I830EXAInit(ScreenPtr pScreen) pI830->bufferOffset = 0; pI830->EXADriverPtr->exa_major = 2; + /* If compiled against EXA 2.2, require 2.2 so we can use the + * PixmapIsOffscreen hook. + */ +#if EXA_VERSION_MINOR >= 2 + pI830->EXADriverPtr->exa_minor = 2; +#else pI830->EXADriverPtr->exa_minor = 1; + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "EXA compatibility mode. Output rotation rendering " + "performance may suffer\n"); +#endif pI830->EXADriverPtr->memoryBase = pI830->FbBase; pI830->EXADriverPtr->offScreenBase = pI830->exa_offscreen->offset; pI830->EXADriverPtr->memorySize = pI830->exa_offscreen->offset + @@ -552,6 +578,9 @@ I830EXAInit(ScreenPtr pScreen) pI830->EXADriverPtr->Composite = i965_composite; pI830->EXADriverPtr->DoneComposite = i830_done_composite; } +#if EXA_VERSION_MINOR >= 2 + pI830->EXADriverPtr->PixmapIsOffscreen = i830_exa_pixmap_is_offscreen; +#endif /* UploadToScreen/DownloadFromScreen */ if (0) |