g3dvl: Minor fixes.
authorYounes Manton <younes.m@gmail.com>
Wed, 23 Jul 2008 06:28:02 +0000 (02:28 -0400)
committerYounes Manton <younes.m@gmail.com>
Wed, 23 Jul 2008 06:28:41 +0000 (02:28 -0400)
src/driclient/include/driclient.h
src/driclient/src/.gitignore [new file with mode: 0644]
src/driclient/src/Makefile
src/driclient/src/driclient.c
src/driclient/src/test [deleted file]
src/gallium/winsys/g3dvl/nouveau/nouveau_screen.c

index 36438a9f790a7d6cbfda01c94fa90ddd377448e6..d3915250392e4fe640f2385d03073f9d60b34e67 100644 (file)
@@ -68,7 +68,6 @@ int driUpdateDrawableInfo(dri_drawable_t *dri_drawable);
 int driDestroyDrawable(dri_drawable_t *dri_drawable);
 int driCreateContext(dri_screen_t *dri_screen, Visual *visual, dri_context_t **dri_context);
 int driDestroyContext(dri_context_t *dri_context);
-int driCompareVersions(const dri_version_t *v1, const dri_version_t *v2);
 
 #define DRI_VALIDATE_DRAWABLE_INFO_ONCE(dri_drawable)                                  \
 do                                                                                     \
diff --git a/src/driclient/src/.gitignore b/src/driclient/src/.gitignore
new file mode 100644 (file)
index 0000000..9daeafb
--- /dev/null
@@ -0,0 +1 @@
+test
index 0fac552de5b7d61ae1ee253b918acd0aaa3e7a4c..3c0fc284409f2b4f0ffd40fa81379e84ebe70f09 100644 (file)
@@ -12,6 +12,7 @@ all: ${TARGET} test
 
 ${TARGET}: ${OBJECTS}
        ar rcs $@ $^
+       if ! test -d ../lib; then mkdir ../lib; fi
        cp ${TARGET} ../lib
 
 test: test.o
index 7a7ca95702ac00005195ea587cf35a9b44dac8c1..94d01aca4f94b93ad5b34d72ccddd9e883c7cbdd 100644 (file)
@@ -285,8 +285,3 @@ int driDestroyContext(dri_context_t *dri_context)
        return 0;
 }
 
-int driCompareVersions(const dri_version_t *v1, const dri_version_t *v2)
-{
-       return (v1->major == v2->major) && (v1->minor == v2->minor) && (v1->patch == v2->patch);
-}
-
diff --git a/src/driclient/src/test b/src/driclient/src/test
deleted file mode 100755 (executable)
index 57cddf8..0000000
Binary files a/src/driclient/src/test and /dev/null differ
index 0087ce0056b29a2d75281bc0df9eda10fb0ac664..daea3fff680037f99d87905f6892ca1d6ea7f6cf 100644 (file)
@@ -1,7 +1,7 @@
 #include "pipe/p_context.h"
 #include "pipe/p_util.h"
 #include "nouveau_context.h"
-#include "nouveau_drm.h"
+#include <nouveau_drm.h>
 #include "nouveau_dri.h"
 #include "nouveau_local.h"
 #include "nouveau_screen.h"
@@ -18,40 +18,44 @@ DRI_CONF_END;
 static const GLuint __driNConfigOptions = 0;
 */
 
-int
-nouveau_screen_create(dri_screen_t *dri_screen, dri_framebuffer_t *dri_framebuf)
+int nouveau_check_dri_drm_ddx(dri_version_t *dri, dri_version_t *drm, dri_version_t *ddx)
 {
-       /* XXX: Someone forgot to bump this? */
-       static const dri_version_t ddx_expected = {0, 0, 10 /*NOUVEAU_DRM_HEADER_PATCHLEVEL*/};
-       static const dri_version_t dri_expected = {4, 1, 0};
+       static const dri_version_t ddx_expected = {0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL};
+       static const dri_version_t dri_expected = {4, 0, 0};
        static const dri_version_t drm_expected = {0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL};
        
-       struct nouveau_dri      *nv_dri = dri_framebuf->private;
-       struct nouveau_screen   *nv_screen;
-       int                     ret;
+       assert(dri);
+       assert(drm);
+       assert(ddx);
        
-       if (!driCompareVersions(&ddx_expected, &dri_screen->ddx))
+       if (dri->major != dri_expected.major || dri->minor < dri_expected.minor)
        {
-               NOUVEAU_ERR("Unexpected DDX version.\n");
+               NOUVEAU_ERR("Unexpected DRI version.\n");
                return 1;
        }
-       
-       if (!driCompareVersions(&drm_expected, &dri_screen->drm))
+       if (drm->major != drm_expected.major || drm->minor < drm_expected.minor)
        {
                NOUVEAU_ERR("Unexpected DRM version.\n");
                return 1;
        }
-       
-       if (!driCompareVersions(&dri_expected, &dri_screen->dri))
+       if (ddx->major != ddx_expected.major || ddx->minor < ddx_expected.minor)
        {
-               NOUVEAU_ERR("Unexpected DRI version.\n");
+               NOUVEAU_ERR("Unexpected DDX version.\n");
                return 1;
        }
+       
+       return 0;
+}
 
-       if (dri_framebuf->private_size != sizeof(struct nouveau_dri)) {
-               NOUVEAU_ERR("DRI struct mismatch between DDX/DRI.\n");
+int
+nouveau_screen_create(dri_screen_t *dri_screen, dri_framebuffer_t *dri_framebuf)
+{      
+       struct nouveau_dri      *nv_dri = dri_framebuf->private;
+       struct nouveau_screen   *nv_screen;
+       int                     ret;
+       
+       if (nouveau_check_dri_drm_ddx(&dri_screen->dri, &dri_screen->drm, &dri_screen->ddx))
                return 1;
-       }
 
        nv_screen = CALLOC_STRUCT(nouveau_screen);
        if (!nv_screen)