ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / hal / kernel / inc / gc_hal_driver_vg.h
blobaa7fac52d30dc836317a71c87f70f8811a33b3f5
1 /****************************************************************************
3 * Copyright (C) 2005 - 2011 by Vivante Corp.
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.
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.
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.
19 *****************************************************************************/
26 #ifndef __gc_hal_driver_vg_h_
27 #define __gc_hal_driver_vg_h_
31 #include "gc_hal_types.h"
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
37 /******************************************************************************\
38 ******************************* I/O Control Codes ******************************
39 \******************************************************************************/
41 #define gcvHAL_CLASS "galcore"
42 #define IOCTL_GCHAL_INTERFACE 30000
44 /******************************************************************************\
45 ********************************* Command Codes ********************************
46 \******************************************************************************/
48 /******************************************************************************\
49 ********************* Command buffer information structure. ********************
50 \******************************************************************************/
52 typedef struct _gcsCOMMAND_BUFFER_INFO * gcsCOMMAND_BUFFER_INFO_PTR;
53 typedef struct _gcsCOMMAND_BUFFER_INFO
55 /* FE command buffer interrupt ID. */
56 gctINT32 feBufferInt;
58 /* TS overflow interrupt ID. */
59 gctINT32 tsOverflowInt;
61 /* Alignment and mask for the buffer address. */
62 gctUINT addressMask;
63 gctSIZE_T addressAlignment;
65 /* Alignment for each command. */
66 gctSIZE_T commandAlignment;
68 /* Number of bytes required by the STATE command. */
69 gctSIZE_T stateCommandSize;
71 /* Number of bytes required by the RESTART command. */
72 gctSIZE_T restartCommandSize;
74 /* Number of bytes required by the FETCH command. */
75 gctSIZE_T fetchCommandSize;
77 /* Number of bytes required by the CALL command. */
78 gctSIZE_T callCommandSize;
80 /* Number of bytes required by the RETURN command. */
81 gctSIZE_T returnCommandSize;
83 /* Number of bytes required by the EVENT command. */
84 gctSIZE_T eventCommandSize;
86 /* Number of bytes required by the END command. */
87 gctSIZE_T endCommandSize;
89 /* Number of bytes reserved at the tail of a static command buffer. */
90 gctSIZE_T staticTailSize;
92 /* Number of bytes reserved at the tail of a dynamic command buffer. */
93 gctSIZE_T dynamicTailSize;
95 gcsCOMMAND_BUFFER_INFO;
97 /******************************************************************************\
98 ******************************** Task Structures *******************************
99 \******************************************************************************/
101 typedef enum _gceTASK
103 gcvTASK_LINK,
104 gcvTASK_CLUSTER,
105 gcvTASK_INCREMENT,
106 gcvTASK_DECREMENT,
107 gcvTASK_SIGNAL,
108 gcvTASK_LOCKDOWN,
109 gcvTASK_UNLOCK_VIDEO_MEMORY,
110 gcvTASK_FREE_VIDEO_MEMORY,
111 gcvTASK_FREE_CONTIGUOUS_MEMORY,
112 gcvTASK_UNMAP_USER_MEMORY,
113 gcvTASK_UNMAP_MEMORY
115 gceTASK;
117 typedef struct _gcsTASK_HEADER * gcsTASK_HEADER_PTR;
118 typedef struct _gcsTASK_HEADER
120 /* Task ID. */
121 IN gceTASK id;
123 gcsTASK_HEADER;
125 typedef struct _gcsTASK_LINK * gcsTASK_LINK_PTR;
126 typedef struct _gcsTASK_LINK
128 /* Task ID (gcvTASK_LINK). */
129 IN gceTASK id;
131 /* Pointer to the next task container. */
132 IN gctPOINTER cotainer;
134 /* Pointer to the next task from the next task container. */
135 IN gcsTASK_HEADER_PTR task;
137 gcsTASK_LINK;
139 typedef struct _gcsTASK_CLUSTER * gcsTASK_CLUSTER_PTR;
140 typedef struct _gcsTASK_CLUSTER
142 /* Task ID (gcvTASK_CLUSTER). */
143 IN gceTASK id;
145 /* Number of tasks in the cluster. */
146 IN gctUINT taskCount;
148 gcsTASK_CLUSTER;
150 typedef struct _gcsTASK_INCREMENT * gcsTASK_INCREMENT_PTR;
151 typedef struct _gcsTASK_INCREMENT
153 /* Task ID (gcvTASK_INCREMENT). */
154 IN gceTASK id;
156 /* Address of the variable to increment. */
157 IN gctUINT32 address;
159 gcsTASK_INCREMENT;
161 typedef struct _gcsTASK_DECREMENT * gcsTASK_DECREMENT_PTR;
162 typedef struct _gcsTASK_DECREMENT
164 /* Task ID (gcvTASK_DECREMENT). */
165 IN gceTASK id;
167 /* Address of the variable to decrement. */
168 IN gctUINT32 address;
170 gcsTASK_DECREMENT;
172 typedef struct _gcsTASK_SIGNAL * gcsTASK_SIGNAL_PTR;
173 typedef struct _gcsTASK_SIGNAL
175 /* Task ID (gcvTASK_SIGNAL). */
176 IN gceTASK id;
178 /* Process owning the signal. */
179 IN gctHANDLE process;
181 /* Signal handle to signal. */
182 IN gctSIGNAL signal;
184 gcsTASK_SIGNAL;
186 typedef struct _gcsTASK_LOCKDOWN * gcsTASK_LOCKDOWN_PTR;
187 typedef struct _gcsTASK_LOCKDOWN
189 /* Task ID (gcvTASK_LOCKDOWN). */
190 IN gceTASK id;
192 /* Address of the user space counter. */
193 IN gctUINT32 userCounter;
195 /* Address of the kernel space counter. */
196 IN gctUINT32 kernelCounter;
198 /* Process owning the signal. */
199 IN gctHANDLE process;
201 /* Signal handle to signal. */
202 IN gctSIGNAL signal;
204 gcsTASK_LOCKDOWN;
206 typedef struct _gcsTASK_UNLOCK_VIDEO_MEMORY * gcsTASK_UNLOCK_VIDEO_MEMORY_PTR;
207 typedef struct _gcsTASK_UNLOCK_VIDEO_MEMORY
209 /* Task ID (gcvTASK_UNLOCK_VIDEO_MEMORY). */
210 IN gceTASK id;
212 /* Allocated video memory. */
213 IN gcuVIDMEM_NODE_PTR node;
215 gcsTASK_UNLOCK_VIDEO_MEMORY;
217 typedef struct _gcsTASK_FREE_VIDEO_MEMORY * gcsTASK_FREE_VIDEO_MEMORY_PTR;
218 typedef struct _gcsTASK_FREE_VIDEO_MEMORY
220 /* Task ID (gcvTASK_FREE_VIDEO_MEMORY). */
221 IN gceTASK id;
223 /* Allocated video memory. */
224 IN gcuVIDMEM_NODE_PTR node;
226 gcsTASK_FREE_VIDEO_MEMORY;
228 typedef struct _gcsTASK_FREE_CONTIGUOUS_MEMORY * gcsTASK_FREE_CONTIGUOUS_MEMORY_PTR;
229 typedef struct _gcsTASK_FREE_CONTIGUOUS_MEMORY
231 /* Task ID (gcvTASK_FREE_CONTIGUOUS_MEMORY). */
232 IN gceTASK id;
234 /* Number of bytes allocated. */
235 IN gctSIZE_T bytes;
237 /* Physical address of allocation. */
238 IN gctPHYS_ADDR physical;
240 /* Logical address of allocation. */
241 IN gctPOINTER logical;
243 gcsTASK_FREE_CONTIGUOUS_MEMORY;
245 typedef struct _gcsTASK_UNMAP_USER_MEMORY * gcsTASK_UNMAP_USER_MEMORY_PTR;
246 typedef struct _gcsTASK_UNMAP_USER_MEMORY
248 /* Task ID (gcvTASK_UNMAP_USER_MEMORY). */
249 IN gceTASK id;
251 /* Base address of user memory to unmap. */
252 IN gctPOINTER memory;
254 /* Size of user memory in bytes to unmap. */
255 IN gctSIZE_T size;
257 /* Info record returned by gcvHAL_MAP_USER_MEMORY. */
258 IN gctPOINTER info;
260 /* Physical address of mapped memory as returned by
261 gcvHAL_MAP_USER_MEMORY. */
262 IN gctUINT32 address;
264 gcsTASK_UNMAP_USER_MEMORY;
266 typedef struct _gcsTASK_UNMAP_MEMORY * gcsTASK_UNMAP_MEMORY_PTR;
267 typedef struct _gcsTASK_UNMAP_MEMORY
269 /* Task ID (gcvTASK_UNMAP_MEMORY). */
270 IN gceTASK id;
272 /* Physical memory address to unmap. */
273 IN gctPHYS_ADDR physical;
275 /* Number of bytes in physical memory to unmap. */
276 IN gctSIZE_T bytes;
278 /* Address of mapped memory to unmap. */
279 IN gctPOINTER logical;
281 gcsTASK_UNMAP_MEMORY;
283 #ifdef __cplusplus
285 #endif
287 #endif /* __gc_hal_driver_h_ */