1 /****************************************************************************
3 * Copyright (C) 2005 - 2014 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 *****************************************************************************/
22 #ifndef __gc_hal_driver_vg_h_
23 #define __gc_hal_driver_vg_h_
27 #include "gc_hal_types.h"
33 /******************************************************************************\
34 ******************************* I/O Control Codes ******************************
35 \******************************************************************************/
37 #define gcvHAL_CLASS "galcore"
38 #define IOCTL_GCHAL_INTERFACE 30000
40 /******************************************************************************\
41 ********************************* Command Codes ********************************
42 \******************************************************************************/
44 /******************************************************************************\
45 ********************* Command buffer information structure. ********************
46 \******************************************************************************/
48 typedef struct _gcsCOMMAND_BUFFER_INFO * gcsCOMMAND_BUFFER_INFO_PTR;
49 typedef struct _gcsCOMMAND_BUFFER_INFO
51 /* FE command buffer interrupt ID. */
54 /* TS overflow interrupt ID. */
55 gctINT32 tsOverflowInt;
57 /* Alignment and mask for the buffer address. */
59 gctUINT32 addressAlignment;
61 /* Alignment for each command. */
62 gctUINT32 commandAlignment;
64 /* Number of bytes required by the STATE command. */
65 gctUINT32 stateCommandSize;
67 /* Number of bytes required by the RESTART command. */
68 gctUINT32 restartCommandSize;
70 /* Number of bytes required by the FETCH command. */
71 gctUINT32 fetchCommandSize;
73 /* Number of bytes required by the CALL command. */
74 gctUINT32 callCommandSize;
76 /* Number of bytes required by the RETURN command. */
77 gctUINT32 returnCommandSize;
79 /* Number of bytes required by the EVENT command. */
80 gctUINT32 eventCommandSize;
82 /* Number of bytes required by the END command. */
83 gctUINT32 endCommandSize;
85 /* Number of bytes reserved at the tail of a static command buffer. */
86 gctUINT32 staticTailSize;
88 /* Number of bytes reserved at the tail of a dynamic command buffer. */
89 gctUINT32 dynamicTailSize;
91 gcsCOMMAND_BUFFER_INFO;
93 /******************************************************************************\
94 ******************************** Task Structures *******************************
95 \******************************************************************************/
105 gcvTASK_UNLOCK_VIDEO_MEMORY,
106 gcvTASK_FREE_VIDEO_MEMORY,
107 gcvTASK_FREE_CONTIGUOUS_MEMORY,
108 gcvTASK_UNMAP_USER_MEMORY
112 typedef struct _gcsTASK_HEADER * gcsTASK_HEADER_PTR;
113 typedef struct _gcsTASK_HEADER
120 typedef struct _gcsTASK_LINK * gcsTASK_LINK_PTR;
121 typedef struct _gcsTASK_LINK
123 /* Task ID (gcvTASK_LINK). */
126 /* Pointer to the next task container. */
127 IN gctPOINTER cotainer;
129 /* Pointer to the next task from the next task container. */
130 IN gcsTASK_HEADER_PTR task;
134 typedef struct _gcsTASK_CLUSTER * gcsTASK_CLUSTER_PTR;
135 typedef struct _gcsTASK_CLUSTER
137 /* Task ID (gcvTASK_CLUSTER). */
140 /* Number of tasks in the cluster. */
141 IN gctUINT taskCount;
145 typedef struct _gcsTASK_INCREMENT * gcsTASK_INCREMENT_PTR;
146 typedef struct _gcsTASK_INCREMENT
148 /* Task ID (gcvTASK_INCREMENT). */
151 /* Address of the variable to increment. */
152 IN gctUINT32 address;
156 typedef struct _gcsTASK_DECREMENT * gcsTASK_DECREMENT_PTR;
157 typedef struct _gcsTASK_DECREMENT
159 /* Task ID (gcvTASK_DECREMENT). */
162 /* Address of the variable to decrement. */
163 IN gctUINT32 address;
167 typedef struct _gcsTASK_SIGNAL * gcsTASK_SIGNAL_PTR;
168 typedef struct _gcsTASK_SIGNAL
170 /* Task ID (gcvTASK_SIGNAL). */
173 /* Process owning the signal. */
174 IN gctHANDLE process;
176 /* Signal handle to signal. */
179 #if defined(__QNXNTO__)
186 typedef struct _gcsTASK_LOCKDOWN * gcsTASK_LOCKDOWN_PTR;
187 typedef struct _gcsTASK_LOCKDOWN
189 /* Task ID (gcvTASK_LOCKDOWN). */
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. */
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). */
212 /* Allocated video memory. */
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). */
223 /* Allocated video memory. */
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). */
234 /* Number of bytes allocated. */
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). */
251 /* Base address of user memory to unmap. */
252 IN gctPOINTER memory;
254 /* Size of user memory in bytes to unmap. */
257 /* Info record returned by gcvHAL_MAP_USER_MEMORY. */
260 /* Physical address of mapped memory as returned by
261 gcvHAL_MAP_USER_MEMORY. */
262 IN gctUINT32 address;
264 gcsTASK_UNMAP_USER_MEMORY;
270 #endif /* __gc_hal_driver_h_ */