1 /**************************************************************************
3 * Copyright 2006-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA
5 * Copyright (c) 2009 VMware, Inc., Palo Alto, CA., USA
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 **************************************************************************/
24 * Thomas Hellström <thomas-at-tungstengraphics-dot-com>
27 #ifndef TTM_FENCE_USER_H
28 #define TTM_FENCE_USER_H
30 #if !defined(__KERNEL__) && !defined(_KERNEL)
34 #define TTM_FENCE_MAJOR 0
35 #define TTM_FENCE_MINOR 1
36 #define TTM_FENCE_PL 0
37 #define TTM_FENCE_DATE "080819"
40 * struct ttm_fence_signaled_req
42 * @handle: Handle to the fence object. Input.
44 * @fence_type: Fence types we want to flush. Input.
46 * @flush: Boolean. Flush the indicated fence_types. Input.
48 * Argument to the TTM_FENCE_SIGNALED ioctl.
51 struct ttm_fence_signaled_req {
59 * struct ttm_fence_rep
61 * @signaled_types: Fence type that has signaled.
63 * @fence_error: Command execution error.
64 * Hardware errors that are consequences of the execution
65 * of the command stream preceding the fence are reported
68 * Output argument to the TTM_FENCE_SIGNALED and
69 * TTM_FENCE_FINISH ioctls.
72 struct ttm_fence_rep {
73 uint32_t signaled_types;
77 union ttm_fence_signaled_arg {
78 struct ttm_fence_signaled_req req;
79 struct ttm_fence_rep rep;
83 * Waiting mode flags for the TTM_FENCE_FINISH ioctl.
85 * TTM_FENCE_FINISH_MODE_LAZY: Allow for sleeps during polling
88 * TTM_FENCE_FINISH_MODE_NO_BLOCK: Don't block waiting for GPU,
89 * but return -EBUSY if the buffer is busy.
92 #define TTM_FENCE_FINISH_MODE_LAZY (1 << 0)
93 #define TTM_FENCE_FINISH_MODE_NO_BLOCK (1 << 1)
96 * struct ttm_fence_finish_req
98 * @handle: Handle to the fence object. Input.
100 * @fence_type: Fence types we want to finish.
104 * Input to the TTM_FENCE_FINISH ioctl.
107 struct ttm_fence_finish_req {
114 union ttm_fence_finish_arg {
115 struct ttm_fence_finish_req req;
116 struct ttm_fence_rep rep;
120 * struct ttm_fence_unref_arg
122 * @handle: Handle to the fence object.
124 * Argument to the TTM_FENCE_UNREF ioctl.
127 struct ttm_fence_unref_arg {
133 * Ioctl offsets frome extenstion start.
136 #define TTM_FENCE_SIGNALED 0x01
137 #define TTM_FENCE_FINISH 0x02
138 #define TTM_FENCE_UNREF 0x03