ws/vmware: Check DRM version also when bootstrapping in dri2 mode.
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 18 Jan 2010 14:55:17 +0000 (15:55 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Mon, 18 Jan 2010 14:56:57 +0000 (15:56 +0100)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c

index 5995eee34bae1766901eca9d9eebeff29ba07dc2..7c47d434f0e64acbb45aad74590971681e2987b2 100644 (file)
@@ -85,6 +85,23 @@ vmw_drm_create_screen(struct drm_api *drm_api,
    struct pipe_screen *screen;
    struct dri1_create_screen_arg *dri1;
 
+   if (!arg || arg->mode == DRM_CREATE_NORMAL) {
+      struct dri1_api_version drm_ver;
+      drmVersionPtr ver;
+
+      ver = drmGetVersion(fd);
+      if (ver == NULL)
+        return NULL;
+
+      drm_ver.major = ver->version_major;
+      drm_ver.minor = ver->version_minor;
+
+      drmFreeVersion(ver);
+      if (!vmw_dri1_check_version(&drm_ver, &drm_required,
+                                 &drm_compat, "vmwgfx drm driver"))
+        return NULL;
+   }
+
    if (arg != NULL) {
       switch (arg->mode) {
       case DRM_CREATE_NORMAL: