ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / hal / kernel / inc / gc_hal_cl.h
blob5acc46dc14c71a3020c88b2f8dcf322bbdc9aded
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 *****************************************************************************/
24 #ifndef __gc_hal_user_cl_h_
25 #define __gc_hal_user_cl_h_
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
32 #define USE_NEW_MEMORY_ALLOCATION 0
34 /******************************************************************************\
35 ****************************** Object Declarations *****************************
36 \******************************************************************************/
38 /* gcoCL_DEVICE_INFO object. */
39 typedef struct _gcoCL_DEVICE_INFO
41 gctUINT maxComputeUnits;
42 gctUINT maxWorkItemDimensions;
43 gctUINT maxWorkItemSizes[3];
44 gctUINT maxWorkGroupSize;
45 gctUINT maxGlobalWorkSize ;
46 gctUINT clockFrequency;
48 gctUINT addrBits;
49 gctUINT64 maxMemAllocSize;
50 gctUINT64 globalMemSize;
51 gctUINT64 localMemSize;
52 gctUINT localMemType; /* cl_device_local_mem_type */
53 gctUINT globalMemCacheType; /* cl_device_mem_cache_type */
54 gctUINT globalMemCachelineSize;
55 gctUINT64 globalMemCacheSize;
56 gctUINT maxConstantArgs;
57 gctUINT64 maxConstantBufferSize;
58 gctUINT maxParameterSize;
59 gctUINT memBaseAddrAlign;
60 gctUINT minDataTypeAlignSize;
62 gctBOOL imageSupport;
63 gctUINT maxReadImageArgs;
64 gctUINT maxWriteImageArgs;
65 gctUINT vectorWidthChar;
66 gctUINT vectorWidthShort;
67 gctUINT vectorWidthInt;
68 gctUINT vectorWidthLong;
69 gctUINT vectorWidthFloat;
70 gctUINT vectorWidthDouble;
71 gctUINT vectorWidthHalf;
72 gctUINT image2DMaxWidth;
73 gctUINT image2DMaxHeight;
74 gctUINT image3DMaxWidth;
75 gctUINT image3DMaxHeight;
76 gctUINT image3DMaxDepth;
77 gctUINT maxSamplers;
79 gctUINT64 queueProperties; /* cl_command_queue_properties */
80 gctBOOL hostUnifiedMemory;
81 gctBOOL errorCorrectionSupport;
82 gctUINT64 singleFpConfig; /* cl_device_fp_config */
83 gctUINT64 doubleFpConfig; /* cl_device_fp_config */
84 gctUINT profilingTimingRes;
85 gctBOOL endianLittle;
86 gctBOOL deviceAvail;
87 gctBOOL compilerAvail;
88 gctUINT64 execCapability; /* cl_device_exec_capabilities */
89 } gcoCL_DEVICE_INFO;
91 typedef gcoCL_DEVICE_INFO * gcoCL_DEVICE_INFO_PTR;
94 /*******************************************************************************
96 ** gcoCL_InitializeHardware
98 ** Initialize hardware. This is required for each thread.
100 ** INPUT:
102 ** Nothing
104 ** OUTPUT:
106 ** Nothing
108 gceSTATUS
109 gcoCL_InitializeHardware(
112 /*******************************************************************************
114 ** gcoCL_AllocateMemory
116 ** Allocate contiguous memory from the kernel.
118 ** INPUT:
120 ** gctSIZE_T * Bytes
121 ** Pointer to the number of bytes to allocate.
123 ** OUTPUT:
125 ** gctSIZE_T * Bytes
126 ** Pointer to a variable that will receive the aligned number of bytes
127 ** allocated.
129 ** gctPHYS_ADDR * Physical
130 ** Pointer to a variable that will receive the physical addresses of
131 ** the allocated memory.
133 ** gctPOINTER * Logical
134 ** Pointer to a variable that will receive the logical address of the
135 ** allocation.
137 ** gcsSURF_NODE_PTR * Node
138 ** Pointer to a variable that will receive the gcsSURF_NODE structure
139 ** pointer that describes the video memory to lock.
141 gceSTATUS
142 gcoCL_AllocateMemory(
143 IN OUT gctSIZE_T * Bytes,
144 OUT gctPHYS_ADDR * Physical,
145 OUT gctPOINTER * Logical,
146 OUT gcsSURF_NODE_PTR * Node
149 /*******************************************************************************
151 ** gcoCL_FreeMemory
153 ** Free contiguous memeory to the kernel.
155 ** INPUT:
157 ** gctPHYS_ADDR Physical
158 ** The physical addresses of the allocated pages.
160 ** gctPOINTER Logical
161 ** The logical address of the allocation.
163 ** gctSIZE_T Bytes
164 ** Number of bytes allocated.
166 ** gcsSURF_NODE_PTR Node
167 ** Pointer to a gcsSURF_NODE structure
168 ** that describes the video memory to unlock.
170 ** OUTPUT:
172 ** Nothing
174 gceSTATUS
175 gcoCL_FreeMemory(
176 IN gctPHYS_ADDR Physical,
177 IN gctPOINTER Logical,
178 IN gctSIZE_T Bytes,
179 IN gcsSURF_NODE_PTR Node
182 /*******************************************************************************
184 ** gcoCL_CreateTexture
186 ** Create texture for image.
188 ** INPUT:
190 ** gctUINT Width
191 ** Width of the image.
193 ** gctUINT Heighth
194 ** Heighth of the image.
196 ** gctUINT Depth
197 ** Depth of the image.
199 ** gctCONST_POINTER Memory
200 ** Pointer to the data of the input image.
202 ** gctUINT Stride
203 ** Size of one row.
205 ** gctUINT Slice
206 ** Size of one plane.
208 ** gceSURF_FORMAT FORMAT
209 ** Format of the image.
211 ** gceENDIAN_HINT EndianHint
212 ** Endian needed to handle the image data.
214 ** OUTPUT:
216 ** gcoTEXTURE * Texture
217 ** Pointer to a variable that will receive the gcoTEXTURE structure.
219 ** gcoSURF * Surface
220 ** Pointer to a variable that will receive the gcoSURF structure.
222 ** gctPHYS_ADDR * Physical
223 ** Pointer to a variable that will receive the physical addresses of
224 ** the allocated memory.
226 ** gctPOINTER * Logical
227 ** Pointer to a variable that will receive the logical address of the
228 ** allocation.
230 gceSTATUS
231 gcoCL_CreateTexture(
232 IN gctUINT Width,
233 IN gctUINT Height,
234 IN gctUINT Depth,
235 IN gctCONST_POINTER Memory,
236 IN gctUINT Stride,
237 IN gctUINT Slice,
238 IN gceSURF_FORMAT Format,
239 IN gceENDIAN_HINT EndianHint,
240 OUT gcoTEXTURE * Texture,
241 OUT gcoSURF * Surface,
242 OUT gctPHYS_ADDR * Physical,
243 OUT gctPOINTER * Logical
246 /*******************************************************************************
248 ** gcoCL_QueryDeviceInfo
250 ** Query the OpenCL capabilities of the device.
252 ** INPUT:
254 ** Nothing
256 ** OUTPUT:
258 ** gcoCL_DEVICE_INFO_PTR DeviceInfo
259 ** Pointer to the device information
261 gceSTATUS
262 gcoCL_QueryDeviceInfo(
263 OUT gcoCL_DEVICE_INFO_PTR DeviceInfo
266 gceSTATUS
267 gcoCL_SubmitSignal(
268 IN gctSIGNAL Signal,
269 IN gctHANDLE Process
272 gceSTATUS
273 gcoCL_Flush(
274 IN gctBOOL Stall
277 #ifdef __cplusplus
279 #endif
281 #endif /* __gc_hal_user_cl_h_ */