From: Jakob Bornecrantz Date: Sat, 12 Dec 2009 17:30:56 +0000 (+0100) Subject: vmwgfx/core: Check for 3D via the get param ioctl X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49e4b624e5f4a68d51eb9681dbd2218aea0645fa;p=mesa.git vmwgfx/core: Check for 3D via the get param ioctl --- 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 @@ -467,6 +467,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, 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