]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
gpu: vivante: Update driver from Freescale 3.10.53-1.1-ga BSP
[karo-tx-linux.git] / drivers / mxc / gpu-viv / hal / kernel / inc / gc_hal_driver_vg.h
1 /****************************************************************************
2 *
3 *    Copyright (C) 2005 - 2014 by Vivante Corp.
4 *
5 *    This program is free software; you can redistribute it and/or modify
6 *    it under the terms of the GNU General Public License as published by
7 *    the Free Software Foundation; either version 2 of the license, or
8 *    (at your option) any later version.
9 *
10 *    This program is distributed in the hope that it will be useful,
11 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *    GNU General Public License for more details.
14 *
15 *    You should have received a copy of the GNU General Public License
16 *    along with this program; if not write to the Free Software
17 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 *****************************************************************************/
20
21
22 #ifndef __gc_hal_driver_vg_h_
23 #define __gc_hal_driver_vg_h_
24
25
26
27 #include "gc_hal_types.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /******************************************************************************\
34 ******************************* I/O Control Codes ******************************
35 \******************************************************************************/
36
37 #define gcvHAL_CLASS            "galcore"
38 #define IOCTL_GCHAL_INTERFACE   30000
39
40 /******************************************************************************\
41 ********************************* Command Codes ********************************
42 \******************************************************************************/
43
44 /******************************************************************************\
45 ********************* Command buffer information structure. ********************
46 \******************************************************************************/
47
48 typedef struct _gcsCOMMAND_BUFFER_INFO * gcsCOMMAND_BUFFER_INFO_PTR;
49 typedef struct _gcsCOMMAND_BUFFER_INFO
50 {
51     /* FE command buffer interrupt ID. */
52     gctINT32                    feBufferInt;
53
54     /* TS overflow interrupt ID. */
55     gctINT32                    tsOverflowInt;
56
57     /* Alignment and mask for the buffer address. */
58     gctUINT                     addressMask;
59     gctUINT32                    addressAlignment;
60
61     /* Alignment for each command. */
62     gctUINT32                   commandAlignment;
63
64     /* Number of bytes required by the STATE command. */
65     gctUINT32                   stateCommandSize;
66
67     /* Number of bytes required by the RESTART command. */
68     gctUINT32                   restartCommandSize;
69
70     /* Number of bytes required by the FETCH command. */
71     gctUINT32                   fetchCommandSize;
72
73     /* Number of bytes required by the CALL command. */
74     gctUINT32                   callCommandSize;
75
76     /* Number of bytes required by the RETURN command. */
77     gctUINT32                   returnCommandSize;
78
79     /* Number of bytes required by the EVENT command. */
80     gctUINT32                   eventCommandSize;
81
82     /* Number of bytes required by the END command. */
83     gctUINT32                   endCommandSize;
84
85     /* Number of bytes reserved at the tail of a static command buffer. */
86     gctUINT32                   staticTailSize;
87
88     /* Number of bytes reserved at the tail of a dynamic command buffer. */
89     gctUINT32                   dynamicTailSize;
90 }
91 gcsCOMMAND_BUFFER_INFO;
92
93 /******************************************************************************\
94 ******************************** Task Structures *******************************
95 \******************************************************************************/
96
97 typedef enum _gceTASK
98 {
99     gcvTASK_LINK,
100     gcvTASK_CLUSTER,
101     gcvTASK_INCREMENT,
102     gcvTASK_DECREMENT,
103     gcvTASK_SIGNAL,
104     gcvTASK_LOCKDOWN,
105     gcvTASK_UNLOCK_VIDEO_MEMORY,
106     gcvTASK_FREE_VIDEO_MEMORY,
107     gcvTASK_FREE_CONTIGUOUS_MEMORY,
108     gcvTASK_UNMAP_USER_MEMORY
109 }
110 gceTASK;
111
112 typedef struct _gcsTASK_HEADER * gcsTASK_HEADER_PTR;
113 typedef struct _gcsTASK_HEADER
114 {
115     /* Task ID. */
116     IN gceTASK                  id;
117 }
118 gcsTASK_HEADER;
119
120 typedef struct _gcsTASK_LINK * gcsTASK_LINK_PTR;
121 typedef struct _gcsTASK_LINK
122 {
123     /* Task ID (gcvTASK_LINK). */
124     IN gceTASK                  id;
125
126     /* Pointer to the next task container. */
127     IN gctPOINTER               cotainer;
128
129     /* Pointer to the next task from the next task container. */
130     IN gcsTASK_HEADER_PTR       task;
131 }
132 gcsTASK_LINK;
133
134 typedef struct _gcsTASK_CLUSTER * gcsTASK_CLUSTER_PTR;
135 typedef struct _gcsTASK_CLUSTER
136 {
137     /* Task ID (gcvTASK_CLUSTER). */
138     IN gceTASK                  id;
139
140     /* Number of tasks in the cluster. */
141     IN gctUINT                  taskCount;
142 }
143 gcsTASK_CLUSTER;
144
145 typedef struct _gcsTASK_INCREMENT * gcsTASK_INCREMENT_PTR;
146 typedef struct _gcsTASK_INCREMENT
147 {
148     /* Task ID (gcvTASK_INCREMENT). */
149     IN gceTASK                  id;
150
151     /* Address of the variable to increment. */
152     IN gctUINT32                address;
153 }
154 gcsTASK_INCREMENT;
155
156 typedef struct _gcsTASK_DECREMENT * gcsTASK_DECREMENT_PTR;
157 typedef struct _gcsTASK_DECREMENT
158 {
159     /* Task ID (gcvTASK_DECREMENT). */
160     IN gceTASK                  id;
161
162     /* Address of the variable to decrement. */
163     IN gctUINT32                address;
164 }
165 gcsTASK_DECREMENT;
166
167 typedef struct _gcsTASK_SIGNAL * gcsTASK_SIGNAL_PTR;
168 typedef struct _gcsTASK_SIGNAL
169 {
170     /* Task ID (gcvTASK_SIGNAL). */
171     IN gceTASK                  id;
172
173     /* Process owning the signal. */
174     IN gctHANDLE                process;
175
176     /* Signal handle to signal. */
177     IN gctSIGNAL                signal;
178
179 #if defined(__QNXNTO__)
180     IN gctINT32                 coid;
181     IN gctINT32                 rcvid;
182 #endif
183 }
184 gcsTASK_SIGNAL;
185
186 typedef struct _gcsTASK_LOCKDOWN * gcsTASK_LOCKDOWN_PTR;
187 typedef struct _gcsTASK_LOCKDOWN
188 {
189     /* Task ID (gcvTASK_LOCKDOWN). */
190     IN gceTASK                  id;
191
192     /* Address of the user space counter. */
193     IN gctUINT32                userCounter;
194
195     /* Address of the kernel space counter. */
196     IN gctUINT32                kernelCounter;
197
198     /* Process owning the signal. */
199     IN gctHANDLE                process;
200
201     /* Signal handle to signal. */
202     IN gctSIGNAL                signal;
203 }
204 gcsTASK_LOCKDOWN;
205
206 typedef struct _gcsTASK_UNLOCK_VIDEO_MEMORY * gcsTASK_UNLOCK_VIDEO_MEMORY_PTR;
207 typedef struct _gcsTASK_UNLOCK_VIDEO_MEMORY
208 {
209     /* Task ID (gcvTASK_UNLOCK_VIDEO_MEMORY). */
210     IN gceTASK                  id;
211
212     /* Allocated video memory. */
213     IN gctUINT64                node;
214 }
215 gcsTASK_UNLOCK_VIDEO_MEMORY;
216
217 typedef struct _gcsTASK_FREE_VIDEO_MEMORY * gcsTASK_FREE_VIDEO_MEMORY_PTR;
218 typedef struct _gcsTASK_FREE_VIDEO_MEMORY
219 {
220     /* Task ID (gcvTASK_FREE_VIDEO_MEMORY). */
221     IN gceTASK                  id;
222
223     /* Allocated video memory. */
224     IN gctUINT32                node;
225 }
226 gcsTASK_FREE_VIDEO_MEMORY;
227
228 typedef struct _gcsTASK_FREE_CONTIGUOUS_MEMORY * gcsTASK_FREE_CONTIGUOUS_MEMORY_PTR;
229 typedef struct _gcsTASK_FREE_CONTIGUOUS_MEMORY
230 {
231     /* Task ID (gcvTASK_FREE_CONTIGUOUS_MEMORY). */
232     IN gceTASK                  id;
233
234     /* Number of bytes allocated. */
235     IN gctSIZE_T                bytes;
236
237     /* Physical address of allocation. */
238     IN gctPHYS_ADDR             physical;
239
240     /* Logical address of allocation. */
241     IN gctPOINTER               logical;
242 }
243 gcsTASK_FREE_CONTIGUOUS_MEMORY;
244
245 typedef struct _gcsTASK_UNMAP_USER_MEMORY * gcsTASK_UNMAP_USER_MEMORY_PTR;
246 typedef struct _gcsTASK_UNMAP_USER_MEMORY
247 {
248     /* Task ID (gcvTASK_UNMAP_USER_MEMORY). */
249     IN gceTASK                  id;
250
251     /* Base address of user memory to unmap. */
252     IN gctPOINTER               memory;
253
254     /* Size of user memory in bytes to unmap. */
255     IN gctSIZE_T                size;
256
257     /* Info record returned by gcvHAL_MAP_USER_MEMORY. */
258     IN gctPOINTER               info;
259
260     /* Physical address of mapped memory as returned by
261        gcvHAL_MAP_USER_MEMORY. */
262     IN gctUINT32                address;
263 }
264 gcsTASK_UNMAP_USER_MEMORY;
265
266 #ifdef __cplusplus
267 }
268 #endif
269
270 #endif /* __gc_hal_driver_h_ */