summaryrefslogtreecommitdiff
path: root/src/savage_accel.c
diff options
context:
space:
mode:
authorAlex VillacĂ­s Lasso <a_villacis@palosanto.com>2009-04-12 16:07:06 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-05-27 18:00:11 -0400
commitf2742755352d49a1ff4cbf9a1a5050a0a50e9e6b (patch)
tree7ef9e6590ed012b1bd1eba6aa29cc30374db3d07 /src/savage_accel.c
parenta5ad3e8f509ca07c429a43810cc3e2f80e70a1dc (diff)
Do not use XAAGetCopyROP outside of XAA-specific code
The DRI code attempts to use XAAGetCopyROP without checking whether XAA or EXA is in effect. This results in the server crashing with an undefined-symbol error when enabling EXA, then starting glxgears under GNOME/Metacity and attempting to drag the glxgears window. The EXA code happens to have a functional duplicate of the required code under the name SavageGetCopyROP(). This patch moves the code to savage_accel.c where it is now shared between EXA and the DRI code. It is disturbing that this has not been caught before.
Diffstat (limited to 'src/savage_accel.c')
-rw-r--r--src/savage_accel.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/savage_accel.c b/src/savage_accel.c
index 450b402..73c2d90 100644
--- a/src/savage_accel.c
+++ b/src/savage_accel.c
@@ -1537,6 +1537,32 @@ SavageInitAccel(ScreenPtr pScreen)
return SavageXAAInit(pScreen);
}
+int SavageGetCopyROP(int rop) {
+
+ int ALUCopyROP[16] =
+ {
+ 0x00, /*ROP_0 GXclear */
+ 0x88, /*ROP_DSa GXand */
+ 0x44, /*ROP_SDna GXandReverse */
+ 0xCC, /*ROP_S GXcopy */
+ 0x22, /*ROP_DSna GXandInverted */
+ 0xAA, /*ROP_D GXnoop */
+ 0x66, /*ROP_DSx GXxor */
+ 0xEE, /*ROP_DSo GXor */
+ 0x11, /*ROP_DSon GXnor */
+ 0x99, /*ROP_DSxn GXequiv */
+ 0x55, /*ROP_Dn GXinvert*/
+ 0xDD, /*ROP_SDno GXorReverse */
+ 0x33, /*ROP_Sn GXcopyInverted */
+ 0xBB, /*ROP_DSno GXorInverted */
+ 0x77, /*ROP_DSan GXnand */
+ 0xFF, /*ROP_1 GXset */
+ };
+
+ return (ALUCopyROP[rop]);
+
+}
+
/* Routines for debugging. */