summaryrefslogtreecommitdiff
path: root/src/i830_exa.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-09-20 08:57:58 -0700
committerEric Anholt <eric@anholt.net>2007-09-20 08:57:58 -0700
commit126031655c3c1db9881ad17d712461533eb59632 (patch)
treeaa3c6eb27d7563de489cd05df10f6ec41e8753cc /src/i830_exa.c
parentc3438356d6b7b63ad9d0086efb084be8e048980e (diff)
parentbda3c69a7a044869ea63514b97f8aa9260d6b5a7 (diff)
Merge remote branch 'origin/master' into buffer-objects
Conflicts: src/i830.h src/i830_driver.c
Diffstat (limited to 'src/i830_exa.c')
-rw-r--r--src/i830_exa.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 353ab8f2..c97e514d 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -124,6 +124,22 @@ i830_pixmap_tiled(PixmapPtr pPixmap)
return FALSE;
}
+static 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;
if (pI830->exa_offscreen) {
pI830->EXADriverPtr->offScreenBase = pI830->exa_offscreen->offset;
@@ -557,6 +583,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)