Subversion Repositories Kolibri OS

Rev

Rev 6934 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6934 Rev 6936
1
/**************************************************************************
1
/**************************************************************************
2
 *
2
 *
3
 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
3
 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
4
 * All Rights Reserved.
4
 * All Rights Reserved.
5
 *
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a
6
 * Permission is hereby granted, free of charge, to any person obtaining a
7
 * copy of this software and associated documentation files (the
7
 * copy of this software and associated documentation files (the
8
 * "Software"), to deal in the Software without restriction, including
8
 * "Software"), to deal in the Software without restriction, including
9
 * without limitation the rights to use, copy, modify, merge, publish,
9
 * without limitation the rights to use, copy, modify, merge, publish,
10
 * distribute, sub license, and/or sell copies of the Software, and to
10
 * distribute, sub license, and/or sell copies of the Software, and to
11
 * permit persons to whom the Software is furnished to do so, subject to
11
 * permit persons to whom the Software is furnished to do so, subject to
12
 * the following conditions:
12
 * the following conditions:
13
 *
13
 *
14
 * The above copyright notice and this permission notice (including the
14
 * The above copyright notice and this permission notice (including the
15
 * next paragraph) shall be included in all copies or substantial portions
15
 * next paragraph) shall be included in all copies or substantial portions
16
 * of the Software.
16
 * of the Software.
17
 *
17
 *
18
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21
 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
21
 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
23
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
24
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25
 *
25
 *
26
 **************************************************************************/
26
 **************************************************************************/
27
 
27
 
28
#ifndef __VMWGFX_DRM_H__
28
#ifndef __VMWGFX_DRM_H__
29
#define __VMWGFX_DRM_H__
29
#define __VMWGFX_DRM_H__
30
 
-
 
31
#ifndef __KERNEL__
30
 
32
#include 
-
 
33
#endif
31
#include "drm.h"
34
 
32
 
35
#define DRM_VMW_MAX_SURFACE_FACES 6
33
#define DRM_VMW_MAX_SURFACE_FACES 6
36
#define DRM_VMW_MAX_MIP_LEVELS 24
34
#define DRM_VMW_MAX_MIP_LEVELS 24
37
 
35
 
38
 
36
 
39
#define DRM_VMW_GET_PARAM            0
37
#define DRM_VMW_GET_PARAM            0
40
#define DRM_VMW_ALLOC_DMABUF         1
38
#define DRM_VMW_ALLOC_DMABUF         1
41
#define DRM_VMW_UNREF_DMABUF         2
39
#define DRM_VMW_UNREF_DMABUF         2
42
#define DRM_VMW_CURSOR_BYPASS        3
40
#define DRM_VMW_CURSOR_BYPASS        3
43
/* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/
41
/* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/
44
#define DRM_VMW_CONTROL_STREAM       4
42
#define DRM_VMW_CONTROL_STREAM       4
45
#define DRM_VMW_CLAIM_STREAM         5
43
#define DRM_VMW_CLAIM_STREAM         5
46
#define DRM_VMW_UNREF_STREAM         6
44
#define DRM_VMW_UNREF_STREAM         6
47
/* guarded by DRM_VMW_PARAM_3D == 1 */
45
/* guarded by DRM_VMW_PARAM_3D == 1 */
48
#define DRM_VMW_CREATE_CONTEXT       7
46
#define DRM_VMW_CREATE_CONTEXT       7
49
#define DRM_VMW_UNREF_CONTEXT        8
47
#define DRM_VMW_UNREF_CONTEXT        8
50
#define DRM_VMW_CREATE_SURFACE       9
48
#define DRM_VMW_CREATE_SURFACE       9
51
#define DRM_VMW_UNREF_SURFACE        10
49
#define DRM_VMW_UNREF_SURFACE        10
52
#define DRM_VMW_REF_SURFACE          11
50
#define DRM_VMW_REF_SURFACE          11
53
#define DRM_VMW_EXECBUF              12
51
#define DRM_VMW_EXECBUF              12
54
#define DRM_VMW_GET_3D_CAP           13
52
#define DRM_VMW_GET_3D_CAP           13
55
#define DRM_VMW_FENCE_WAIT           14
53
#define DRM_VMW_FENCE_WAIT           14
56
#define DRM_VMW_FENCE_SIGNALED       15
54
#define DRM_VMW_FENCE_SIGNALED       15
57
#define DRM_VMW_FENCE_UNREF          16
55
#define DRM_VMW_FENCE_UNREF          16
58
#define DRM_VMW_FENCE_EVENT          17
56
#define DRM_VMW_FENCE_EVENT          17
59
#define DRM_VMW_PRESENT              18
57
#define DRM_VMW_PRESENT              18
60
#define DRM_VMW_PRESENT_READBACK     19
58
#define DRM_VMW_PRESENT_READBACK     19
61
#define DRM_VMW_UPDATE_LAYOUT        20
59
#define DRM_VMW_UPDATE_LAYOUT        20
62
#define DRM_VMW_CREATE_SHADER        21
60
#define DRM_VMW_CREATE_SHADER        21
63
#define DRM_VMW_UNREF_SHADER         22
61
#define DRM_VMW_UNREF_SHADER         22
64
#define DRM_VMW_GB_SURFACE_CREATE    23
62
#define DRM_VMW_GB_SURFACE_CREATE    23
65
#define DRM_VMW_GB_SURFACE_REF       24
63
#define DRM_VMW_GB_SURFACE_REF       24
66
#define DRM_VMW_SYNCCPU              25
64
#define DRM_VMW_SYNCCPU              25
67
#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
65
#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
68
 
66
 
69
/*************************************************************************/
67
/*************************************************************************/
70
/**
68
/**
71
 * DRM_VMW_GET_PARAM - get device information.
69
 * DRM_VMW_GET_PARAM - get device information.
72
 *
70
 *
73
 * DRM_VMW_PARAM_FIFO_OFFSET:
71
 * DRM_VMW_PARAM_FIFO_OFFSET:
74
 * Offset to use to map the first page of the FIFO read-only.
72
 * Offset to use to map the first page of the FIFO read-only.
75
 * The fifo is mapped using the mmap() system call on the drm device.
73
 * The fifo is mapped using the mmap() system call on the drm device.
76
 *
74
 *
77
 * DRM_VMW_PARAM_OVERLAY_IOCTL:
75
 * DRM_VMW_PARAM_OVERLAY_IOCTL:
78
 * Does the driver support the overlay ioctl.
76
 * Does the driver support the overlay ioctl.
79
 */
77
 */
80
 
78
 
81
#define DRM_VMW_PARAM_NUM_STREAMS      0
79
#define DRM_VMW_PARAM_NUM_STREAMS      0
82
#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
80
#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
83
#define DRM_VMW_PARAM_3D               2
81
#define DRM_VMW_PARAM_3D               2
84
#define DRM_VMW_PARAM_HW_CAPS          3
82
#define DRM_VMW_PARAM_HW_CAPS          3
85
#define DRM_VMW_PARAM_FIFO_CAPS        4
83
#define DRM_VMW_PARAM_FIFO_CAPS        4
86
#define DRM_VMW_PARAM_MAX_FB_SIZE      5
84
#define DRM_VMW_PARAM_MAX_FB_SIZE      5
87
#define DRM_VMW_PARAM_FIFO_HW_VERSION  6
85
#define DRM_VMW_PARAM_FIFO_HW_VERSION  6
88
#define DRM_VMW_PARAM_MAX_SURF_MEMORY  7
86
#define DRM_VMW_PARAM_MAX_SURF_MEMORY  7
89
#define DRM_VMW_PARAM_3D_CAPS_SIZE     8
87
#define DRM_VMW_PARAM_3D_CAPS_SIZE     8
90
#define DRM_VMW_PARAM_MAX_MOB_MEMORY   9
88
#define DRM_VMW_PARAM_MAX_MOB_MEMORY   9
91
#define DRM_VMW_PARAM_MAX_MOB_SIZE     10
89
#define DRM_VMW_PARAM_MAX_MOB_SIZE     10
92
#define DRM_VMW_PARAM_SCREEN_TARGET    11
90
#define DRM_VMW_PARAM_SCREEN_TARGET    11
93
#define DRM_VMW_PARAM_DX               12
91
#define DRM_VMW_PARAM_DX               12
94
 
92
 
95
/**
93
/**
96
 * enum drm_vmw_handle_type - handle type for ref ioctls
94
 * enum drm_vmw_handle_type - handle type for ref ioctls
97
 *
95
 *
98
 */
96
 */
99
enum drm_vmw_handle_type {
97
enum drm_vmw_handle_type {
100
	DRM_VMW_HANDLE_LEGACY = 0,
98
	DRM_VMW_HANDLE_LEGACY = 0,
101
	DRM_VMW_HANDLE_PRIME = 1
99
	DRM_VMW_HANDLE_PRIME = 1
102
};
100
};
103
 
101
 
104
/**
102
/**
105
 * struct drm_vmw_getparam_arg
103
 * struct drm_vmw_getparam_arg
106
 *
104
 *
107
 * @value: Returned value. //Out
105
 * @value: Returned value. //Out
108
 * @param: Parameter to query. //In.
106
 * @param: Parameter to query. //In.
109
 *
107
 *
110
 * Argument to the DRM_VMW_GET_PARAM Ioctl.
108
 * Argument to the DRM_VMW_GET_PARAM Ioctl.
111
 */
109
 */
112
 
110
 
