summaryrefslogtreecommitdiff
path: root/src/egl/drivers/xdri/driinit.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2009-08-24 16:39:25 -0400
committerZack Rusin <zackr@vmware.com>2009-08-24 16:39:25 -0400
commitcd5c7bfd93bf207d28610a484b732b8d3eca6059 (patch)
tree61725df97ac4015709bc7c869e01401fcb0d3d93 /src/egl/drivers/xdri/driinit.c
parent534c13302291c07a44afd528f4c758ced4296db5 (diff)
parent4bccd693a72a0b42dffc849034263a68e779ca91 (diff)
Merge branch 'master' of ssh://zack@git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/egl/drivers/xdri/driinit.c')
-rw-r--r--src/egl/drivers/xdri/driinit.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/egl/drivers/xdri/driinit.c b/src/egl/drivers/xdri/driinit.c
new file mode 100644
index 0000000000..12da1bcd24
--- /dev/null
+++ b/src/egl/drivers/xdri/driinit.c
@@ -0,0 +1,67 @@
+/**
+ * DRI initialization. The DRI loaders are defined in src/glx/x11/.
+ */
+
+#include <sys/time.h>
+
+#include "glxclient.h"
+#include "driinit.h"
+
+/* for __DRI_SYSTEM_TIME extension */
+_X_HIDDEN int
+__glXGetUST(int64_t * ust)
+{
+ struct timeval tv;
+
+ if (ust == NULL) {
+ return -EFAULT;
+ }
+
+ if (gettimeofday(&tv, NULL) == 0) {
+ ust[0] = (tv.tv_sec * 1000000) + tv.tv_usec;
+ return 0;
+ }
+ else {
+ return -errno;
+ }
+}
+
+_X_HIDDEN GLboolean
+__driGetMscRateOML(__DRIdrawable * draw,
+ int32_t * numerator, int32_t * denominator, void *private)
+{
+ return GL_FALSE;
+}
+
+/* ignore glx extensions */
+_X_HIDDEN void
+__glXEnableDirectExtension(__GLXscreenConfigs * psc, const char *name)
+{
+}
+
+_X_HIDDEN __GLXDRIdisplay *
+__driCreateDisplay(__GLXdisplayPrivate *dpyPriv, int *version)
+{
+ __GLXDRIdisplay *driDisplay;
+ int ver = 0;
+
+ /* try DRI2 first */
+ driDisplay = dri2CreateDisplay(dpyPriv->dpy);
+ if (driDisplay) {
+ /* fill in the required field */
+ dpyPriv->dri2Display = driDisplay;
+ ver = 2;
+ }
+ else {
+ /* try DRI */
+ driDisplay = driCreateDisplay(dpyPriv->dpy);
+ if (driDisplay) {
+ dpyPriv->driDisplay = driDisplay;
+ ver = 1;
+ }
+ }
+
+ if (version)
+ *version = ver;
+ return driDisplay;
+}