Index: /trunk/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/x11/vboxvideo/Makefile.kmk	(revision 17242)
+++ /trunk/src/VBox/Additions/x11/vboxvideo/Makefile.kmk	(revision 17243)
@@ -128,5 +128,8 @@
 	$(VBOX_PATH_X11_XORG_7_0) \
 	$(VBOX_PATH_X11_XORG_7_0)/X11 \
-	$(VBOX_PATH_X11_XORG_7_0)/xorg
+	$(VBOX_PATH_X11_XORG_7_0)/xorg \
+	$(VBOX_PATH_X11_ROOT)/glproto-1.4.3 \
+	$(VBOX_PATH_X11_ROOT)/libdrm-1.0.5 \
+	$(VBOX_PATH_X11_ROOT)/xf86driproto-2.0.3
 vboxvideo_drv_70_SOURCES  = \
 	vboxvideo_70.c \
@@ -144,5 +147,8 @@
 	$(VBOX_PATH_X11_XORG_7_1) \
 	$(VBOX_PATH_X11_XORG_7_1)/X11 \
-	$(VBOX_PATH_X11_XORG_7_1)/xorg
+	$(VBOX_PATH_X11_XORG_7_1)/xorg \
+	$(VBOX_PATH_X11_ROOT)/glproto-1.4.7 \
+	$(VBOX_PATH_X11_ROOT)/libdrm-2.0.1 \
+	$(VBOX_PATH_X11_ROOT)/xf86driproto-2.0.3
 vboxvideo_drv_71_SOURCES  = \
 	vboxvideo_70.c \
@@ -160,5 +166,8 @@
 	$(VBOX_PATH_X11_XORG_1_3) \
 	$(VBOX_PATH_X11_XORG_1_3)/X11 \
-	$(VBOX_PATH_X11_XORG_1_3)/xorg
+	$(VBOX_PATH_X11_XORG_1_3)/xorg \
+	$(VBOX_PATH_X11_ROOT)/glproto-1.4.8 \
+	$(VBOX_PATH_X11_ROOT)/libdrm-2.3.0 \
+	$(VBOX_PATH_X11_ROOT)/xf86driproto-2.0.3
 vboxvideo_drv_13_SOURCES = \
 	vboxvideo_13.c \
@@ -179,5 +188,8 @@
 	$(VBOX_PATH_X11_XORG_1_4) \
 	$(VBOX_PATH_X11_XORG_1_4)/X11 \
-	$(VBOX_PATH_X11_XORG_1_4)/xorg
+	$(VBOX_PATH_X11_XORG_1_4)/xorg \
+	$(VBOX_PATH_X11_ROOT)/glproto-1.4.8 \
+	$(VBOX_PATH_X11_ROOT)/libdrm-2.3.0 \
+	$(VBOX_PATH_X11_ROOT)/xf86driproto-2.0.4
 vboxvideo_drv_14_SOURCES  = \
 	vboxvideo_13.c \
@@ -195,8 +207,12 @@
 	$(VBOX_PATH_X11_XORG_1_5) \
 	$(VBOX_PATH_X11_XORG_1_5)/X11 \
-	$(VBOX_PATH_X11_XORG_1_5)/xorg
+	$(VBOX_PATH_X11_XORG_1_5)/xorg \
+	$(VBOX_PATH_X11_ROOT)/glproto-1.4.9 \
+	$(VBOX_PATH_X11_ROOT)/libdrm-2.3.1 \
+	$(VBOX_PATH_X11_ROOT)/xf86driproto-2.0.4
 vboxvideo_drv_15_SOURCES  = \
 	vboxvideo_15.c \
-	vboxutils.c
+	vboxutils.c \
+	vboxvideo_dri.c
 
 
@@ -211,5 +227,8 @@
 	$(VBOX_PATH_X11_XORG_1_6) \
 	$(VBOX_PATH_X11_XORG_1_6)/X11 \
-	$(VBOX_PATH_X11_XORG_1_6)/xorg
+	$(VBOX_PATH_X11_XORG_1_6)/xorg \
+	$(VBOX_PATH_X11_ROOT)/glproto-1.4.9 \
+	$(VBOX_PATH_X11_ROOT)/libdrm-2.4.5 \
+	$(VBOX_PATH_X11_ROOT)/xf86driproto-2.0.4
 vboxvideo_drv_16_SOURCES  = \
 	vboxvideo_15.c \
Index: /trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
===================================================================
--- /trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h	(revision 17242)
+++ /trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h	(revision 17243)
@@ -109,8 +109,23 @@
 #include "fb.h"
 
-#define VBOX_VERSION		4000
+#define VBOX_VERSION		4000  /* Why? */
 #include "xf86Cursor.h"
-#define VBOX_NAME		"VBoxVideo"
-#define VBOX_DRIVER_NAME	"vboxvideo"
+#define VBOX_NAME		      "VBoxVideo"
+#define VBOX_DRIVER_NAME	  "vboxvideo"
+
+/* DRI support */
+#define _XF86DRI_SERVER_
+#include "dri.h"
+#include "GL/glxint.h"
+#include "GL/glxtokens.h"
+
+/* For some reason this is not in the header files. */
+extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+                                void **configprivs);
+#define VBOX_VIDEO_MAJOR  1
+#define VBOX_VIDEO_MINOR  0
+#define VBOX_DRM_DRIVER_NAME  "tdfx"    /* For now, as this driver is basically a stub. */
+#define VBOX_DRI_DRIVER_NAME  "swrast"  /* For starters. */
+#define VBOX_MAX_DRAWABLES    256       /* At random. */
 
 #define VBOXPTR(p) ((VBOXPtr)((p)->driverPrivate))
@@ -161,5 +176,14 @@
     VMMDevMemory *pVMMDevMemory;
     VBVAMEMORY *pVbvaMemory;
+    Bool useDRI;
+    int cVisualConfigs;
+    __GLXvisualConfig *pVisualConfigs;
+    DRIInfoRec *pDRIInfo;
+    int drmFD;
 } VBOXRec, *VBOXPtr;
+
+typedef struct {
+    int dummy;
+} VBOXDRIContextRec, *VBOXDRIContextPtr;
 
 extern Bool vbox_init(int scrnIndex, VBOXPtr pVBox);
@@ -183,3 +207,6 @@
 extern Bool vboxRetrieveVideoMode(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits);
 
+/* DRI stuff */
+extern Bool VBOXDRIScreenInit(ScrnInfoPtr pScrn, VBOXPtr pVBox);
+
 #endif /* _VBOXVIDEO_H_ */