113
struct drm_vmw_getparam_arg {
111
struct drm_vmw_getparam_arg {
114
	uint64_t value;
112
	__u64 value;
115
	uint32_t param;
113
	__u32 param;
116
	uint32_t pad64;
114
	__u32 pad64;
117
};
115
};
118
 
116
 
119
/*************************************************************************/
117
/*************************************************************************/
120
/**
118
/**
121
 * DRM_VMW_CREATE_CONTEXT - Create a host context.
119
 * DRM_VMW_CREATE_CONTEXT - Create a host context.
122
 *
120
 *
123
 * Allocates a device unique context id, and queues a create context command
121
 * Allocates a device unique context id, and queues a create context command
124
 * for the host. Does not wait for host completion.
122
 * for the host. Does not wait for host completion.
125
 */
123
 */
126
 
124
 
127
/**
125
/**
128
 * struct drm_vmw_context_arg
126
 * struct drm_vmw_context_arg
129
 *
127
 *
130
 * @cid: Device unique context ID.
128
 * @cid: Device unique context ID.
131
 *
129
 *
132
 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
130
 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
133
 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
131
 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
134
 */
132
 */
135
 
133
 
136
struct drm_vmw_context_arg {
134
struct drm_vmw_context_arg {
137
	int32_t cid;
135
	__s32 cid;
138
	uint32_t pad64;
136
	__u32 pad64;
139
};
137
};
140
 
138
 
141
/*************************************************************************/
139
/*************************************************************************/
142
/**
140
/**
143
 * DRM_VMW_UNREF_CONTEXT - Create a host context.
141
 * DRM_VMW_UNREF_CONTEXT - Create a host context.
144
 *
142
 *
145
 * Frees a global context id, and queues a destroy host command for the host.
143
 * Frees a global context id, and queues a destroy host command for the host.
146
 * Does not wait for host completion. The context ID can be used directly
144
 * Does not wait for host completion. The context ID can be used directly
147
 * in the command stream and shows up as the same context ID on the host.
145
 * in the command stream and shows up as the same context ID on the host.
148
 */
146
 */
149
 
147
 
150
/*************************************************************************/
148
/*************************************************************************/
151
/**
149
/**
152
 * DRM_VMW_CREATE_SURFACE - Create a host suface.
150
 * DRM_VMW_CREATE_SURFACE - Create a host suface.
153
 *
151
 *
154
 * Allocates a device unique surface id, and queues a create surface command
152
 * Allocates a device unique surface id, and queues a create surface command
155
 * for the host. Does not wait for host completion. The surface ID can be
153
 * for the host. Does not wait for host completion. The surface ID can be
156
 * used directly in the command stream and shows up as the same surface
154
 * used directly in the command stream and shows up as the same surface
157
 * ID on the host.
155
 * ID on the host.
158
 */
156
 */
159
 
157
 
160
/**
158
/**
161
 * struct drm_wmv_surface_create_req
159
 * struct drm_wmv_surface_create_req
162
 *
160
 *
163
 * @flags: Surface flags as understood by the host.
161
 * @flags: Surface flags as understood by the host.
164
 * @format: Surface format as understood by the host.
162
 * @format: Surface format as understood by the host.
165
 * @mip_levels: Number of mip levels for each face.
163
 * @mip_levels: Number of mip levels for each face.
166
 * An unused face should have 0 encoded.
164
 * An unused face should have 0 encoded.
167
 * @size_addr: Address of a user-space array of sruct drm_vmw_size
165
 * @size_addr: Address of a user-space array of sruct drm_vmw_size
168
 * cast to an uint64_t for 32-64 bit compatibility.
166
 * cast to an __u64 for 32-64 bit compatibility.
169
 * The size of the array should equal the total number of mipmap levels.
167
 * The size of the array should equal the total number of mipmap levels.
170
 * @shareable: Boolean whether other clients (as identified by file descriptors)
168
 * @shareable: Boolean whether other clients (as identified by file descriptors)
171
 * may reference this surface.
169
 * may reference this surface.
172
 * @scanout: Boolean whether the surface is intended to be used as a
170
 * @scanout: Boolean whether the surface is intended to be used as a
173
 * scanout.
171
 * scanout.
174
 *
172
 *
175
 * Input data to the DRM_VMW_CREATE_SURFACE Ioctl.
173
 * Input data to the DRM_VMW_CREATE_SURFACE Ioctl.
176
 * Output data from the DRM_VMW_REF_SURFACE Ioctl.
174
 * Output data from the DRM_VMW_REF_SURFACE Ioctl.
177
 */
175
 */
178
 
176
 
179
struct drm_vmw_surface_create_req {
177
struct drm_vmw_surface_create_req {
180
	uint32_t flags;
178
	__u32 flags;
181
	uint32_t format;
179
	__u32 format;
182
	uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES];
180
	__u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
183
	uint64_t size_addr;
181
	__u64 size_addr;
184
	int32_t shareable;
182
	__s32 shareable;
185
	int32_t scanout;
183
	__s32 scanout;
186
};
184
};
187
 
185
 
188
/**
186
/**
189
 * struct drm_wmv_surface_arg
187
 * struct drm_wmv_surface_arg
190
 *
188
 *
191
 * @sid: Surface id of created surface or surface to destroy or reference.
189
 * @sid: Surface id of created surface or surface to destroy or reference.
192
 * @handle_type: Handle type for DRM_VMW_REF_SURFACE Ioctl.
190
 * @handle_type: Handle type for DRM_VMW_REF_SURFACE Ioctl.
193
 *
191
 *
194
 * Output data from the DRM_VMW_CREATE_SURFACE Ioctl.
192
 * Output data from the DRM_VMW_CREATE_SURFACE Ioctl.
195
 * Input argument to the DRM_VMW_UNREF_SURFACE Ioctl.
193
 * Input argument to the DRM_VMW_UNREF_SURFACE Ioctl.
196
 * Input argument to the DRM_VMW_REF_SURFACE Ioctl.
194
 * Input argument to the DRM_VMW_REF_SURFACE Ioctl.
197
 */
195
 */
198
 
196
 
199
struct drm_vmw_surface_arg {
197
struct drm_vmw_surface_arg {
200
	int32_t sid;
198
	__s32 sid;
201
	enum drm_vmw_handle_type handle_type;
199
	enum drm_vmw_handle_type handle_type;
202
};
200
};
203
 
201
 
204
/**
202
/**
205
 * struct drm_vmw_size ioctl.
203
 * struct drm_vmw_size ioctl.
206
 *
204
 *
207
 * @width - mip level width
205
 * @width - mip level width
208
 * @height - mip level height
206
 * @height - mip level height
209
 * @depth - mip level depth
207
 * @depth - mip level depth
210
 *
208
 *
211
 * Description of a mip level.
209
 * Description of a mip level.
212
 * Input data to the DRM_WMW_CREATE_SURFACE Ioctl.
210
 * Input data to the DRM_WMW_CREATE_SURFACE Ioctl.
213
 */
211
 */
214
 
212
 
215
struct drm_vmw_size {
213
struct drm_vmw_size {
216
	uint32_t width;
214
	__u32 width;
217
	uint32_t height;
215
	__u32 height;
218
	uint32_t depth;
216
	__u32 depth;
219
	uint32_t pad64;
217
	__u32 pad64;
220
};
218
};
221
 
219
 
222
/**
220
/**
223
 * union drm_vmw_surface_create_arg
221
 * union drm_vmw_surface_create_arg
224
 *
222
 *
225
 * @rep: Output data as described above.
223
 * @rep: Output data as described above.
226
 * @req: Input data as described above.
224
 * @req: Input data as described above.
227
 *
225
 *
228
 * Argument to the DRM_VMW_CREATE_SURFACE Ioctl.
226
 * Argument to the DRM_VMW_CREATE_SURFACE Ioctl.
229
 */
227
 */
230
 
228
 
231
union drm_vmw_surface_create_arg {
229
union drm_vmw_surface_create_arg {
232
	struct drm_vmw_surface_arg rep;
230
	struct drm_vmw_surface_arg rep;
233
	struct drm_vmw_surface_create_req req;
231
	struct drm_vmw_surface_create_req req;
234
};
232
};
235
 
233
 
236
/*************************************************************************/
234
/*************************************************************************/
237
/**
235
/**
238
 * DRM_VMW_REF_SURFACE - Reference a host surface.
236
 * DRM_VMW_REF_SURFACE - Reference a host surface.
239
 *
237
 *
240
 * Puts a reference on a host surface with a give sid, as previously
238
 * Puts a reference on a host surface with a give sid, as previously
241
 * returned by the DRM_VMW_CREATE_SURFACE ioctl.
239
 * returned by the DRM_VMW_CREATE_SURFACE ioctl.
242
 * A reference will make sure the surface isn't destroyed while we hold
240
 * A reference will make sure the surface isn't destroyed while we hold
243
 * it and will allow the calling client to use the surface ID in the command
241
 * it and will allow the calling client to use the surface ID in the command
244
 * stream.
242
 * stream.
245
 *
243
 *
246
 * On successful return, the Ioctl returns the surface information given
244
 * On successful return, the Ioctl returns the surface information given
247
 * in the DRM_VMW_CREATE_SURFACE ioctl.
245
 * in the DRM_VMW_CREATE_SURFACE ioctl.
248
 */
246
 */
249
 
247
 
