From bd874b11bbfe582aebd3115771f90807e75afc31 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 17 Aug 2007 17:49:21 -0700 Subject: 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. --- src/i830_exa.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/i830_exa.c') 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) -- cgit v1.2.1