[PATCH] xfree: dri2: wrap drm bits with macros and change drm_magic type

Tiago Vignatti tiago.vignatti at nokia.com
Fri Jan 22 09:04:27 PST 2010


Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
 hw/xfree86/dri2/dri2.c    |    7 +++++--
 hw/xfree86/dri2/dri2.h    |    2 +-
 hw/xfree86/dri2/dri2ext.c |    2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 9505401..845e0e4 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -35,7 +35,9 @@
 #endif
 
 #include <errno.h>
+#ifdef WITH_LIBDRM
 #include <xf86drm.h>
+#endif
 #include "xf86Module.h"
 #include "scrnintstr.h"
 #include "windowstr.h"
@@ -787,7 +789,7 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
 }
 
 Bool
-DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic)
+DRI2Authenticate(ScreenPtr pScreen, uint32_t magic)
 {
     DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
 
@@ -798,9 +800,10 @@ DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic)
         if ((*ds->AuthMagic)(ds->fd, magic))
             return FALSE;
     }
+#ifdef WITH_LIBDRM
     else if (drmAuthMagic(ds->fd, magic))
         return FALSE;
-
+#endif
     return TRUE;
 }
 
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 0bec2c8..d809491 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -185,7 +185,7 @@ extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen,
 		 const char **driverName,
 		 const char **deviceName);
 
-extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic);
+extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic);
 
 extern _X_EXPORT int DRI2CreateDrawable(DrawablePtr pDraw);
 
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 3e6b03e..e97ed97 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -42,7 +42,9 @@
 #include "scrnintstr.h"
 #include "pixmapstr.h"
 #include "extnsionst.h"
+#ifdef WITH_LIBDRM
 #include "xf86drm.h"
+#endif
 #include "xfixes.h"
 #include "dri2.h"
 #include "protocol-versions.h"
-- 
1.6.0.4



More information about the xorg-devel mailing list