250
/**
248
/**
251
 * union drm_vmw_surface_reference_arg
249
 * union drm_vmw_surface_reference_arg
252
 *
250
 *
253
 * @rep: Output data as described above.
251
 * @rep: Output data as described above.
254
 * @req: Input data as described above.
252
 * @req: Input data as described above.
255
 *
253
 *
256
 * Argument to the DRM_VMW_REF_SURFACE Ioctl.
254
 * Argument to the DRM_VMW_REF_SURFACE Ioctl.
257
 */
255
 */
258
 
256
 
259
union drm_vmw_surface_reference_arg {
257
union drm_vmw_surface_reference_arg {
260
	struct drm_vmw_surface_create_req rep;
258
	struct drm_vmw_surface_create_req rep;
261
	struct drm_vmw_surface_arg req;
259
	struct drm_vmw_surface_arg req;
262
};
260
};
263
 
261
 
264
/*************************************************************************/
262
/*************************************************************************/
265
/**
263
/**
266
 * DRM_VMW_UNREF_SURFACE - Unreference a host surface.
264
 * DRM_VMW_UNREF_SURFACE - Unreference a host surface.
267
 *
265
 *
268
 * Clear a reference previously put on a host surface.
266
 * Clear a reference previously put on a host surface.
269
 * When all references are gone, including the one implicitly placed
267
 * When all references are gone, including the one implicitly placed
270
 * on creation,
268
 * on creation,
271
 * a destroy surface command will be queued for the host.
269
 * a destroy surface command will be queued for the host.
272
 * Does not wait for completion.
270
 * Does not wait for completion.
273
 */
271
 */
274
 
272
 
275
/*************************************************************************/
273
/*************************************************************************/
276
/**
274
/**
277
 * DRM_VMW_EXECBUF
275
 * DRM_VMW_EXECBUF
278
 *
276
 *
279
 * Submit a command buffer for execution on the host, and return a
277
 * Submit a command buffer for execution on the host, and return a
280
 * fence seqno that when signaled, indicates that the command buffer has
278
 * fence seqno that when signaled, indicates that the command buffer has
281
 * executed.
279
 * executed.
282
 */
280
 */
283
 
281
 
284
/**
282
/**
285
 * struct drm_vmw_execbuf_arg
283
 * struct drm_vmw_execbuf_arg
286
 *
284
 *
287
 * @commands: User-space address of a command buffer cast to an uint64_t.
285
 * @commands: User-space address of a command buffer cast to an __u64.
288
 * @command-size: Size in bytes of the command buffer.
286
 * @command-size: Size in bytes of the command buffer.
289
 * @throttle-us: Sleep until software is less than @throttle_us
287
 * @throttle-us: Sleep until software is less than @throttle_us
290
 * microseconds ahead of hardware. The driver may round this value
288
 * microseconds ahead of hardware. The driver may round this value
291
 * to the nearest kernel tick.
289
 * to the nearest kernel tick.
292
 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
290
 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
293
 * uint64_t.
291
 * __u64.
294
 * @version: Allows expanding the execbuf ioctl parameters without breaking
292
 * @version: Allows expanding the execbuf ioctl parameters without breaking
295
 * backwards compatibility, since user-space will always tell the kernel
293
 * backwards compatibility, since user-space will always tell the kernel
296
 * which version it uses.
294
 * which version it uses.
297
 * @flags: Execbuf flags. None currently.
295
 * @flags: Execbuf flags. None currently.
298
 *
296
 *
299
 * Argument to the DRM_VMW_EXECBUF Ioctl.
297
 * Argument to the DRM_VMW_EXECBUF Ioctl.
300
 */
298
 */
301
 
299
 
302
#define DRM_VMW_EXECBUF_VERSION 2
300
#define DRM_VMW_EXECBUF_VERSION 2
303
 
301
 
304
struct drm_vmw_execbuf_arg {
302
struct drm_vmw_execbuf_arg {
305
	uint64_t commands;
303
	__u64 commands;
306
	uint32_t command_size;
304
	__u32 command_size;
307
	uint32_t throttle_us;
305
	__u32 throttle_us;
308
	uint64_t fence_rep;
306
	__u64 fence_rep;
309
	uint32_t version;
307
	__u32 version;
310
	uint32_t flags;
308
	__u32 flags;
311
	uint32_t context_handle;
309
	__u32 context_handle;
312
	uint32_t pad64;
310
	__u32 pad64;
313
};
311
};
314
 
312
 
315
/**
313
/**
316
 * struct drm_vmw_fence_rep
314
 * struct drm_vmw_fence_rep
317
 *
315
 *
318
 * @handle: Fence object handle for fence associated with a command submission.
316
 * @handle: Fence object handle for fence associated with a command submission.
319
 * @mask: Fence flags relevant for this fence object.
317
 * @mask: Fence flags relevant for this fence object.
320
 * @seqno: Fence sequence number in fifo. A fence object with a lower
318
 * @seqno: Fence sequence number in fifo. A fence object with a lower
321
 * seqno will signal the EXEC flag before a fence object with a higher
319
 * seqno will signal the EXEC flag before a fence object with a higher
322
 * seqno. This can be used by user-space to avoid kernel calls to determine
320
 * seqno. This can be used by user-space to avoid kernel calls to determine
323
 * whether a fence has signaled the EXEC flag. Note that @seqno will
321
 * whether a fence has signaled the EXEC flag. Note that @seqno will
324
 * wrap at 32-bit.
322
 * wrap at 32-bit.
325
 * @passed_seqno: The highest seqno number processed by the hardware
323
 * @passed_seqno: The highest seqno number processed by the hardware
326
 * so far. This can be used to mark user-space fence objects as signaled, and
324
 * so far. This can be used to mark user-space fence objects as signaled, and
327
 * to determine whether a fence seqno might be stale.
325
 * to determine whether a fence seqno might be stale.
328
 * @error: This member should've been set to -EFAULT on submission.
326
 * @error: This member should've been set to -EFAULT on submission.
329
 * The following actions should be take on completion:
327
 * The following actions should be take on completion:
330
 * error == -EFAULT: Fence communication failed. The host is synchronized.
328
 * error == -EFAULT: Fence communication failed. The host is synchronized.
331
 * Use the last fence id read from the FIFO fence register.
329
 * Use the last fence id read from the FIFO fence register.
332
 * error != 0 && error != -EFAULT:
330
 * error != 0 && error != -EFAULT:
333
 * Fence submission failed. The host is synchronized. Use the fence_seq member.
331
 * Fence submission failed. The host is synchronized. Use the fence_seq member.
334
 * error == 0: All is OK, The host may not be synchronized.
332
 * error == 0: All is OK, The host may not be synchronized.
335
 * Use the fence_seq member.
333
 * Use the fence_seq member.
336
 *
334
 *
337
 * Input / Output data to the DRM_VMW_EXECBUF Ioctl.
335
 * Input / Output data to the DRM_VMW_EXECBUF Ioctl.
338
 */
336
 */
339
 
337
 
340
struct drm_vmw_fence_rep {
338
struct drm_vmw_fence_rep {
341
	uint32_t handle;
339
	__u32 handle;
342
	uint32_t mask;
340
	__u32 mask;
343
	uint32_t seqno;
341
	__u32 seqno;
344
	uint32_t passed_seqno;
342
	__u32 passed_seqno;
345
	uint32_t pad64;
343
	__u32 pad64;
346
	int32_t error;
344
	__s32 error;
347
};
345
};
348
 
346
 
349
/*************************************************************************/
347
/*************************************************************************/
350
/**
348
/**
351
 * DRM_VMW_ALLOC_DMABUF
349
 * DRM_VMW_ALLOC_DMABUF
352
 *
350
 *
353
 * Allocate a DMA buffer that is visible also to the host.
351
 * Allocate a DMA buffer that is visible also to the host.
354
 * NOTE: The buffer is
352
 * NOTE: The buffer is
355
 * identified by a handle and an offset, which are private to the guest, but
353
 * identified by a handle and an offset, which are private to the guest, but
356
 * useable in the command stream. The guest kernel may translate these
354
 * useable in the command stream. The guest kernel may translate these
357
 * and patch up the command stream accordingly. In the future, the offset may
355
 * and patch up the command stream accordingly. In the future, the offset may
358
 * be zero at all times, or it may disappear from the interface before it is
356
 * be zero at all times, or it may disappear from the interface before it is
359
 * fixed.
357
 * fixed.
360
 *
358
 *
361
 * The DMA buffer may stay user-space mapped in the guest at all times,
359
 * The DMA buffer may stay user-space mapped in the guest at all times,
362
 * and is thus suitable for sub-allocation.
360
 * and is thus suitable for sub-allocation.
363
 *
361
 *
364
 * DMA buffers are mapped using the mmap() syscall on the drm device.
362
 * DMA buffers are mapped using the mmap() syscall on the drm device.
365
 */
363
 */
366
 
364
 
367
/**
365
/**
368
 * struct drm_vmw_alloc_dmabuf_req
366
 * struct drm_vmw_alloc_dmabuf_req
369
 *
367
 *
370
 * @size: Required minimum size of the buffer.
368
 * @size: Required minimum size of the buffer.
371
 *
369
 *
372
 * Input data to the DRM_VMW_ALLOC_DMABUF Ioctl.
370
 * Input data to the DRM_VMW_ALLOC_DMABUF Ioctl.
373
 */
371
 */
374
 
372
 
375
struct drm_vmw_alloc_dmabuf_req {
373
struct drm_vmw_alloc_dmabuf_req {
376
	uint32_t size;
374
	__u32 size;
377
	uint32_t pad64;
375
	__u32 pad64;
378
};
376
};
379
 
