summaryrefslogtreecommitdiff
path: root/src/i830_xaa.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-06-18 00:32:01 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-06-18 00:32:01 -0700
commitf2ab3aa3199e1c4b0edec72b5acea6d725cc514a (patch)
tree06d3753529244534ae2873f202013b8f9ac6d70f /src/i830_xaa.c
parentbc42dbe07cbd61b357d8eed02608e026c4cf4485 (diff)
Fix DRI in EXA mode: Don't attempt to use XAA symbols (use the driver's internal
ones for EXA support when available). Also, add an abstraction of XAA/EXA MarkSync and WaitSync functionality so we don't need to sprinkle the ifdefs all over, and correctly use them.
Diffstat (limited to 'src/i830_xaa.c')
-rw-r--r--src/i830_xaa.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/i830_xaa.c b/src/i830_xaa.c
index 68ba4c7f..9f3a3910 100644
--- a/src/i830_xaa.c
+++ b/src/i830_xaa.c
@@ -92,6 +92,11 @@ static void I830SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno);
#endif
static void I830RestoreAccelState(ScrnInfoPtr pScrn);
+#ifdef I830_USE_EXA
+extern const int I830PatternROP[16];
+extern const int I830CopyROP[16];
+#endif
+
Bool
I830XAAInit(ScreenPtr pScreen)
{
@@ -235,8 +240,17 @@ I830SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
ErrorF("I830SetupForFillRectSolid color: %x rop: %x mask: %x\n",
color, rop, planemask);
+#ifdef I830_USE_EXA
+ /* This function gets used by I830DRIInitBuffers(), and we might not have
+ * XAAGetPatternROP() available. So just use the ROPs from our EXA code
+ * if available.
+ */
+ pI830->BR[13] = ((I830PatternROP[rop] << 16) |
+ (pScrn->displayWidth * pI830->cpp));
+#else
pI830->BR[13] = ((XAAGetPatternROP(rop) << 16) |
(pScrn->displayWidth * pI830->cpp));
+#endif
pI830->BR[16] = color;
@@ -291,7 +305,15 @@ I830SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
xdir, ydir, rop, planemask, transparency_color);
pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
+#ifdef I830_USE_EXA
+ /* This function gets used by I830DRIInitBuffers(), and we might not have
+ * XAAGetCopyROP() available. So just use the ROPs from our EXA code
+ * if available.
+ */
+ pI830->BR[13] |= I830CopyROP[rop] << 16;
+#else
pI830->BR[13] |= XAAGetCopyROP(rop) << 16;
+#endif
switch (pScrn->bitsPerPixel) {
case 8: