1 /**************************************************************************
3 * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
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
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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,
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,
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
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #ifndef __VMWGFX_DRM_H__
29 #define __VMWGFX_DRM_H__
31 #define DRM_VMW_MAX_SURFACE_FACES 6
32 #define DRM_VMW_MAX_MIP_LEVELS 24
35 #define DRM_VMW_GET_PARAM 0
36 #define DRM_VMW_ALLOC_DMABUF 1
37 #define DRM_VMW_UNREF_DMABUF 2
38 #define DRM_VMW_CURSOR_BYPASS 3
39 /* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/
40 #define DRM_VMW_CONTROL_STREAM 4
41 #define DRM_VMW_CLAIM_STREAM 5
42 #define DRM_VMW_UNREF_STREAM 6
43 /* guarded by DRM_VMW_PARAM_3D == 1 */
44 #define DRM_VMW_CREATE_CONTEXT 7
45 #define DRM_VMW_UNREF_CONTEXT 8
46 #define DRM_VMW_CREATE_SURFACE 9
47 #define DRM_VMW_UNREF_SURFACE 10
48 #define DRM_VMW_REF_SURFACE 11
49 #define DRM_VMW_EXECBUF 12
50 #define DRM_VMW_GET_3D_CAP 13
51 #define DRM_VMW_FENCE_WAIT 14
52 #define DRM_VMW_FENCE_SIGNALED 15
53 #define DRM_VMW_FENCE_UNREF 16
54 #define DRM_VMW_FENCE_EVENT 17
55 #define DRM_VMW_PRESENT 18
56 #define DRM_VMW_PRESENT_READBACK 19
57 #define DRM_VMW_UPDATE_LAYOUT 20
58 #define DRM_VMW_CREATE_SHADER 21
59 #define DRM_VMW_UNREF_SHADER 22
60 #define DRM_VMW_GB_SURFACE_CREATE 23
61 #define DRM_VMW_GB_SURFACE_REF 24
64 /*************************************************************************/
66 * DRM_VMW_GET_PARAM - get device information.
68 * DRM_VMW_PARAM_FIFO_OFFSET:
69 * Offset to use to map the first page of the FIFO read-only.
70 * The fifo is mapped using the mmap() system call on the drm device.
72 * DRM_VMW_PARAM_OVERLAY_IOCTL:
73 * Does the driver support the overlay ioctl.
76 #define DRM_VMW_PARAM_NUM_STREAMS 0
77 #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
78 #define DRM_VMW_PARAM_3D 2
79 #define DRM_VMW_PARAM_HW_CAPS 3
80 #define DRM_VMW_PARAM_FIFO_CAPS 4
81 #define DRM_VMW_PARAM_MAX_FB_SIZE 5
82 #define DRM_VMW_PARAM_FIFO_HW_VERSION 6
83 #define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
84 #define DRM_VMW_PARAM_3D_CAPS_SIZE 8
87 * struct drm_vmw_getparam_arg
89 * @value: Returned value. //Out
90 * @param: Parameter to query. //In.
92 * Argument to the DRM_VMW_GET_PARAM Ioctl.
95 struct drm_vmw_getparam_arg {
101 /*************************************************************************/
103 * DRM_VMW_CREATE_CONTEXT - Create a host context.
105 * Allocates a device unique context id, and queues a create context command
106 * for the host. Does not wait for host completion.
110 * struct drm_vmw_context_arg
112 * @cid: Device unique context ID.
114 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
115 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
118 struct drm_vmw_context_arg {
123 /*************************************************************************/
125 * DRM_VMW_UNREF_CONTEXT - Create a host context.
127 * Frees a global context id, and queues a destroy host command for the host.
128 * Does not wait for host completion. The context ID can be used directly
129 * in the command stream and shows up as the same context ID on the host.
132 /*************************************************************************/
134 * DRM_VMW_CREATE_SURFACE - Create a host suface.
136 * Allocates a device unique surface id, and queues a create surface command
137 * for the host. Does not wait for host completion. The surface ID can be
138 * used directly in the command stream and shows up as the same surface
143 * struct drm_wmv_surface_create_req
145 * @flags: Surface flags as understood by the host.
146 * @format: Surface format as understood by the host.
147 * @mip_levels: Number of mip levels for each face.
148 * An unused face should have 0 encoded.
149 * @size_addr: Address of a user-space array of sruct drm_vmw_size
150 * cast to an uint64_t for 32-64 bit compatibility.
151 * The size of the array should equal the total number of mipmap levels.
152 * @shareable: Boolean whether other clients (as identified by file descriptors)
153 * may reference this surface.
154 * @scanout: Boolean whether the surface is intended to be used as a
157 * Input data to the DRM_VMW_CREATE_SURFACE Ioctl.
158 * Output data from the DRM_VMW_REF_SURFACE Ioctl.
161 struct drm_vmw_surface_create_req {
164 uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES];
171 * struct drm_wmv_surface_arg
173 * @sid: Surface id of created surface or surface to destroy or reference.
175 * Output data from the DRM_VMW_CREATE_SURFACE Ioctl.
176 * Input argument to the DRM_VMW_UNREF_SURFACE Ioctl.
177 * Input argument to the DRM_VMW_REF_SURFACE Ioctl.
180 struct drm_vmw_surface_arg {
186 * struct drm_vmw_size ioctl.
188 * @width - mip level width
189 * @height - mip level height
190 * @depth - mip level depth
192 * Description of a mip level.
193 * Input data to the DRM_WMW_CREATE_SURFACE Ioctl.
196 struct drm_vmw_size {
204 * union drm_vmw_surface_create_arg
206 * @rep: Output data as described above.
207 * @req: Input data as described above.
209 * Argument to the DRM_VMW_CREATE_SURFACE Ioctl.
212 union drm_vmw_surface_create_arg {
213 struct drm_vmw_surface_arg rep;
214 struct drm_vmw_surface_create_req req;
217 /*************************************************************************/
219 * DRM_VMW_REF_SURFACE - Reference a host surface.
221 * Puts a reference on a host surface with a give sid, as previously
222 * returned by the DRM_VMW_CREATE_SURFACE ioctl.
223 * A reference will make sure the surface isn't destroyed while we hold
224 * it and will allow the calling client to use the surface ID in the command
227 * On successful return, the Ioctl returns the surface information given
228 * in the DRM_VMW_CREATE_SURFACE ioctl.
232 * union drm_vmw_surface_reference_arg
234 * @rep: Output data as described above.
235 * @req: Input data as described above.
237 * Argument to the DRM_VMW_REF_SURFACE Ioctl.
240 union drm_vmw_surface_reference_arg {
241 struct drm_vmw_surface_create_req rep;
242 struct drm_vmw_surface_arg req;
245 /*************************************************************************/
247 * DRM_VMW_UNREF_SURFACE - Unreference a host surface.
249 * Clear a reference previously put on a host surface.
250 * When all references are gone, including the one implicitly placed
252 * a destroy surface command will be queued for the host.
253 * Does not wait for completion.
256 /*************************************************************************/
260 * Submit a command buffer for execution on the host, and return a
261 * fence seqno that when signaled, indicates that the command buffer has
266 * struct drm_vmw_execbuf_arg
268 * @commands: User-space address of a command buffer cast to an uint64_t.
269 * @command-size: Size in bytes of the command buffer.
270 * @throttle-us: Sleep until software is less than @throttle_us
271 * microseconds ahead of hardware. The driver may round this value
272 * to the nearest kernel tick.
273 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
275 * @version: Allows expanding the execbuf ioctl parameters without breaking
276 * backwards compatibility, since user-space will always tell the kernel
277 * which version it uses.
278 * @flags: Execbuf flags. None currently.
280 * Argument to the DRM_VMW_EXECBUF Ioctl.
283 #define DRM_VMW_EXECBUF_VERSION 1
285 struct drm_vmw_execbuf_arg {
287 uint32_t command_size;
288 uint32_t throttle_us;
295 * struct drm_vmw_fence_rep
297 * @handle: Fence object handle for fence associated with a command submission.
298 * @mask: Fence flags relevant for this fence object.
299 * @seqno: Fence sequence number in fifo. A fence object with a lower
300 * seqno will signal the EXEC flag before a fence object with a higher
301 * seqno. This can be used by user-space to avoid kernel calls to determine
302 * whether a fence has signaled the EXEC flag. Note that @seqno will
304 * @passed_seqno: The highest seqno number processed by the hardware
305 * so far. This can be used to mark user-space fence objects as signaled, and
306 * to determine whether a fence seqno might be stale.
307 * @error: This member should've been set to -EFAULT on submission.
308 * The following actions should be take on completion:
309 * error == -EFAULT: Fence communication failed. The host is synchronized.
310 * Use the last fence id read from the FIFO fence register.
311 * error != 0 && error != -EFAULT:
312 * Fence submission failed. The host is synchronized. Use the fence_seq member.
313 * error == 0: All is OK, The host may not be synchronized.
314 * Use the fence_seq member.
316 * Input / Output data to the DRM_VMW_EXECBUF Ioctl.
319 struct drm_vmw_fence_rep {
323 uint32_t passed_seqno;
328 /*************************************************************************/
330 * DRM_VMW_ALLOC_DMABUF
332 * Allocate a DMA buffer that is visible also to the host.
333 * NOTE: The buffer is
334 * identified by a handle and an offset, which are private to the guest, but
335 * useable in the command stream. The guest kernel may translate these
336 * and patch up the command stream accordingly. In the future, the offset may
337 * be zero at all times, or it may disappear from the interface before it is
340 * The DMA buffer may stay user-space mapped in the guest at all times,
341 * and is thus suitable for sub-allocation.
343 * DMA buffers are mapped using the mmap() syscall on the drm device.
347 * struct drm_vmw_alloc_dmabuf_req
349 * @size: Required minimum size of the buffer.
351 * Input data to the DRM_VMW_ALLOC_DMABUF Ioctl.
354 struct drm_vmw_alloc_dmabuf_req {
360 * struct drm_vmw_dmabuf_rep
362 * @map_handle: Offset to use in the mmap() call used to map the buffer.
363 * @handle: Handle unique to this buffer. Used for unreferencing.
364 * @cur_gmr_id: GMR id to use in the command stream when this buffer is
365 * referenced. See not above.
366 * @cur_gmr_offset: Offset to use in the command stream when this buffer is
367 * referenced. See note above.
369 * Output data from the DRM_VMW_ALLOC_DMABUF Ioctl.
372 struct drm_vmw_dmabuf_rep {
376 uint32_t cur_gmr_offset;
381 * union drm_vmw_dmabuf_arg
383 * @req: Input data as described above.
384 * @rep: Output data as described above.
386 * Argument to the DRM_VMW_ALLOC_DMABUF Ioctl.
389 union drm_vmw_alloc_dmabuf_arg {
390 struct drm_vmw_alloc_dmabuf_req req;
391 struct drm_vmw_dmabuf_rep rep;
394 /*************************************************************************/
396 * DRM_VMW_UNREF_DMABUF - Free a DMA buffer.
401 * struct drm_vmw_unref_dmabuf_arg
403 * @handle: Handle indicating what buffer to free. Obtained from the
404 * DRM_VMW_ALLOC_DMABUF Ioctl.
406 * Argument to the DRM_VMW_UNREF_DMABUF Ioctl.
409 struct drm_vmw_unref_dmabuf_arg {
414 /*************************************************************************/
416 * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams.
418 * This IOCTL controls the overlay units of the svga device.
419 * The SVGA overlay units does not work like regular hardware units in
420 * that they do not automaticaly read back the contents of the given dma
421 * buffer. But instead only read back for each call to this ioctl, and
422 * at any point between this call being made and a following call that
423 * either changes the buffer or disables the stream.
427 * struct drm_vmw_rect
429 * Defines a rectangle. Used in the overlay ioctl to define
430 * source and destination rectangle.
433 struct drm_vmw_rect {
441 * struct drm_vmw_control_stream_arg
443 * @stream_id: Stearm to control
444 * @enabled: If false all following arguments are ignored.
445 * @handle: Handle to buffer for getting data from.
446 * @format: Format of the overlay as understood by the host.
447 * @width: Width of the overlay.
448 * @height: Height of the overlay.
449 * @size: Size of the overlay in bytes.
450 * @pitch: Array of pitches, the two last are only used for YUV12 formats.
451 * @offset: Offset from start of dma buffer to overlay.
452 * @src: Source rect, must be within the defined area above.
453 * @dst: Destination rect, x and y may be negative.
455 * Argument to the DRM_VMW_CONTROL_STREAM Ioctl.
458 struct drm_vmw_control_stream_arg {
474 struct drm_vmw_rect src;
475 struct drm_vmw_rect dst;
478 /*************************************************************************/
480 * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass.
484 #define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0)
485 #define DRM_VMW_CURSOR_BYPASS_FLAGS (1)
488 * struct drm_vmw_cursor_bypass_arg
491 * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed.
492 * @xpos: X position of cursor.
493 * @ypos: Y position of cursor.
497 * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl.
500 struct drm_vmw_cursor_bypass_arg {
509 /*************************************************************************/
511 * DRM_VMW_CLAIM_STREAM - Claim a single stream.
515 * struct drm_vmw_context_arg
517 * @stream_id: Device unique context ID.
519 * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl.
520 * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl.
523 struct drm_vmw_stream_arg {
528 /*************************************************************************/
530 * DRM_VMW_UNREF_STREAM - Unclaim a stream.
532 * Return a single stream that was claimed by this process. Also makes
533 * sure that the stream has been stopped.
536 /*************************************************************************/
540 * Read 3D capabilities from the FIFO
545 * struct drm_vmw_get_3d_cap_arg
547 * @buffer: Pointer to a buffer for capability data, cast to an uint64_t
548 * @size: Max size to copy
550 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
554 struct drm_vmw_get_3d_cap_arg {
560 /*************************************************************************/
564 * Waits for a fence object to signal. The wait is interruptible, so that
565 * signals may be delivered during the interrupt. The wait may timeout,
566 * in which case the calls returns -EBUSY. If the wait is restarted,
567 * that is restarting without resetting @cookie_valid to zero,
568 * the timeout is computed from the first call.
570 * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait
572 * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command
575 * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish
577 * in the buffer given to the EXECBUF ioctl returning the fence object handle
578 * are available to user-space.
580 * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the
581 * fenc wait ioctl returns 0, the fence object has been unreferenced after
585 #define DRM_VMW_FENCE_FLAG_EXEC (1 << 0)
586 #define DRM_VMW_FENCE_FLAG_QUERY (1 << 1)
588 #define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
591 * struct drm_vmw_fence_wait_arg
593 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
594 * @cookie_valid: Must be reset to 0 on first call. Left alone on restart.
595 * @kernel_cookie: Set to 0 on first call. Left alone on restart.
596 * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout.
597 * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick
599 * @flags: Fence flags to wait on.
600 * @wait_options: Options that control the behaviour of the wait ioctl.
602 * Input argument to the DRM_VMW_FENCE_WAIT ioctl.
605 struct drm_vmw_fence_wait_arg {
607 int32_t cookie_valid;
608 uint64_t kernel_cookie;
612 int32_t wait_options;
616 /*************************************************************************/
618 * DRM_VMW_FENCE_SIGNALED
620 * Checks if a fence object is signaled..
624 * struct drm_vmw_fence_signaled_arg
626 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
627 * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl
628 * @signaled: Out: Flags signaled.
629 * @sequence: Out: Highest sequence passed so far. Can be used to signal the
630 * EXEC flag of user-space fence objects.
632 * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF
636 struct drm_vmw_fence_signaled_arg {
640 uint32_t passed_seqno;
641 uint32_t signaled_flags;
645 /*************************************************************************/
647 * DRM_VMW_FENCE_UNREF
649 * Unreferences a fence object, and causes it to be destroyed if there are no
650 * other references to it.
655 * struct drm_vmw_fence_arg
657 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
659 * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl..
662 struct drm_vmw_fence_arg {
668 /*************************************************************************/
670 * DRM_VMW_FENCE_EVENT
672 * Queues an event on a fence to be delivered on the drm character device
673 * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag.
674 * Optionally the approximate time when the fence signaled is
675 * given by the event.
681 #define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
683 struct drm_vmw_event_fence {
684 struct drm_event base;
691 * Flags that may be given to the command.
693 /* Request fence signaled time on the event. */
694 #define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
697 * struct drm_vmw_fence_event_arg
699 * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if
700 * the fence is not supposed to be referenced by user-space.
701 * @user_info: Info to be delivered with the event.
702 * @handle: Attach the event to this fence only.
703 * @flags: A set of flags as defined above.
705 struct drm_vmw_fence_event_arg {
713 /*************************************************************************/
717 * Executes an SVGA present on a given fb for a given surface. The surface
718 * is placed on the framebuffer. Cliprects are given relative to the given
719 * point (the point disignated by dest_{x|y}).
724 * struct drm_vmw_present_arg
725 * @fb_id: framebuffer id to present / read back from.
726 * @sid: Surface id to present from.
727 * @dest_x: X placement coordinate for surface.
728 * @dest_y: Y placement coordinate for surface.
729 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
730 * @num_clips: Number of cliprects given relative to the framebuffer origin,
731 * in the same coordinate space as the frame buffer.
732 * @pad64: Unused 64-bit padding.
734 * Input argument to the DRM_VMW_PRESENT ioctl.
737 struct drm_vmw_present_arg {
748 /*************************************************************************/
750 * DRM_VMW_PRESENT_READBACK
752 * Executes an SVGA present readback from a given fb to the dma buffer
753 * currently bound as the fb. If there is no dma buffer bound to the fb,
754 * an error will be returned.
759 * struct drm_vmw_present_arg
760 * @fb_id: fb_id to present / read back from.
761 * @num_clips: Number of cliprects.
762 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
763 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t.
764 * If this member is NULL, then the ioctl should not return a fence.
767 struct drm_vmw_present_readback_arg {
774 /*************************************************************************/
776 * DRM_VMW_UPDATE_LAYOUT - Update layout
778 * Updates the preferred modes and connection status for connectors. The
779 * command consists of one drm_vmw_update_layout_arg pointing to an array
780 * of num_outputs drm_vmw_rect's.
784 * struct drm_vmw_update_layout_arg
786 * @num_outputs: number of active connectors
787 * @rects: pointer to array of drm_vmw_rect cast to an uint64_t
789 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
791 struct drm_vmw_update_layout_arg {
792 uint32_t num_outputs;
798 /*************************************************************************/
800 * DRM_VMW_CREATE_SHADER - Create shader
802 * Creates a shader and optionally binds it to a dma buffer containing
803 * the shader byte-code.
807 * enum drm_vmw_shader_type - Shader types
809 enum drm_vmw_shader_type {
810 drm_vmw_shader_type_vs = 0,
811 drm_vmw_shader_type_ps,
812 drm_vmw_shader_type_gs
817 * struct drm_vmw_shader_create_arg
819 * @shader_type: Shader type of the shader to create.
820 * @size: Size of the byte-code in bytes.
821 * where the shader byte-code starts
822 * @buffer_handle: Buffer handle identifying the buffer containing the
824 * @shader_handle: On successful completion contains a handle that
825 * can be used to subsequently identify the shader.
826 * @offset: Offset in bytes into the buffer given by @buffer_handle,
828 * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
830 struct drm_vmw_shader_create_arg {
831 enum drm_vmw_shader_type shader_type;
833 uint32_t buffer_handle;
834 uint32_t shader_handle;
838 /*************************************************************************/
840 * DRM_VMW_UNREF_SHADER - Unreferences a shader
842 * Destroys a user-space reference to a shader, optionally destroying
847 * struct drm_vmw_shader_arg
849 * @handle: Handle identifying the shader to destroy.
851 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
853 struct drm_vmw_shader_arg {
858 /*************************************************************************/
860 * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
862 * Allocates a surface handle and queues a create surface command
863 * for the host on the first use of the surface. The surface ID can
864 * be used as the surface ID in commands referencing the surface.
868 * enum drm_vmw_surface_flags
870 * @drm_vmw_surface_flag_shareable: Whether the surface is shareable
871 * @drm_vmw_surface_flag_scanout: Whether the surface is a scanout
873 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
876 enum drm_vmw_surface_flags {
877 drm_vmw_surface_flag_shareable = (1 << 0),
878 drm_vmw_surface_flag_scanout = (1 << 1),
879 drm_vmw_surface_flag_create_buffer = (1 << 2)
883 * struct drm_vmw_gb_surface_create_req
885 * @svga3d_flags: SVGA3d surface flags for the device.
886 * @format: SVGA3d format.
887 * @mip_level: Number of mip levels for all faces.
888 * @drm_surface_flags Flags as described above.
889 * @multisample_count Future use. Set to 0.
890 * @autogen_filter Future use. Set to 0.
891 * @buffer_handle Buffer handle of backup buffer. SVGA3D_INVALID_ID
893 * @base_size Size of the base mip level for all faces.
895 * Input argument to the DRM_VMW_GB_SURFACE_CREATE Ioctl.
896 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
898 struct drm_vmw_gb_surface_create_req {
899 uint32_t svga3d_flags;
902 enum drm_vmw_surface_flags drm_surface_flags;
903 uint32_t multisample_count;
904 uint32_t autogen_filter;
905 uint32_t buffer_handle;
907 struct drm_vmw_size base_size;
911 * struct drm_vmw_gb_surface_create_rep
913 * @handle: Surface handle.
914 * @backup_size: Size of backup buffers for this surface.
915 * @buffer_handle: Handle of backup buffer. SVGA3D_INVALID_ID if none.
916 * @buffer_size: Actual size of the buffer identified by
918 * @buffer_map_handle: Offset into device address space for the buffer
919 * identified by @buffer_handle.
921 * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
922 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
924 struct drm_vmw_gb_surface_create_rep {
926 uint32_t backup_size;
927 uint32_t buffer_handle;
928 uint32_t buffer_size;
929 uint64_t buffer_map_handle;
933 * union drm_vmw_gb_surface_create_arg
935 * @req: Input argument as described above.
936 * @rep: Output argument as described above.
938 * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
940 union drm_vmw_gb_surface_create_arg {
941 struct drm_vmw_gb_surface_create_rep rep;
942 struct drm_vmw_gb_surface_create_req req;
945 /*************************************************************************/
947 * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
949 * Puts a reference on a host surface with a given handle, as previously
950 * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
951 * A reference will make sure the surface isn't destroyed while we hold
952 * it and will allow the calling client to use the surface handle in
953 * the command stream.
955 * On successful return, the Ioctl returns the surface information given
956 * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
960 * struct drm_vmw_gb_surface_reference_arg
962 * @creq: The data used as input when the surface was created, as described
963 * above at "struct drm_vmw_gb_surface_create_req"
964 * @crep: Additional data output when the surface was created, as described
965 * above at "struct drm_vmw_gb_surface_create_rep"
967 * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
969 struct drm_vmw_gb_surface_ref_rep {
970 struct drm_vmw_gb_surface_create_req creq;
971 struct drm_vmw_gb_surface_create_rep crep;
975 * union drm_vmw_gb_surface_reference_arg
977 * @req: Input data as described above at "struct drm_vmw_surface_arg"
978 * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
980 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
982 union drm_vmw_gb_surface_reference_arg {
983 struct drm_vmw_gb_surface_ref_rep rep;
984 struct drm_vmw_surface_arg req;