377
 
380
/**
378
/**
381
 * struct drm_vmw_dmabuf_rep
379
 * struct drm_vmw_dmabuf_rep
382
 *
380
 *
383
 * @map_handle: Offset to use in the mmap() call used to map the buffer.
381
 * @map_handle: Offset to use in the mmap() call used to map the buffer.
384
 * @handle: Handle unique to this buffer. Used for unreferencing.
382
 * @handle: Handle unique to this buffer. Used for unreferencing.
385
 * @cur_gmr_id: GMR id to use in the command stream when this buffer is
383
 * @cur_gmr_id: GMR id to use in the command stream when this buffer is
386
 * referenced. See not above.
384
 * referenced. See not above.
387
 * @cur_gmr_offset: Offset to use in the command stream when this buffer is
385
 * @cur_gmr_offset: Offset to use in the command stream when this buffer is
388
 * referenced. See note above.
386
 * referenced. See note above.
389
 *
387
 *
390
 * Output data from the DRM_VMW_ALLOC_DMABUF Ioctl.
388
 * Output data from the DRM_VMW_ALLOC_DMABUF Ioctl.
391
 */
389
 */
392
 
390
 
393
struct drm_vmw_dmabuf_rep {
391
struct drm_vmw_dmabuf_rep {
394
	uint64_t map_handle;
392
	__u64 map_handle;
395
	uint32_t handle;
393
	__u32 handle;
396
	uint32_t cur_gmr_id;
394
	__u32 cur_gmr_id;
397
	uint32_t cur_gmr_offset;
395
	__u32 cur_gmr_offset;
398
	uint32_t pad64;
396
	__u32 pad64;
399
};
397
};
400
 
398
 
401
/**
399
/**
402
 * union drm_vmw_dmabuf_arg
400
 * union drm_vmw_dmabuf_arg
403
 *
401
 *
404
 * @req: Input data as described above.
402
 * @req: Input data as described above.
405
 * @rep: Output data as described above.
403
 * @rep: Output data as described above.
406
 *
404
 *
407
 * Argument to the DRM_VMW_ALLOC_DMABUF Ioctl.
405
 * Argument to the DRM_VMW_ALLOC_DMABUF Ioctl.
408
 */
406
 */
409
 
407
 
410
union drm_vmw_alloc_dmabuf_arg {
408
union drm_vmw_alloc_dmabuf_arg {
411
	struct drm_vmw_alloc_dmabuf_req req;
409
	struct drm_vmw_alloc_dmabuf_req req;
412
	struct drm_vmw_dmabuf_rep rep;
410
	struct drm_vmw_dmabuf_rep rep;
413
};
411
};
414
 
412
 
415
/*************************************************************************/
413
/*************************************************************************/
416
/**
414
/**
417
 * DRM_VMW_UNREF_DMABUF - Free a DMA buffer.
415
 * DRM_VMW_UNREF_DMABUF - Free a DMA buffer.
418
 *
416
 *
419
 */
417
 */
420
 
418
 
421
/**
419
/**
422
 * struct drm_vmw_unref_dmabuf_arg
420
 * struct drm_vmw_unref_dmabuf_arg
423
 *
421
 *
424
 * @handle: Handle indicating what buffer to free. Obtained from the
422
 * @handle: Handle indicating what buffer to free. Obtained from the
425
 * DRM_VMW_ALLOC_DMABUF Ioctl.
423
 * DRM_VMW_ALLOC_DMABUF Ioctl.
426
 *
424
 *
427
 * Argument to the DRM_VMW_UNREF_DMABUF Ioctl.
425
 * Argument to the DRM_VMW_UNREF_DMABUF Ioctl.
428
 */
426
 */
429
 
427
 
430
struct drm_vmw_unref_dmabuf_arg {
428
struct drm_vmw_unref_dmabuf_arg {
431
	uint32_t handle;
429
	__u32 handle;
432
	uint32_t pad64;
430
	__u32 pad64;
433
};
431
};
434
 
432
 
435
/*************************************************************************/
433
/*************************************************************************/
436
/**
434
/**
437
 * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams.
435
 * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams.
438
 *
436
 *
439
 * This IOCTL controls the overlay units of the svga device.
437
 * This IOCTL controls the overlay units of the svga device.
440
 * The SVGA overlay units does not work like regular hardware units in
438
 * The SVGA overlay units does not work like regular hardware units in
441
 * that they do not automaticaly read back the contents of the given dma
439
 * that they do not automaticaly read back the contents of the given dma
442
 * buffer. But instead only read back for each call to this ioctl, and
440
 * buffer. But instead only read back for each call to this ioctl, and
443
 * at any point between this call being made and a following call that
441
 * at any point between this call being made and a following call that
444
 * either changes the buffer or disables the stream.
442
 * either changes the buffer or disables the stream.
445
 */
443
 */
446
 
444
 
447
/**
445
/**
448
 * struct drm_vmw_rect
446
 * struct drm_vmw_rect
449
 *
447
 *
450
 * Defines a rectangle. Used in the overlay ioctl to define
448
 * Defines a rectangle. Used in the overlay ioctl to define
451
 * source and destination rectangle.
449
 * source and destination rectangle.
452
 */
450
 */
453
 
451
 
454
struct drm_vmw_rect {
452
struct drm_vmw_rect {
455
	int32_t x;
453
	__s32 x;
456
	int32_t y;
454
	__s32 y;
457
	uint32_t w;
455
	__u32 w;
458
	uint32_t h;
456
	__u32 h;
459
};
457
};
460
 
458
 
461
/**
459
/**
462
 * struct drm_vmw_control_stream_arg
460
 * struct drm_vmw_control_stream_arg
463
 *
461
 *
464
 * @stream_id: Stearm to control
462
 * @stream_id: Stearm to control
465
 * @enabled: If false all following arguments are ignored.
463
 * @enabled: If false all following arguments are ignored.
466
 * @handle: Handle to buffer for getting data from.
464
 * @handle: Handle to buffer for getting data from.
467
 * @format: Format of the overlay as understood by the host.
465
 * @format: Format of the overlay as understood by the host.
468
 * @width: Width of the overlay.
466
 * @width: Width of the overlay.
469
 * @height: Height of the overlay.
467
 * @height: Height of the overlay.
470
 * @size: Size of the overlay in bytes.
468
 * @size: Size of the overlay in bytes.
471
 * @pitch: Array of pitches, the two last are only used for YUV12 formats.
469
 * @pitch: Array of pitches, the two last are only used for YUV12 formats.
472
 * @offset: Offset from start of dma buffer to overlay.
470
 * @offset: Offset from start of dma buffer to overlay.
473
 * @src: Source rect, must be within the defined area above.
471
 * @src: Source rect, must be within the defined area above.
474
 * @dst: Destination rect, x and y may be negative.
472
 * @dst: Destination rect, x and y may be negative.
475
 *
473
 *
476
 * Argument to the DRM_VMW_CONTROL_STREAM Ioctl.
474
 * Argument to the DRM_VMW_CONTROL_STREAM Ioctl.
477
 */
475
 */
478
 
476
 
479
struct drm_vmw_control_stream_arg {
477
struct drm_vmw_control_stream_arg {
480
	uint32_t stream_id;
478
	__u32 stream_id;
481
	uint32_t enabled;
479
	__u32 enabled;
482
 
480
 
483
	uint32_t flags;
481
	__u32 flags;
484
	uint32_t color_key;
482
	__u32 color_key;
485
 
483
 
486
	uint32_t handle;
484
	__u32 handle;
487
	uint32_t offset;
485
	__u32 offset;
488
	int32_t format;
486
	__s32 format;
489
	uint32_t size;
487
	__u32 size;
490
	uint32_t width;
488
	__u32 width;
491
	uint32_t height;
489
	__u32 height;
492
	uint32_t pitch[3];
490
	__u32 pitch[3];
493
 
491
 
494
	uint32_t pad64;
492
	__u32 pad64;
495
	struct drm_vmw_rect src;
493
	struct drm_vmw_rect src;
496
	struct drm_vmw_rect dst;
494
	struct drm_vmw_rect dst;
497
};
495
};
498
 
496
 
499
/*************************************************************************/
497
/*************************************************************************/
500
/**
498
/**
501
 * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass.
499
 * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass.
502
 *
500
 *
503
 */
501
 */
504
 
502
 
505
#define DRM_VMW_CURSOR_BYPASS_ALL    (1 << 0)
503
#define DRM_VMW_CURSOR_BYPASS_ALL    (1 << 0)
506
#define DRM_VMW_CURSOR_BYPASS_FLAGS       (1)
504
#define DRM_VMW_CURSOR_BYPASS_FLAGS       (1)
507
 
505
 
508
/**
506
/**
509
 * struct drm_vmw_cursor_bypass_arg
507
 * struct drm_vmw_cursor_bypass_arg
510
 *
508
 *
511
 * @flags: Flags.
509
 * @flags: Flags.
512
 * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed.
510
 * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed.
513
 * @xpos: X position of cursor.
511
 * @xpos: X position of cursor.
514
 * @ypos: Y position of cursor.
512
 * @ypos: Y position of cursor.
515
 * @xhot: X hotspot.
513
 * @xhot: X hotspot.
516
 * @yhot: Y hotspot.
514
 * @yhot: Y hotspot.
517
 *
515
 *
518
 * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl.
516
 * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl.
519
 */
517
 */
520
 
518
 
