Mesa (mesa_7_7_branch): vmwgfx/core: Check for 3D via the get param ioctl

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Mon Dec 14 05:28:21 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: 49e4b624e5f4a68d51eb9681dbd2218aea0645fa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=49e4b624e5f4a68d51eb9681dbd2218aea0645fa

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Sat Dec 12 18:30:56 2009 +0100

vmwgfx/core: Check for 3D via the get param ioctl

---

 .../winsys/drm/vmware/core/vmw_screen_ioctl.c      |    9 +++++++++
 src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h    |    6 +++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/gallium/winsys/drm/vmware/core/vmw_screen_ioctl.c b/src/gallium/winsys/drm/vmware/core/vmw_screen_ioctl.c
index 51e455f..ccd0b41 100644
--- a/src/gallium/winsys/drm/vmware/core/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/drm/vmware/core/vmw_screen_ioctl.c
@@ -468,6 +468,15 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)
    VMW_FUNC;
 
    memset(&gp_arg, 0, sizeof(gp_arg));
+   gp_arg.param = DRM_VMW_PARAM_3D;
+   ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_GET_PARAM,
+			     &gp_arg, sizeof(gp_arg));
+   if (ret || gp_arg.value == 0) {
+      debug_printf("No 3D enabled (%i, %s)\n", ret, strerror(-ret));
+      goto out_err1;
+   }
+
+   memset(&gp_arg, 0, sizeof(gp_arg));
    gp_arg.param = DRM_VMW_PARAM_FIFO_OFFSET;
    ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_GET_PARAM,
 			     &gp_arg, sizeof(gp_arg));
diff --git a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
index 89bbf17..e05731b 100644
--- a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
+++ b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h
@@ -25,8 +25,8 @@
  *
  **************************************************************************/
 
-#ifndef _VMWGFX_DRM_H_
-#define _VMWGFX_DRM_H_
+#ifndef __VMWGFX_DRM_H__
+#define __VMWGFX_DRM_H__
 
 #define DRM_VMW_MAX_SURFACE_FACES 6
 #define DRM_VMW_MAX_MIP_LEVELS 24
@@ -34,7 +34,6 @@
 #define DRM_VMW_EXT_NAME_LEN 128
 
 #define DRM_VMW_GET_PARAM            1
-#define DRM_VMW_EXTENSION            2
 #define DRM_VMW_CREATE_CONTEXT       3
 #define DRM_VMW_UNREF_CONTEXT        4
 #define DRM_VMW_CREATE_SURFACE       5
@@ -62,6 +61,7 @@
 
 #define DRM_VMW_PARAM_FIFO_OFFSET    0
 #define DRM_VMW_PARAM_OVERLAY_IOCTL  1
+#define DRM_VMW_PARAM_3D             2
 
 /**
  * struct drm_vmw_getparam_arg



More information about the mesa-commit mailing list