summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-12-12 18:30:56 +0100
committerJakob Bornecrantz <[email protected]>2009-12-12 18:37:16 +0100
commit49e4b624e5f4a68d51eb9681dbd2218aea0645fa (patch)
tree8aea3badd804aafc3d18e62b0e7df56c0e89f322 /src
parent8413a3aefaf4968f8b17263826b34baa99c2a907 (diff)
vmwgfx/core: Check for 3D via the get param ioctl
Diffstat (limited to 'src')
-rw-r--r--src/gallium/winsys/drm/vmware/core/vmw_screen_ioctl.c9
-rw-r--r--src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h6
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 51e455f9254..ccd0b418a16 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 89bbf17ce99..e05731b24cc 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