521
struct drm_vmw_cursor_bypass_arg {
519
struct drm_vmw_cursor_bypass_arg {
522
	uint32_t flags;
520
	__u32 flags;
523
	uint32_t crtc_id;
521
	__u32 crtc_id;
524
	int32_t xpos;
522
	__s32 xpos;
525
	int32_t ypos;
523
	__s32 ypos;
526
	int32_t xhot;
524
	__s32 xhot;
527
	int32_t yhot;
525
	__s32 yhot;
528
};
526
};
529
 
527
 
530
/*************************************************************************/
528
/*************************************************************************/
531
/**
529
/**
532
 * DRM_VMW_CLAIM_STREAM - Claim a single stream.
530
 * DRM_VMW_CLAIM_STREAM - Claim a single stream.
533
 */
531
 */
534
 
532
 
535
/**
533
/**
536
 * struct drm_vmw_context_arg
534
 * struct drm_vmw_context_arg
537
 *
535
 *
538
 * @stream_id: Device unique context ID.
536
 * @stream_id: Device unique context ID.
539
 *
537
 *
540
 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
538
 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
541
 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
539
 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
542
 */
540
 */
543
 
541
 
544
struct drm_vmw_stream_arg {
542
struct drm_vmw_stream_arg {
545
	uint32_t stream_id;
543
	__u32 stream_id;
546
	uint32_t pad64;
544
	__u32 pad64;
547
};
545
};
548
 
546
 
549
/*************************************************************************/
547
/*************************************************************************/
550
/**
548
/**
551
 * DRM_VMW_UNREF_STREAM - Unclaim a stream.
549
 * DRM_VMW_UNREF_STREAM - Unclaim a stream.
552
 *
550
 *
553
 * Return a single stream that was claimed by this process. Also makes
551
 * Return a single stream that was claimed by this process. Also makes
554
 * sure that the stream has been stopped.
552
 * sure that the stream has been stopped.
555
 */
553
 */
556
 
554
 
557
/*************************************************************************/
555
/*************************************************************************/
558
/**
556
/**
559
 * DRM_VMW_GET_3D_CAP
557
 * DRM_VMW_GET_3D_CAP
560
 *
558
 *
561
 * Read 3D capabilities from the FIFO
559
 * Read 3D capabilities from the FIFO
562
 *
560
 *
563
 */
561
 */
564
 
562
 
565
/**
563
/**
566
 * struct drm_vmw_get_3d_cap_arg
564
 * struct drm_vmw_get_3d_cap_arg
567
 *
565
 *
568
 * @buffer: Pointer to a buffer for capability data, cast to an uint64_t
566
 * @buffer: Pointer to a buffer for capability data, cast to an __u64
569
 * @size: Max size to copy
567
 * @size: Max size to copy
570
 *
568
 *
571
 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
569
 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
572
 * ioctls.
570
 * ioctls.
573
 */
571
 */
574
 
572
 
575
struct drm_vmw_get_3d_cap_arg {
573
struct drm_vmw_get_3d_cap_arg {
576
	uint64_t buffer;
574
	__u64 buffer;
577
	uint32_t max_size;
575
	__u32 max_size;
578
	uint32_t pad64;
576
	__u32 pad64;
579
};
577
};
580
 
578
 
581
/*************************************************************************/
579
/*************************************************************************/
582
/**
580
/**
583
 * DRM_VMW_FENCE_WAIT
581
 * DRM_VMW_FENCE_WAIT
584
 *
582
 *
585
 * Waits for a fence object to signal. The wait is interruptible, so that
583
 * Waits for a fence object to signal. The wait is interruptible, so that
586
 * signals may be delivered during the interrupt. The wait may timeout,
584
 * signals may be delivered during the interrupt. The wait may timeout,
587
 * in which case the calls returns -EBUSY. If the wait is restarted,
585
 * in which case the calls returns -EBUSY. If the wait is restarted,
588
 * that is restarting without resetting @cookie_valid to zero,
586
 * that is restarting without resetting @cookie_valid to zero,
589
 * the timeout is computed from the first call.
587
 * the timeout is computed from the first call.
590
 *
588
 *
591
 * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait
589
 * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait
592
 * on:
590
 * on:
593
 * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command
591
 * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command
594
 * stream
592
 * stream
595
 * have executed.
593
 * have executed.
596
 * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish
594
 * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish
597
 * commands
595
 * commands
598
 * in the buffer given to the EXECBUF ioctl returning the fence object handle
596
 * in the buffer given to the EXECBUF ioctl returning the fence object handle
599
 * are available to user-space.
597
 * are available to user-space.
600
 *
598
 *
601
 * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the
599
 * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the
602
 * fenc wait ioctl returns 0, the fence object has been unreferenced after
600
 * fenc wait ioctl returns 0, the fence object has been unreferenced after
603
 * the wait.
601
 * the wait.
604
 */
602
 */
605
 
603
 
606
#define DRM_VMW_FENCE_FLAG_EXEC   (1 << 0)
604
#define DRM_VMW_FENCE_FLAG_EXEC   (1 << 0)
607
#define DRM_VMW_FENCE_FLAG_QUERY  (1 << 1)
605
#define DRM_VMW_FENCE_FLAG_QUERY  (1 << 1)
608
 
606
 
609
#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
607
#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
610
 
608
 
611
/**
609
/**
612
 * struct drm_vmw_fence_wait_arg
610
 * struct drm_vmw_fence_wait_arg
613
 *
611
 *
614
 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
612
 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
615
 * @cookie_valid: Must be reset to 0 on first call. Left alone on restart.
613
 * @cookie_valid: Must be reset to 0 on first call. Left alone on restart.
616
 * @kernel_cookie: Set to 0 on first call. Left alone on restart.
614
 * @kernel_cookie: Set to 0 on first call. Left alone on restart.
617
 * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout.
615
 * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout.
618
 * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick
616
 * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick
619
 * before returning.
617
 * before returning.
620
 * @flags: Fence flags to wait on.
618
 * @flags: Fence flags to wait on.
621
 * @wait_options: Options that control the behaviour of the wait ioctl.
619
 * @wait_options: Options that control the behaviour of the wait ioctl.
622
 *
620
 *
623
 * Input argument to the DRM_VMW_FENCE_WAIT ioctl.
621
 * Input argument to the DRM_VMW_FENCE_WAIT ioctl.
624
 */
622
 */
625
 
623
 
626
struct drm_vmw_fence_wait_arg {
624
struct drm_vmw_fence_wait_arg {
627
	uint32_t handle;
625
	__u32 handle;
628
	int32_t  cookie_valid;
626
	__s32  cookie_valid;
629
	uint64_t kernel_cookie;
627
	__u64 kernel_cookie;
630
	uint64_t timeout_us;
628
	__u64 timeout_us;
631
	int32_t lazy;
629
	__s32 lazy;
632
	int32_t flags;
630
	__s32 flags;
633
	int32_t wait_options;
631
	__s32 wait_options;
634
	int32_t pad64;
632
	__s32 pad64;
635
};
633
};
636
 
634
 
637
/*************************************************************************/
635
/*************************************************************************/
638
/**
636
/**
639
 * DRM_VMW_FENCE_SIGNALED
637
 * DRM_VMW_FENCE_SIGNALED
640
 *
638
 *
641
 * Checks if a fence object is signaled..
639
 * Checks if a fence object is signaled..
642
 */
640
 */
643
 
641
 
644
/**
642
/**
645
 * struct drm_vmw_fence_signaled_arg
643
 * struct drm_vmw_fence_signaled_arg
646
 *
644
 *
647
 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
645
 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
648
 * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl
646
 * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl
649
 * @signaled: Out: Flags signaled.
647
 * @signaled: Out: Flags signaled.
650
 * @sequence: Out: Highest sequence passed so far. Can be used to signal the
648
 * @sequence: Out: Highest sequence passed so far. Can be used to signal the
651
 * EXEC flag of user-space fence objects.
649
 * EXEC flag of user-space fence objects.
652
 *
650
 *
653
 * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF
651
 * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF
654
 * ioctls.
652
 * ioctls.
655
 */
653
 */
656
 
654
 
657
struct drm_vmw_fence_signaled_arg {
655
struct drm_vmw_fence_signaled_arg {
658
	 uint32_t handle;
656
	 __u32 handle;
659
	 uint32_t flags;
657
	 __u32 flags;
660
	 int32_t signaled;
658
	 __s32 signaled;
661
	 uint32_t passed_seqno;
659
	 __u32 passed_seqno;
662
	 uint32_t signaled_flags;
660
	 __u32 signaled_flags;
663
	 uint32_t pad64;
661
	 __u32 pad64;
664
};
662
};
665
 
663
 
666
/*************************************************************************/
664
/*************************************************************************/
667
/**
665
/**
668
 * DRM_VMW_FENCE_UNREF
666
 * DRM_VMW_FENCE_UNREF
669
 *
667
 *
670
 * Unreferences a fence object, and causes it to be destroyed if there are no
668
 * Unreferences a fence object, and causes it to be destroyed if there are no
671
 * other references to it.
669
 * other references to it.
672
 *
670
 *
673
 */
671
 */
674
 
672
 
675
/**
673
/**
676
 * struct drm_vmw_fence_arg
674
 * struct drm_vmw_fence_arg
677
 *
675
 *
678
 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
676
 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
679
 *
677
 *
680
 * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl..
678
 * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl..
681
 */
679
 */
682
 
680
 
