diff options
Diffstat (limited to 'omap5/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h')
-rw-r--r-- | omap5/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h | 288 |
1 files changed, 0 insertions, 288 deletions
diff --git a/omap5/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h b/omap5/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h deleted file mode 100644 index 403361f..0000000 --- a/omap5/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h +++ /dev/null | |||
@@ -1,288 +0,0 @@ | |||
1 | /*************************************************************************/ /*! | ||
2 | @Title Dummy 3rd party display driver structures and prototypes | ||
3 | @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved | ||
4 | @License Dual MIT/GPLv2 | ||
5 | |||
6 | The contents of this file are subject to the MIT license as set out below. | ||
7 | |||
8 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
9 | of this software and associated documentation files (the "Software"), to deal | ||
10 | in the Software without restriction, including without limitation the rights | ||
11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
12 | copies of the Software, and to permit persons to whom the Software is | ||
13 | furnished to do so, subject to the following conditions: | ||
14 | |||
15 | The above copyright notice and this permission notice shall be included in | ||
16 | all copies or substantial portions of the Software. | ||
17 | |||
18 | Alternatively, the contents of this file may be used under the terms of | ||
19 | the GNU General Public License Version 2 ("GPL") in which case the provisions | ||
20 | of GPL are applicable instead of those above. | ||
21 | |||
22 | If you wish to allow use of your version of this file only under the terms of | ||
23 | GPL, and not to allow others to use your version of this file under the terms | ||
24 | of the MIT license, indicate your decision by deleting the provisions above | ||
25 | and replace them with the notice and other provisions required by GPL as set | ||
26 | out in the file called "GPL-COPYING" included in this distribution. If you do | ||
27 | not delete the provisions above, a recipient may use your version of this file | ||
28 | under the terms of either the MIT license or GPL. | ||
29 | |||
30 | This License is also included in this distribution in the file called | ||
31 | "MIT-COPYING". | ||
32 | |||
33 | EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS | ||
34 | PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING | ||
35 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
36 | PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR | ||
37 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
38 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
39 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
40 | */ /**************************************************************************/ | ||
41 | |||
42 | /************************************************************************** | ||
43 | The 3rd party driver is a specification of an API to integrate the | ||
44 | IMG PowerVR Services driver with 3rd Party display hardware. | ||
45 | It is NOT a specification for a display controller driver, rather a | ||
46 | specification to extend the API for a pre-existing driver for the display hardware. | ||
47 | |||
48 | The 3rd party driver interface provides IMG PowerVR client drivers (e.g. PVR2D) | ||
49 | with an API abstraction of the system's underlying display hardware, allowing | ||
50 | the client drivers to indirectly control the display hardware and access its | ||
51 | associated memory. | ||
52 | |||
53 | Functions of the API include | ||
54 | |||
55 | - query primary surface attributes (width, height, stride, pixel format, | ||
56 | CPU physical and virtual address) | ||
57 | - swap/flip chain creation and subsequent query of surface attributes | ||
58 | - asynchronous display surface flipping, taking account of asynchronous | ||
59 | read (flip) and write (render) operations to the display surface | ||
60 | |||
61 | Note: having queried surface attributes the client drivers are able to map | ||
62 | the display memory to any IMG PowerVR Services device by calling | ||
63 | PVRSRVMapDeviceClassMemory with the display surface handle. | ||
64 | |||
65 | This code is intended to be an example of how a pre-existing display driver | ||
66 | may be extended to support the 3rd Party Display interface to | ||
67 | PowerVR Services - IMG is not providing a display driver implementation | ||
68 | **************************************************************************/ | ||
69 | |||
70 | #ifndef __DC_NOHW_H__ | ||
71 | #define __DC_NOHW_H__ | ||
72 | |||
73 | |||
74 | #if defined(__cplusplus) | ||
75 | extern "C" { | ||
76 | #endif | ||
77 | |||
78 | #if defined(USE_BASE_VIDEO_FRAMEBUFFER) | ||
79 | #if defined (ENABLE_DISPLAY_MODE_TRACKING) | ||
80 | #error Cannot have both USE_BASE_VIDEO_FRAMEBUFFER and ENABLE_DISPLAY_MODE_TRACKING defined | ||
81 | #endif | ||
82 | #endif | ||
83 | |||
84 | #if !defined(DC_NOHW_BUFFER_WIDTH) && !defined(DC_NOHW_BUFFER_HEIGHT) | ||
85 | /* Default buffer size */ | ||
86 | #define DC_NOHW_BUFFER_WIDTH 320 | ||
87 | #define DC_NOHW_BUFFER_HEIGHT 240 | ||
88 | #endif | ||
89 | |||
90 | #define DC_NOHW_BUFFER_BIT_DEPTH 32 | ||
91 | #define DC_NOHW_BUFFER_PIXEL_FORMAT PVRSRV_PIXEL_FORMAT_ARGB8888 | ||
92 | |||
93 | #define DC_NOHW_DEPTH_BITS_PER_BYTE 8 | ||
94 | |||
95 | #define dc_nohw_byte_depth_from_bit_depth(bit_depth) (((IMG_UINT32)(bit_depth) + DC_NOHW_DEPTH_BITS_PER_BYTE - 1)/DC_NOHW_DEPTH_BITS_PER_BYTE) | ||
96 | #define dc_nohw_bit_depth_from_byte_depth(byte_depth) ((IMG_UINT32)(byte_depth) * DC_NOHW_DEPTH_BITS_PER_BYTE) | ||
97 | #define dc_nohw_roundup_bit_depth(bd) dc_nohw_bit_depth_from_byte_depth(dc_nohw_byte_depth_from_bit_depth(bd)) | ||
98 | |||
99 | #define dc_nohw_byte_stride(width, bit_depth) ((IMG_UINT32)(width) * dc_nohw_byte_depth_from_bit_depth(bit_depth)) | ||
100 | |||
101 | #if defined(DC_NOHW_GET_BUFFER_DIMENSIONS) | ||
102 | IMG_BOOL GetBufferDimensions(IMG_UINT32 *pui32Width, IMG_UINT32 *pui32Height, PVRSRV_PIXEL_FORMAT *pePixelFormat, IMG_UINT32 *pui32Stride); | ||
103 | #else | ||
104 | #define DC_NOHW_BUFFER_BYTE_STRIDE dc_nohw_byte_stride(DC_NOHW_BUFFER_WIDTH, DC_NOHW_BUFFER_BIT_DEPTH) | ||
105 | #endif | ||
106 | |||
107 | extern IMG_BOOL IMG_IMPORT PVRGetDisplayClassJTable(PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable); | ||
108 | |||
109 | #define DC_NOHW_MAXFORMATS (1) | ||
110 | #define DC_NOHW_MAXDIMS (1) | ||
111 | #define DC_NOHW_MAX_BACKBUFFERS (3) | ||
112 | |||
113 | |||
114 | typedef void * DC_HANDLE; | ||
115 | |||
116 | typedef struct DC_NOHW_BUFFER_TAG | ||
117 | { | ||
118 | DC_HANDLE hSwapChain; | ||
119 | DC_HANDLE hMemChunk; | ||
120 | |||
121 | /* member using IMG structures to minimise API function code */ | ||
122 | /* replace with own structures where necessary */ | ||
123 | #if defined(DC_NOHW_DISCONTIG_BUFFERS) | ||
124 | IMG_SYS_PHYADDR *psSysAddr; | ||
125 | #else | ||
126 | IMG_SYS_PHYADDR sSysAddr; | ||
127 | #endif | ||
128 | IMG_DEV_VIRTADDR sDevVAddr; | ||
129 | IMG_CPU_VIRTADDR sCPUVAddr; | ||
130 | PVRSRV_SYNC_DATA* psSyncData; | ||
131 | |||
132 | struct DC_NOHW_BUFFER_TAG *psNext; | ||
133 | } DC_NOHW_BUFFER; | ||
134 | |||
135 | |||
136 | /* DC_NOHW buffer structure */ | ||
137 | typedef struct DC_NOHW_SWAPCHAIN_TAG | ||
138 | { | ||
139 | unsigned long ulBufferCount; | ||
140 | DC_NOHW_BUFFER *psBuffer; | ||
141 | } DC_NOHW_SWAPCHAIN; | ||
142 | |||
143 | |||
144 | /* kernel device information structure */ | ||
145 | typedef struct DC_NOHW_DEVINFO_TAG | ||
146 | { | ||
147 | unsigned int uiDeviceID; | ||
148 | |||
149 | /* system surface info */ | ||
150 | DC_NOHW_BUFFER sSystemBuffer; | ||
151 | |||
152 | /* number of supported display formats */ | ||
153 | unsigned long ulNumFormats; | ||
154 | |||
155 | /* number of supported display dims */ | ||
156 | unsigned long ulNumDims; | ||
157 | |||
158 | /* jump table into PVR services */ | ||
159 | PVRSRV_DC_DISP2SRV_KMJTABLE sPVRJTable; | ||
160 | |||
161 | /* jump table into DC */ | ||
162 | PVRSRV_DC_SRV2DISP_KMJTABLE sDCJTable; | ||
163 | |||
164 | /* | ||
165 | handle for connection to kernel services | ||
166 | - OS specific - may not be required | ||
167 | */ | ||
168 | DC_HANDLE hPVRServices; | ||
169 | |||
170 | /* back buffer info */ | ||
171 | DC_NOHW_BUFFER asBackBuffers[DC_NOHW_MAX_BACKBUFFERS]; | ||
172 | |||
173 | /* ref count */ | ||
174 | unsigned long ulRefCount; | ||
175 | |||
176 | DC_NOHW_SWAPCHAIN *psSwapChain; | ||
177 | |||
178 | /* member using IMG structures to minimise API function code */ | ||
179 | /* replace with own structures where necessary */ | ||
180 | DISPLAY_INFO sDisplayInfo; | ||
181 | |||
182 | /* system surface info */ | ||
183 | DISPLAY_FORMAT sSysFormat; | ||
184 | DISPLAY_DIMS sSysDims; | ||
185 | IMG_UINT32 ui32BufferSize; | ||
186 | |||
187 | /* list of supported display formats */ | ||
188 | DISPLAY_FORMAT asDisplayFormatList[DC_NOHW_MAXFORMATS]; | ||
189 | |||
190 | /* list of supported display formats */ | ||
191 | DISPLAY_DIMS asDisplayDimList[DC_NOHW_MAXDIMS]; | ||
192 | |||
193 | /* back buffer info */ | ||
194 | DISPLAY_FORMAT sBackBufferFormat[DC_NOHW_MAXFORMATS]; | ||
195 | |||
196 | } DC_NOHW_DEVINFO; | ||
197 | |||
198 | |||
199 | /*! | ||
200 | ***************************************************************************** | ||
201 | * Error values | ||
202 | *****************************************************************************/ | ||
203 | typedef enum _DC_ERROR_ | ||
204 | { | ||
205 | DC_OK = 0, | ||
206 | DC_ERROR_GENERIC = 1, | ||
207 | DC_ERROR_OUT_OF_MEMORY = 2, | ||
208 | DC_ERROR_TOO_FEW_BUFFERS = 3, | ||
209 | DC_ERROR_INVALID_PARAMS = 4, | ||
210 | DC_ERROR_INIT_FAILURE = 5, | ||
211 | DC_ERROR_CANT_REGISTER_CALLBACK = 6, | ||
212 | DC_ERROR_INVALID_DEVICE = 7, | ||
213 | DC_ERROR_DEVICE_REGISTER_FAILED = 8 | ||
214 | } DC_ERROR; | ||
215 | |||
216 | |||
217 | #ifndef UNREFERENCED_PARAMETER | ||
218 | #define UNREFERENCED_PARAMETER(param) (param) = (param) | ||
219 | #endif | ||
220 | |||
221 | DC_ERROR Init(void); | ||
222 | DC_ERROR Deinit(void); | ||
223 | |||
224 | #if defined(USE_BASE_VIDEO_FRAMEBUFFER) || defined (ENABLE_DISPLAY_MODE_TRACKING) | ||
225 | DC_ERROR OpenMiniport(void); | ||
226 | DC_ERROR CloseMiniport(void); | ||
227 | #endif /* #if defined(USE_BASE_VIDEO_FRAMEBUFFER) || defined (ENABLE_DISPLAY_MODE_TRACKING) */ | ||
228 | |||
229 | #if defined(USE_BASE_VIDEO_FRAMEBUFFER) | ||
230 | PVRSRV_ERROR SetupDevInfo (DC_NOHW_DEVINFO *psDevInfo); | ||
231 | PVRSRV_ERROR FreeBackBuffers (DC_NOHW_DEVINFO *psDevInfo); | ||
232 | #endif | ||
233 | |||
234 | #if defined (ENABLE_DISPLAY_MODE_TRACKING) | ||
235 | DC_ERROR Shadow_Desktop_Resolution(DC_NOHW_DEVINFO *psDevInfo); | ||
236 | #endif /* #if defined (ENABLE_DISPLAY_MODE_TRACKING) */ | ||
237 | |||
238 | #if !defined(DC_NOHW_DISCONTIG_BUFFERS) && !defined(USE_BASE_VIDEO_FRAMEBUFFER) | ||
239 | IMG_SYS_PHYADDR CpuPAddrToSysPAddr(IMG_CPU_PHYADDR cpu_paddr); | ||
240 | IMG_CPU_PHYADDR SysPAddrToCpuPAddr(IMG_SYS_PHYADDR sys_paddr); | ||
241 | #endif | ||
242 | |||
243 | /* OS Specific APIs */ | ||
244 | DC_ERROR OpenPVRServices (DC_HANDLE *phPVRServices); | ||
245 | DC_ERROR ClosePVRServices (DC_HANDLE hPVRServices); | ||
246 | |||
247 | #if defined(DC_NOHW_DISCONTIG_BUFFERS) | ||
248 | DC_ERROR AllocDiscontigMemory(unsigned long ulSize, | ||
249 | DC_HANDLE * phMemChunk, | ||
250 | IMG_CPU_VIRTADDR *pLinAddr, | ||
251 | IMG_SYS_PHYADDR **pPhysAddr); | ||
252 | |||
253 | void FreeDiscontigMemory(unsigned long ulSize, | ||
254 | DC_HANDLE hMemChunk, | ||
255 | IMG_CPU_VIRTADDR LinAddr, | ||
256 | IMG_SYS_PHYADDR *pPhysAddr); | ||
257 | #else | ||
258 | |||
259 | |||
260 | |||
261 | DC_ERROR AllocContigMemory(unsigned long ulSize, | ||
262 | DC_HANDLE * phMemHandle, | ||
263 | IMG_CPU_VIRTADDR *pLinAddr, | ||
264 | IMG_CPU_PHYADDR *pPhysAddr); | ||
265 | |||
266 | void FreeContigMemory(unsigned long ulSize, | ||
267 | DC_HANDLE hMemChunk, | ||
268 | IMG_CPU_VIRTADDR LinAddr, | ||
269 | IMG_CPU_PHYADDR PhysAddr); | ||
270 | |||
271 | |||
272 | #endif | ||
273 | |||
274 | void *AllocKernelMem(unsigned long ulSize); | ||
275 | void FreeKernelMem (void *pvMem); | ||
276 | |||
277 | DC_ERROR GetLibFuncAddr (DC_HANDLE hExtDrv, char *szFunctionName, PFN_DC_GET_PVRJTABLE *ppfnFuncTable); | ||
278 | |||
279 | #if defined(__cplusplus) | ||
280 | } | ||
281 | #endif | ||
282 | |||
283 | #endif /* __DC_NOHW_H__ */ | ||
284 | |||
285 | /****************************************************************************** | ||
286 | End of file (dc_nohw.h) | ||
287 | ******************************************************************************/ | ||
288 | |||