Skip to content

Commit 2ae7b03

Browse files
thomashvmwairlied
authored andcommitted
vmwgfx: Bump major
This bumps driver major version as a result of previous incompatible interface changes. In addition, a leftover command definition is removed from the vmwgfx_drm.h header. Also a strict version check is enforced on the exebuf ioctl. This is intended to be the last major bump before exiting staging. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent ae2a104 commit 2ae7b03

3 files changed

Lines changed: 18 additions & 48 deletions

File tree

‎drivers/gpu/drm/vmwgfx/vmwgfx_drv.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
#include "ttm/ttm_module.h"
4141
#include "vmwgfx_fence.h"
4242

43-
#define VMWGFX_DRIVER_DATE "20100927"
44-
#define VMWGFX_DRIVER_MAJOR 1
45-
#define VMWGFX_DRIVER_MINOR 4
43+
#define VMWGFX_DRIVER_DATE "20110901"
44+
#define VMWGFX_DRIVER_MAJOR 2
45+
#define VMWGFX_DRIVER_MINOR 0
4646
#define VMWGFX_DRIVER_PATCHLEVEL 0
4747
#define VMWGFX_FILE_PAGE_OFFSET 0x00100000
4848
#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)

‎drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,20 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data,
734734
struct vmw_fence_obj *fence;
735735
uint32_t handle;
736736

737+
/*
738+
* This will allow us to extend the ioctl argument while
739+
* maintaining backwards compatibility:
740+
* We take different code paths depending on the value of
741+
* arg->version.
742+
*/
743+
744+
if (unlikely(arg->version != DRM_VMW_EXECBUF_VERSION)) {
745+
DRM_ERROR("Incorrect execbuf version.\n");
746+
DRM_ERROR("You're running outdated experimental "
747+
"vmwgfx user-space drivers.");
748+
return -EINVAL;
749+
}
750+
737751
ret = ttm_read_lock(&vmaster->lock, true);
738752
if (unlikely(ret != 0))
739753
return ret;

‎include/drm/vmwgfx_drm.h‎

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#define DRM_VMW_MAX_SURFACE_FACES 6
3232
#define DRM_VMW_MAX_MIP_LEVELS 24
3333

34-
#define DRM_VMW_EXT_NAME_LEN 128
3534

3635
#define DRM_VMW_GET_PARAM 0
3736
#define DRM_VMW_ALLOC_DMABUF 1
@@ -90,49 +89,6 @@ struct drm_vmw_getparam_arg {
9089
uint32_t pad64;
9190
};
9291

93-
/*************************************************************************/
94-
/**
95-
* DRM_VMW_EXTENSION - Query device extensions.
96-
*/
97-
98-
/**
99-
* struct drm_vmw_extension_rep
100-
*
101-
* @exists: The queried extension exists.
102-
* @driver_ioctl_offset: Ioctl number of the first ioctl in the extension.
103-
* @driver_sarea_offset: Offset to any space in the DRI SAREA
104-
* used by the extension.
105-
* @major: Major version number of the extension.
106-
* @minor: Minor version number of the extension.
107-
* @pl: Patch level version number of the extension.
108-
*
109-
* Output argument to the DRM_VMW_EXTENSION Ioctl.
110-
*/
111-
112-
struct drm_vmw_extension_rep {
113-
int32_t exists;
114-
uint32_t driver_ioctl_offset;
115-
uint32_t driver_sarea_offset;
116-
uint32_t major;
117-
uint32_t minor;
118-
uint32_t pl;
119-
uint32_t pad64;
120-
};
121-
122-
/**
123-
* union drm_vmw_extension_arg
124-
*
125-
* @extension - Ascii name of the extension to be queried. //In
126-
* @rep - Reply as defined above. //Out
127-
*
128-
* Argument to the DRM_VMW_EXTENSION Ioctl.
129-
*/
130-
131-
union drm_vmw_extension_arg {
132-
char extension[DRM_VMW_EXT_NAME_LEN];
133-
struct drm_vmw_extension_rep rep;
134-
};
135-
13692
/*************************************************************************/
13793
/**
13894
* DRM_VMW_CREATE_CONTEXT - Create a host context.
@@ -315,7 +271,7 @@ union drm_vmw_surface_reference_arg {
315271
* Argument to the DRM_VMW_EXECBUF Ioctl.
316272
*/
317273

318-
#define DRM_VMW_EXECBUF_VERSION 0
274+
#define DRM_VMW_EXECBUF_VERSION 1
319275

320276
struct drm_vmw_execbuf_arg {
321277
uint64_t commands;

0 commit comments

Comments
 (0)