683
struct drm_vmw_fence_arg {
681
struct drm_vmw_fence_arg {
684
	 uint32_t handle;
682
	 __u32 handle;
685
	 uint32_t pad64;
683
	 __u32 pad64;
686
};
684
};
687
 
685
 
688
 
686
 
689
/*************************************************************************/
687
/*************************************************************************/
690
/**
688
/**
691
 * DRM_VMW_FENCE_EVENT
689
 * DRM_VMW_FENCE_EVENT
692
 *
690
 *
693
 * Queues an event on a fence to be delivered on the drm character device
691
 * Queues an event on a fence to be delivered on the drm character device
694
 * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag.
692
 * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag.
695
 * Optionally the approximate time when the fence signaled is
693
 * Optionally the approximate time when the fence signaled is
696
 * given by the event.
694
 * given by the event.
697
 */
695
 */
698
 
696
 
699
/*
697
/*
700
 * The event type
698
 * The event type
701
 */
699
 */
702
#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
700
#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
703
 
701
 
704
struct drm_vmw_event_fence {
702
struct drm_vmw_event_fence {
705
	struct drm_event base;
703
	struct drm_event base;
706
	uint64_t user_data;
704
	__u64 user_data;
707
	uint32_t tv_sec;
705
	__u32 tv_sec;
708
	uint32_t tv_usec;
706
	__u32 tv_usec;
709
};
707
};
710
 
708
 
711
/*
709
/*
712
 * Flags that may be given to the command.
710
 * Flags that may be given to the command.
713
 */
711
 */
714
/* Request fence signaled time on the event. */
712
/* Request fence signaled time on the event. */
715
#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
713
#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
716
 
714
 
717
/**
715
/**
718
 * struct drm_vmw_fence_event_arg
716
 * struct drm_vmw_fence_event_arg
719
 *
717
 *
720
 * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if
718
 * @fence_rep: Pointer to fence_rep structure cast to __u64 or 0 if
721
 * the fence is not supposed to be referenced by user-space.
719
 * the fence is not supposed to be referenced by user-space.
722
 * @user_info: Info to be delivered with the event.
720
 * @user_info: Info to be delivered with the event.
723
 * @handle: Attach the event to this fence only.
721
 * @handle: Attach the event to this fence only.
724
 * @flags: A set of flags as defined above.
722
 * @flags: A set of flags as defined above.
725
 */
723
 */
726
struct drm_vmw_fence_event_arg {
724
struct drm_vmw_fence_event_arg {
727
	uint64_t fence_rep;
725
	__u64 fence_rep;
728
	uint64_t user_data;
726
	__u64 user_data;
729
	uint32_t handle;
727
	__u32 handle;
730
	uint32_t flags;
728
	__u32 flags;
731
};
729
};
732
 
730
 
733
 
731
 
734
/*************************************************************************/
732
/*************************************************************************/
735
/**
733
/**
736
 * DRM_VMW_PRESENT
734
 * DRM_VMW_PRESENT
737
 *
735
 *
738
 * Executes an SVGA present on a given fb for a given surface. The surface
736
 * Executes an SVGA present on a given fb for a given surface. The surface
739
 * is placed on the framebuffer. Cliprects are given relative to the given
737
 * is placed on the framebuffer. Cliprects are given relative to the given
740
 * point (the point disignated by dest_{x|y}).
738
 * point (the point disignated by dest_{x|y}).
741
 *
739
 *
742
 */
740
 */
743
 
741
 
744
/**
742
/**
745
 * struct drm_vmw_present_arg
743
 * struct drm_vmw_present_arg
746
 * @fb_id: framebuffer id to present / read back from.
744
 * @fb_id: framebuffer id to present / read back from.
747
 * @sid: Surface id to present from.
745
 * @sid: Surface id to present from.
748
 * @dest_x: X placement coordinate for surface.
746
 * @dest_x: X placement coordinate for surface.
749
 * @dest_y: Y placement coordinate for surface.
747
 * @dest_y: Y placement coordinate for surface.
750
 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
748
 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
751
 * @num_clips: Number of cliprects given relative to the framebuffer origin,
749
 * @num_clips: Number of cliprects given relative to the framebuffer origin,
752
 * in the same coordinate space as the frame buffer.
750
 * in the same coordinate space as the frame buffer.
753
 * @pad64: Unused 64-bit padding.
751
 * @pad64: Unused 64-bit padding.
754
 *
752
 *
755
 * Input argument to the DRM_VMW_PRESENT ioctl.
753
 * Input argument to the DRM_VMW_PRESENT ioctl.
756
 */
754
 */
757
 
755
 
758
struct drm_vmw_present_arg {
756
struct drm_vmw_present_arg {
759
	uint32_t fb_id;
757
	__u32 fb_id;
760
	uint32_t sid;
758
	__u32 sid;
761
	int32_t dest_x;
759
	__s32 dest_x;
762
	int32_t dest_y;
760
	__s32 dest_y;
763
	uint64_t clips_ptr;
761
	__u64 clips_ptr;
764
	uint32_t num_clips;
762
	__u32 num_clips;
765
	uint32_t pad64;
763
	__u32 pad64;
766
};
764
};
767
 
765
 
768
 
766
 
769
/*************************************************************************/
767
/*************************************************************************/
770
/**
768
/**
771
 * DRM_VMW_PRESENT_READBACK
769
 * DRM_VMW_PRESENT_READBACK
772
 *
770
 *
773
 * Executes an SVGA present readback from a given fb to the dma buffer
771
 * Executes an SVGA present readback from a given fb to the dma buffer
774
 * currently bound as the fb. If there is no dma buffer bound to the fb,
772
 * currently bound as the fb. If there is no dma buffer bound to the fb,
775
 * an error will be returned.
773
 * an error will be returned.
776
 *
774
 *
777
 */
775
 */
778
 
776
 
779
/**
777
/**
780
 * struct drm_vmw_present_arg
778
 * struct drm_vmw_present_arg
781
 * @fb_id: fb_id to present / read back from.
779
 * @fb_id: fb_id to present / read back from.
782
 * @num_clips: Number of cliprects.
780
 * @num_clips: Number of cliprects.
783
 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
781
 * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
784
 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t.
782
 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an __u64.
785
 * If this member is NULL, then the ioctl should not return a fence.
783
 * If this member is NULL, then the ioctl should not return a fence.
786
 */
784
 */
787
 
785
 
788
struct drm_vmw_present_readback_arg {
786
struct drm_vmw_present_readback_arg {
789
	 uint32_t fb_id;
787
	 __u32 fb_id;
790
	 uint32_t num_clips;
788
	 __u32 num_clips;
791
	 uint64_t clips_ptr;
789
	 __u64 clips_ptr;
792
	 uint64_t fence_rep;
790
	 __u64 fence_rep;
793
};
791
};
794
 
792
 
795
/*************************************************************************/
793
/*************************************************************************/
796
/**
794
/**
797
 * DRM_VMW_UPDATE_LAYOUT - Update layout
795
 * DRM_VMW_UPDATE_LAYOUT - Update layout
798
 *
796
 *
799
 * Updates the preferred modes and connection status for connectors. The
797
 * Updates the preferred modes and connection status for connectors. The
800
 * command consists of one drm_vmw_update_layout_arg pointing to an array
798
 * command consists of one drm_vmw_update_layout_arg pointing to an array
801
 * of num_outputs drm_vmw_rect's.
799
 * of num_outputs drm_vmw_rect's.
802
 */
800
 */
803
 
801
 
804
/**
802
/**
805
 * struct drm_vmw_update_layout_arg
803
 * struct drm_vmw_update_layout_arg
806
 *
804
 *
807
 * @num_outputs: number of active connectors
805
 * @num_outputs: number of active connectors
808
 * @rects: pointer to array of drm_vmw_rect cast to an uint64_t
806
 * @rects: pointer to array of drm_vmw_rect cast to an __u64
809
 *
807
 *
810
 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
808
 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
811
 */
809
 */
812
struct drm_vmw_update_layout_arg {
810
struct drm_vmw_update_layout_arg {
813
	uint32_t num_outputs;
811
	__u32 num_outputs;
814
	uint32_t pad64;
812
	__u32 pad64;
815
	uint64_t rects;
813
	__u64 rects;
816
};
814
};
817
 
815
 
818
 
816
 
819
/*************************************************************************/
817
/*************************************************************************/
820
/**
818
/**
821
 * DRM_VMW_CREATE_SHADER - Create shader
819
 * DRM_VMW_CREATE_SHADER - Create shader
822
 *
820
 *
823
 * Creates a shader and optionally binds it to a dma buffer containing
821
 * Creates a shader and optionally binds it to a dma buffer containing
824
 * the shader byte-code.
822
 * the shader byte-code.
825
 */
823
 */
826
 
824
 
827
/**
825
/**
828
 * enum drm_vmw_shader_type - Shader types
826
 * enum drm_vmw_shader_type - Shader types
829
 */
827
 */
830
enum drm_vmw_shader_type {
828
enum drm_vmw_shader_type {
831
	drm_vmw_shader_type_vs = 0,
829
	drm_vmw_shader_type_vs = 0,
832
	drm_vmw_shader_type_ps,
830
	drm_vmw_shader_type_ps,
833
};
831
};
834
 
832
 
835
 
833
 
836
/**
834
/**
837
 * struct drm_vmw_shader_create_arg
835
 * struct drm_vmw_shader_create_arg
838
 *
836
 *
839
 * @shader_type: Shader type of the shader to create.
837
 * @shader_type: Shader type of the shader to create.
840
 * @size: Size of the byte-code in bytes.
838
 * @size: Size of the byte-code in bytes.
841
 * where the shader byte-code starts
839
 * where the shader byte-code starts
842
 * @buffer_handle: Buffer handle identifying the buffer containing the
840
 * @buffer_handle: Buffer handle identifying the buffer containing the
843
 * shader byte-code
841
 * shader byte-code
844
 * @shader_handle: On successful completion contains a handle that
842
 * @shader_handle: On successful completion contains a handle that
845
 * can be used to subsequently identify the shader.
843
 * can be used to subsequently identify the shader.
846
 * @offset: Offset in bytes into the buffer given by @buffer_handle,
844
 * @offset: Offset in bytes into the buffer given by @buffer_handle,
847
 *
845
 *
848
 * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
846
 * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
849
 */
847
 */
850
struct drm_vmw_shader_create_arg {
848
struct drm_vmw_shader_create_arg {
851
	enum drm_vmw_shader_type shader_type;
849
	enum drm_vmw_shader_type shader_type;
852
	uint32_t size;
850
	__u32 size;
853
	uint32_t buffer_handle;
851
	__u32 buffer_handle;
854
	uint32_t shader_handle;
852
	__u32 shader_handle;
855
	uint64_t offset;
853
	__u64 offset;
856
};
854
};
857
 
855
 
858
/*************************************************************************/
856
/*************************************************************************/
859
/**
857
/**
860
 * DRM_VMW_UNREF_SHADER - Unreferences a shader
858
 * DRM_VMW_UNREF_SHADER - Unreferences a shader
861
 *
859
 *
862
 * Destroys a user-space reference to a shader, optionally destroying
860
 * Destroys a user-space reference to a shader, optionally destroying
863
 * it.
861
 * it.
864
 */
862
 */
865
 
863
 
866
/**
864
/**
867
 * struct drm_vmw_shader_arg
865
 * struct drm_vmw_shader_arg
868
 *
866
 *
869
 * @handle: Handle identifying the shader to destroy.
867
 * @handle: Handle identifying the shader to destroy.
870
 *
868
 *
871
 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
869
 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
872
 */
870
 */
873
struct drm_vmw_shader_arg {
871
struct drm_vmw_shader_arg {
874
	uint32_t handle;
872
	__u32 handle;
875
	uint32_t pad64;
873
	__u32 pad64;
876
};
874
};
877
 
875
 
878
/*************************************************************************/
876
/*************************************************************************/
879
/**
877
/**
880
 * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
878
 * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
881
 *
879
 *
882
 * Allocates a surface handle and queues a create surface command
880
 * Allocates a surface handle and queues a create surface command
883
 * for the host on the first use of the surface. The surface ID can
881
 * for the host on the first use of the surface. The surface ID can
884
 * be used as the surface ID in commands referencing the surface.
882
 * be used as the surface ID in commands referencing the surface.
885
 */
883
 */
886
 
884
 
887
/**
885
/**
888
 * enum drm_vmw_surface_flags
886
 * enum drm_vmw_surface_flags
889
 *
887
 *
890
 * @drm_vmw_surface_flag_shareable:     Whether the surface is shareable
888
 * @drm_vmw_surface_flag_shareable:     Whether the surface is shareable
891
 * @drm_vmw_surface_flag_scanout:       Whether the surface is a scanout
889
 * @drm_vmw_surface_flag_scanout:       Whether the surface is a scanout
892
 *                                      surface.
890
 *                                      surface.
893
 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
891
 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
894
 *                                      given.
892
 *                                      given.
895
 */
893
 */
896
enum drm_vmw_surface_flags {
894
enum drm_vmw_surface_flags {
897
	drm_vmw_surface_flag_shareable = (1 << 0),
895
	drm_vmw_surface_flag_shareable = (1 << 0),
898
	drm_vmw_surface_flag_scanout = (1 << 1),
896
	drm_vmw_surface_flag_scanout = (1 << 1),
899
	drm_vmw_surface_flag_create_buffer = (1 << 2)
897
	drm_vmw_surface_flag_create_buffer = (1 << 2)
900
};
898
};
901
 
899
 
902
/**
900
/**
903
 * struct drm_vmw_gb_surface_create_req
901
 * struct drm_vmw_gb_surface_create_req
904
 *
902
 *
905
 * @svga3d_flags:     SVGA3d surface flags for the device.
903
 * @svga3d_flags:     SVGA3d surface flags for the device.
906
 * @format:           SVGA3d format.
904
 * @format:           SVGA3d format.
907
 * @mip_level:        Number of mip levels for all faces.
905
 * @mip_level:        Number of mip levels for all faces.
908
 * @drm_surface_flags Flags as described above.
906
 * @drm_surface_flags Flags as described above.
909
 * @multisample_count Future use. Set to 0.
907
 * @multisample_count Future use. Set to 0.
910
 * @autogen_filter    Future use. Set to 0.
908
 * @autogen_filter    Future use. Set to 0.
911
 * @buffer_handle     Buffer handle of backup buffer. SVGA3D_INVALID_ID
909
 * @buffer_handle     Buffer handle of backup buffer. SVGA3D_INVALID_ID
912
 *                    if none.
910
 *                    if none.
913
 * @base_size         Size of the base mip level for all faces.
911
 * @base_size         Size of the base mip level for all faces.
914
 * @array_size        Must be zero for non-DX hardware, and if non-zero
912
 * @array_size        Must be zero for non-DX hardware, and if non-zero
915
 *                    svga3d_flags must have proper bind flags setup.
913
 *                    svga3d_flags must have proper bind flags setup.
916
 *
914
 *
917
 * Input argument to the  DRM_VMW_GB_SURFACE_CREATE Ioctl.
915
 * Input argument to the  DRM_VMW_GB_SURFACE_CREATE Ioctl.
918
 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
916
 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
919
 */
917
 */
920
struct drm_vmw_gb_surface_create_req {
918
struct drm_vmw_gb_surface_create_req {
921
	uint32_t svga3d_flags;
919
	__u32 svga3d_flags;
922
	uint32_t format;
920
	__u32 format;
923
	uint32_t mip_levels;
921
	__u32 mip_levels;
924
	enum drm_vmw_surface_flags drm_surface_flags;
922
	enum drm_vmw_surface_flags drm_surface_flags;
925
	uint32_t multisample_count;
923
	__u32 multisample_count;
926
	uint32_t autogen_filter;
924
	__u32 autogen_filter;
927
	uint32_t buffer_handle;
925
	__u32 buffer_handle;
928
	uint32_t array_size;
926
	__u32 array_size;
929
	struct drm_vmw_size base_size;
927
	struct drm_vmw_size base_size;
930
};
928
};
931
 
929
 
932
/**
930
/**
933
 * struct drm_vmw_gb_surface_create_rep
931
 * struct drm_vmw_gb_surface_create_rep
934
 *
932
 *
935
 * @handle:            Surface handle.
933
 * @handle:            Surface handle.
936
 * @backup_size:       Size of backup buffers for this surface.
934
 * @backup_size:       Size of backup buffers for this surface.
937
 * @buffer_handle:     Handle of backup buffer. SVGA3D_INVALID_ID if none.
935
 * @buffer_handle:     Handle of backup buffer. SVGA3D_INVALID_ID if none.
938
 * @buffer_size:       Actual size of the buffer identified by
936
 * @buffer_size:       Actual size of the buffer identified by
939
 *                     @buffer_handle
937
 *                     @buffer_handle
940
 * @buffer_map_handle: Offset into device address space for the buffer
938
 * @buffer_map_handle: Offset into device address space for the buffer
941
 *                     identified by @buffer_handle.
939
 *                     identified by @buffer_handle.
942
 *
940
 *
943
 * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
941
 * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
944
 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
942
 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
945
 */
943
 */
946
struct drm_vmw_gb_surface_create_rep {
944
struct drm_vmw_gb_surface_create_rep {
947
	uint32_t handle;
945
	__u32 handle;
948
	uint32_t backup_size;
946
	__u32 backup_size;
949
	uint32_t buffer_handle;
947
	__u32 buffer_handle;
950
	uint32_t buffer_size;
948
	__u32 buffer_size;
951
	uint64_t buffer_map_handle;
949
	__u64 buffer_map_handle;
952
};
950
};
953
 
951
 
954
/**
952
/**
955
 * union drm_vmw_gb_surface_create_arg
953
 * union drm_vmw_gb_surface_create_arg
956
 *
954
 *
957
 * @req: Input argument as described above.
955
 * @req: Input argument as described above.
958
 * @rep: Output argument as described above.
956
 * @rep: Output argument as described above.
959
 *
957
 *
960
 * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
958
 * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
961
 */
959
 */
962
union drm_vmw_gb_surface_create_arg {
960
union drm_vmw_gb_surface_create_arg {
963
	struct drm_vmw_gb_surface_create_rep rep;
961
	struct drm_vmw_gb_surface_create_rep rep;
964
	struct drm_vmw_gb_surface_create_req req;
962
	struct drm_vmw_gb_surface_create_req req;
965
};
963
};
966
 
964
 
967
/*************************************************************************/
965
/*************************************************************************/
968
/**
966
/**
969
 * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
967
 * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
970
 *
968
 *
971
 * Puts a reference on a host surface with a given handle, as previously
969
 * Puts a reference on a host surface with a given handle, as previously
972
 * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
970
 * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
973
 * A reference will make sure the surface isn't destroyed while we hold
971
 * A reference will make sure the surface isn't destroyed while we hold
974
 * it and will allow the calling client to use the surface handle in
972
 * it and will allow the calling client to use the surface handle in
975
 * the command stream.
973
 * the command stream.
976
 *
974
 *
977
 * On successful return, the Ioctl returns the surface information given
975
 * On successful return, the Ioctl returns the surface information given
978
 * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
976
 * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
979
 */
977
 */
980
 
978
 
981
/**
979
/**
982
 * struct drm_vmw_gb_surface_reference_arg
980
 * struct drm_vmw_gb_surface_reference_arg
983
 *
981
 *
984
 * @creq: The data used as input when the surface was created, as described
982
 * @creq: The data used as input when the surface was created, as described
985
 *        above at "struct drm_vmw_gb_surface_create_req"
983
 *        above at "struct drm_vmw_gb_surface_create_req"
986
 * @crep: Additional data output when the surface was created, as described
984
 * @crep: Additional data output when the surface was created, as described
987
 *        above at "struct drm_vmw_gb_surface_create_rep"
985
 *        above at "struct drm_vmw_gb_surface_create_rep"
988
 *
986
 *
989
 * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
987
 * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
990
 */
988
 */
991
struct drm_vmw_gb_surface_ref_rep {
989
struct drm_vmw_gb_surface_ref_rep {
992
	struct drm_vmw_gb_surface_create_req creq;
990
	struct drm_vmw_gb_surface_create_req creq;
993
	struct drm_vmw_gb_surface_create_rep crep;
991
	struct drm_vmw_gb_surface_create_rep crep;
994
};
992
};
995
 
993
 
996
/**
994
/**
997
 * union drm_vmw_gb_surface_reference_arg
995
 * union drm_vmw_gb_surface_reference_arg
998
 *
996
 *
999
 * @req: Input data as described above at "struct drm_vmw_surface_arg"
997
 * @req: Input data as described above at "struct drm_vmw_surface_arg"
1000
 * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
998
 * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
1001
 *
999
 *
1002
 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
1000
 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
1003
 */
1001
 */
1004
union drm_vmw_gb_surface_reference_arg {
1002
union drm_vmw_gb_surface_reference_arg {
1005
	struct drm_vmw_gb_surface_ref_rep rep;
1003
	struct drm_vmw_gb_surface_ref_rep rep;
1006
	struct drm_vmw_surface_arg req;
1004
	struct drm_vmw_surface_arg req;
1007
};
1005
};
1008
 
1006
 
1009
 
1007
 
1010
/*************************************************************************/
1008
/*************************************************************************/
1011
/**
1009
/**
1012
 * DRM_VMW_SYNCCPU - Sync a DMA buffer / MOB for CPU access.
1010
 * DRM_VMW_SYNCCPU - Sync a DMA buffer / MOB for CPU access.
1013
 *
1011
 *
1014
 * Idles any previously submitted GPU operations on the buffer and
1012
 * Idles any previously submitted GPU operations on the buffer and
1015
 * by default blocks command submissions that reference the buffer.
1013
 * by default blocks command submissions that reference the buffer.
1016
 * If the file descriptor used to grab a blocking CPU sync is closed, the
1014
 * If the file descriptor used to grab a blocking CPU sync is closed, the
1017
 * cpu sync is released.
1015
 * cpu sync is released.
1018
 * The flags argument indicates how the grab / release operation should be
1016
 * The flags argument indicates how the grab / release operation should be
1019
 * performed:
1017
 * performed:
1020
 */
1018
 */
1021
 
1019
 
1022
/**
1020
/**
1023
 * enum drm_vmw_synccpu_flags - Synccpu flags:
1021
 * enum drm_vmw_synccpu_flags - Synccpu flags:
1024
 *
1022
 *
1025
 * @drm_vmw_synccpu_read: Sync for read. If sync is done for read only, it's a
1023
 * @drm_vmw_synccpu_read: Sync for read. If sync is done for read only, it's a
1026
 * hint to the kernel to allow command submissions that references the buffer
1024
 * hint to the kernel to allow command submissions that references the buffer
1027
 * for read-only.
1025
 * for read-only.
1028
 * @drm_vmw_synccpu_write: Sync for write. Block all command submissions
1026
 * @drm_vmw_synccpu_write: Sync for write. Block all command submissions
1029
 * referencing this buffer.
1027
 * referencing this buffer.
1030
 * @drm_vmw_synccpu_dontblock: Dont wait for GPU idle, but rather return
1028
 * @drm_vmw_synccpu_dontblock: Dont wait for GPU idle, but rather return
1031
 * -EBUSY should the buffer be busy.
1029
 * -EBUSY should the buffer be busy.
1032
 * @drm_vmw_synccpu_allow_cs: Allow command submission that touches the buffer
1030
 * @drm_vmw_synccpu_allow_cs: Allow command submission that touches the buffer
1033
 * while the buffer is synced for CPU. This is similar to the GEM bo idle
1031
 * while the buffer is synced for CPU. This is similar to the GEM bo idle
1034
 * behavior.
1032
 * behavior.
1035
 */
1033
 */
1036
enum drm_vmw_synccpu_flags {
1034
enum drm_vmw_synccpu_flags {
1037
	drm_vmw_synccpu_read = (1 << 0),
1035
	drm_vmw_synccpu_read = (1 << 0),
1038
	drm_vmw_synccpu_write = (1 << 1),
1036
	drm_vmw_synccpu_write = (1 << 1),
1039
	drm_vmw_synccpu_dontblock = (1 << 2),
1037
	drm_vmw_synccpu_dontblock = (1 << 2),
1040
	drm_vmw_synccpu_allow_cs = (1 << 3)
1038
	drm_vmw_synccpu_allow_cs = (1 << 3)
1041
};
1039
};
1042
 
1040
 
1043
/**
1041
/**
1044
 * enum drm_vmw_synccpu_op - Synccpu operations:
1042
 * enum drm_vmw_synccpu_op - Synccpu operations:
1045
 *
1043
 *
1046
 * @drm_vmw_synccpu_grab:    Grab the buffer for CPU operations
1044
 * @drm_vmw_synccpu_grab:    Grab the buffer for CPU operations
1047
 * @drm_vmw_synccpu_release: Release a previous grab.
1045
 * @drm_vmw_synccpu_release: Release a previous grab.
1048
 */
1046
 */
1049
enum drm_vmw_synccpu_op {
1047
enum drm_vmw_synccpu_op {
1050
	drm_vmw_synccpu_grab,
1048
	drm_vmw_synccpu_grab,
1051
	drm_vmw_synccpu_release
1049
	drm_vmw_synccpu_release
1052
};
1050
};
1053
 
1051
 
1054
/**
1052
/**
1055
 * struct drm_vmw_synccpu_arg
1053
 * struct drm_vmw_synccpu_arg
1056
 *
1054
 *
1057
 * @op:			     The synccpu operation as described above.
1055
 * @op:			     The synccpu operation as described above.
1058
 * @handle:		     Handle identifying the buffer object.
1056
 * @handle:		     Handle identifying the buffer object.
1059
 * @flags:		     Flags as described above.
1057
 * @flags:		     Flags as described above.
1060
 */
1058
 */
1061
struct drm_vmw_synccpu_arg {
1059
struct drm_vmw_synccpu_arg {
1062
	enum drm_vmw_synccpu_op op;
1060
	enum drm_vmw_synccpu_op op;
1063
	enum drm_vmw_synccpu_flags flags;
1061
	enum drm_vmw_synccpu_flags flags;
1064
	uint32_t handle;
1062
	__u32 handle;
1065
	uint32_t pad64;
1063
	__u32 pad64;
1066
};
1064
};
1067
 
1065
 
1068
/*************************************************************************/
1066
/*************************************************************************/
1069
/**
1067
/**
1070
 * DRM_VMW_CREATE_EXTENDED_CONTEXT - Create a host context.
1068
 * DRM_VMW_CREATE_EXTENDED_CONTEXT - Create a host context.
1071
 *
1069
 *
1072
 * Allocates a device unique context id, and queues a create context command
1070
 * Allocates a device unique context id, and queues a create context command
1073
 * for the host. Does not wait for host completion.
1071
 * for the host. Does not wait for host completion.
1074
 */
1072
 */
1075
enum drm_vmw_extended_context {
1073
enum drm_vmw_extended_context {
1076
	drm_vmw_context_legacy,
1074
	drm_vmw_context_legacy,
1077
	drm_vmw_context_dx
1075
	drm_vmw_context_dx
1078
};
1076
};
1079
 
1077
 
1080
/**
1078
/**
1081
 * union drm_vmw_extended_context_arg
1079
 * union drm_vmw_extended_context_arg
1082
 *
1080
 *
1083
 * @req: Context type.
1081
 * @req: Context type.
1084
 * @rep: Context identifier.
1082
 * @rep: Context identifier.
1085
 *
1083
 *
1086
 * Argument to the DRM_VMW_CREATE_EXTENDED_CONTEXT Ioctl.
1084
 * Argument to the DRM_VMW_CREATE_EXTENDED_CONTEXT Ioctl.
1087
 */
1085
 */
1088
union drm_vmw_extended_context_arg {
1086
union drm_vmw_extended_context_arg {
1089
	enum drm_vmw_extended_context req;
1087
	enum drm_vmw_extended_context req;
1090
	struct drm_vmw_context_arg rep;
1088
	struct drm_vmw_context_arg rep;
1091
};
1089
};
1092
#endif
1090
#endif