]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/device-ti-proprietary-open.git/blob - jacinto6/sgx_src/eurasia_km/services4/include/kerneldisplay.h
jacinto6: sgx: update DDK version to 1.12/2701748
[android-sdk/device-ti-proprietary-open.git] / jacinto6 / sgx_src / eurasia_km / services4 / include / kerneldisplay.h
1 /*************************************************************************/ /*!
2 @Title          Display device class API structures and prototypes
3 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4 @Description    Provides display device class API structures and prototypes
5                 for kernel services to kernel 3rd party display.
6 @License        Dual MIT/GPLv2
8 The contents of this file are subject to the MIT license as set out below.
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
32 This License is also included in this distribution in the file called
33 "MIT-COPYING".
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
44 #if !defined (__KERNELDISPLAY_H__)
45 #define __KERNELDISPLAY_H__
47 #if defined(SUPPORT_PVRSRV_DEVICE_CLASS)
49 #if defined (__cplusplus)
50 extern "C" {
51 #endif
53 typedef PVRSRV_ERROR (*PFN_OPEN_DC_DEVICE)(IMG_UINT32, IMG_HANDLE*, PVRSRV_SYNC_DATA*);
54 typedef PVRSRV_ERROR (*PFN_CLOSE_DC_DEVICE)(IMG_HANDLE);
55 typedef PVRSRV_ERROR (*PFN_ENUM_DC_FORMATS)(IMG_HANDLE, IMG_UINT32*, DISPLAY_FORMAT*);
56 typedef PVRSRV_ERROR (*PFN_ENUM_DC_DIMS)(IMG_HANDLE,
57                                                                                  DISPLAY_FORMAT*,
58                                                                                  IMG_UINT32*,
59                                                                                  DISPLAY_DIMS*);
60 typedef PVRSRV_ERROR (*PFN_GET_DC_SYSTEMBUFFER)(IMG_HANDLE, IMG_HANDLE*);
61 typedef PVRSRV_ERROR (*PFN_GET_DC_INFO)(IMG_HANDLE, DISPLAY_INFO*);
62 typedef PVRSRV_ERROR (*PFN_CREATE_DC_SWAPCHAIN)(IMG_HANDLE,
63                                                                                                 IMG_UINT32, 
64                                                                                                 DISPLAY_SURF_ATTRIBUTES*, 
65                                                                                                 DISPLAY_SURF_ATTRIBUTES*,
66                                                                                                 IMG_UINT32, 
67                                                                                                 PVRSRV_SYNC_DATA**,
68                                                                                                 IMG_UINT32,
69                                                                                                 IMG_HANDLE*, 
70                                                                                                 IMG_UINT32*);
71 typedef PVRSRV_ERROR (*PFN_DESTROY_DC_SWAPCHAIN)(IMG_HANDLE, 
72                                                                                                  IMG_HANDLE);
73 typedef PVRSRV_ERROR (*PFN_SET_DC_DSTRECT)(IMG_HANDLE, IMG_HANDLE, IMG_RECT*);
74 typedef PVRSRV_ERROR (*PFN_SET_DC_SRCRECT)(IMG_HANDLE, IMG_HANDLE, IMG_RECT*);
75 typedef PVRSRV_ERROR (*PFN_SET_DC_DSTCK)(IMG_HANDLE, IMG_HANDLE, IMG_UINT32);
76 typedef PVRSRV_ERROR (*PFN_SET_DC_SRCCK)(IMG_HANDLE, IMG_HANDLE, IMG_UINT32);
77 typedef PVRSRV_ERROR (*PFN_GET_DC_BUFFERS)(IMG_HANDLE,
78                                                                                    IMG_HANDLE,
79                                                                                    IMG_UINT32*,
80                                                                                    IMG_HANDLE*);
81 typedef PVRSRV_ERROR (*PFN_SWAP_TO_DC_BUFFER)(IMG_HANDLE,
82                                                                                           IMG_HANDLE,
83                                                                                           IMG_UINT32,
84                                                                                           IMG_HANDLE,
85                                                                                           IMG_UINT32,
86                                                                                           IMG_RECT*);
87 typedef IMG_VOID (*PFN_QUERY_SWAP_COMMAND_ID)(IMG_HANDLE, IMG_HANDLE, IMG_HANDLE, IMG_HANDLE, IMG_UINT16*, IMG_BOOL*);
88 typedef IMG_VOID (*PFN_SET_DC_STATE)(IMG_HANDLE, IMG_UINT32);
90 /*
91         Function table for SRVKM->DISPLAY
92 */
93 typedef struct PVRSRV_DC_SRV2DISP_KMJTABLE_TAG
94 {
95         IMG_UINT32                                              ui32TableSize;
96         PFN_OPEN_DC_DEVICE                              pfnOpenDCDevice;
97         PFN_CLOSE_DC_DEVICE                             pfnCloseDCDevice;
98         PFN_ENUM_DC_FORMATS                             pfnEnumDCFormats;
99         PFN_ENUM_DC_DIMS                                pfnEnumDCDims;
100         PFN_GET_DC_SYSTEMBUFFER                 pfnGetDCSystemBuffer;
101         PFN_GET_DC_INFO                                 pfnGetDCInfo;
102         PFN_GET_BUFFER_ADDR                             pfnGetBufferAddr;
103         PFN_CREATE_DC_SWAPCHAIN                 pfnCreateDCSwapChain;
104         PFN_DESTROY_DC_SWAPCHAIN                pfnDestroyDCSwapChain;
105         PFN_SET_DC_DSTRECT                              pfnSetDCDstRect;
106         PFN_SET_DC_SRCRECT                              pfnSetDCSrcRect;
107         PFN_SET_DC_DSTCK                                pfnSetDCDstColourKey;
108         PFN_SET_DC_SRCCK                                pfnSetDCSrcColourKey;
109         PFN_GET_DC_BUFFERS                              pfnGetDCBuffers;
110         PFN_SWAP_TO_DC_BUFFER                   pfnSwapToDCBuffer;
111         PFN_SET_DC_STATE                                pfnSetDCState;
113 } PVRSRV_DC_SRV2DISP_KMJTABLE;
115 /* ISR callback pfn prototype */
116 typedef IMG_BOOL (*PFN_ISR_HANDLER)(IMG_VOID*);
118 /*
119         functions exported by kernel services for use by 3rd party kernel display class device driver
120 */
121 typedef PVRSRV_ERROR (*PFN_DC_REGISTER_DISPLAY_DEV)(PVRSRV_DC_SRV2DISP_KMJTABLE*, IMG_UINT32*);
122 typedef PVRSRV_ERROR (*PFN_DC_REMOVE_DISPLAY_DEV)(IMG_UINT32);
123 typedef PVRSRV_ERROR (*PFN_DC_OEM_FUNCTION)(IMG_UINT32, IMG_VOID*, IMG_UINT32, IMG_VOID*, IMG_UINT32);
124 typedef PVRSRV_ERROR (*PFN_DC_REGISTER_COMMANDPROCLIST)(IMG_UINT32, PPFN_CMD_PROC,IMG_UINT32[][2], IMG_UINT32);
125 typedef PVRSRV_ERROR (*PFN_DC_REMOVE_COMMANDPROCLIST)(IMG_UINT32, IMG_UINT32);
126 typedef IMG_VOID (*PFN_DC_CMD_COMPLETE)(IMG_HANDLE, IMG_BOOL);
127 typedef PVRSRV_ERROR (*PFN_DC_REGISTER_SYS_ISR)(PFN_ISR_HANDLER, IMG_VOID*, IMG_UINT32, IMG_UINT32);
128 typedef PVRSRV_ERROR (*PFN_DC_REGISTER_POWER)(IMG_UINT32, PFN_PRE_POWER, PFN_POST_POWER,
129                                                                                           PFN_PRE_CLOCKSPEED_CHANGE, PFN_POST_CLOCKSPEED_CHANGE,
130                                                                                           IMG_HANDLE, PVRSRV_DEV_POWER_STATE, PVRSRV_DEV_POWER_STATE);
132 typedef struct _PVRSRV_KERNEL_MEM_INFO_* PDC_MEM_INFO;
134 typedef PVRSRV_ERROR (*PFN_DC_MEMINFO_GET_CPU_VADDR)(PDC_MEM_INFO, IMG_CPU_VIRTADDR *pVAddr);
135 typedef PVRSRV_ERROR (*PFN_DC_MEMINFO_GET_CPU_PADDR)(PDC_MEM_INFO, IMG_SIZE_T uByteOffset, IMG_CPU_PHYADDR *pPAddr);
136 typedef PVRSRV_ERROR (*PFN_DC_MEMINFO_GET_BYTE_SIZE)(PDC_MEM_INFO, IMG_SIZE_T *uByteSize);
137 typedef IMG_BOOL (*PFN_DC_MEMINFO_IS_PHYS_CONTIG)(PDC_MEM_INFO);
139 /*
140         Function table for DISPLAY->SRVKM
141 */
142 typedef struct PVRSRV_DC_DISP2SRV_KMJTABLE_TAG
144         IMG_UINT32                                              ui32TableSize;
145         PFN_DC_REGISTER_DISPLAY_DEV             pfnPVRSRVRegisterDCDevice;
146         PFN_DC_REMOVE_DISPLAY_DEV               pfnPVRSRVRemoveDCDevice;
147         PFN_DC_OEM_FUNCTION                             pfnPVRSRVOEMFunction;
148         PFN_DC_REGISTER_COMMANDPROCLIST pfnPVRSRVRegisterCmdProcList;
149         PFN_DC_REMOVE_COMMANDPROCLIST   pfnPVRSRVRemoveCmdProcList;
150         PFN_DC_CMD_COMPLETE                             pfnPVRSRVCmdComplete;
151         PFN_DC_REGISTER_SYS_ISR                 pfnPVRSRVRegisterSystemISRHandler;
152         PFN_DC_REGISTER_POWER                   pfnPVRSRVRegisterPowerDevice;
153         PFN_DC_MEMINFO_GET_CPU_VADDR    pfnPVRSRVDCMemInfoGetCpuVAddr;
154         PFN_DC_MEMINFO_GET_CPU_PADDR    pfnPVRSRVDCMemInfoGetCpuPAddr;
155         PFN_DC_MEMINFO_GET_BYTE_SIZE    pfnPVRSRVDCMemInfoGetByteSize;
156         PFN_DC_MEMINFO_IS_PHYS_CONTIG   pfnPVRSRVDCMemInfoIsPhysContig;
158 } PVRSRV_DC_DISP2SRV_KMJTABLE, *PPVRSRV_DC_DISP2SRV_KMJTABLE;
161 typedef struct DISPLAYCLASS_FLIP_COMMAND_TAG
163         /* Ext Device Handle */
164         IMG_HANDLE hExtDevice;
166         /* Ext SwapChain Handle */
167         IMG_HANDLE hExtSwapChain;
169         /* Ext Buffer Handle (Buffer to Flip to) */
170         IMG_HANDLE hExtBuffer;
172         /* private tag */
173         IMG_HANDLE hPrivateTag;
175         /* number of clip rects */
176         IMG_UINT32 ui32ClipRectCount;
178         /* clip rects */
179         IMG_RECT *psClipRect;
181         /* number of vsync intervals between successive flips */
182         IMG_UINT32      ui32SwapInterval;
184 } DISPLAYCLASS_FLIP_COMMAND;
187 typedef struct DISPLAYCLASS_FLIP_COMMAND2_TAG
189         /* Ext Device Handle */
190         IMG_HANDLE hExtDevice;
192         /* Ext SwapChain Handle */
193         IMG_HANDLE hExtSwapChain;
195         /* Unused field, padding for compatibility with above structure */
196         IMG_HANDLE hUnused;
198         /* number of vsync intervals between successive flips */
199         IMG_UINT32 ui32SwapInterval;
201         /* private data from userspace */
202         IMG_PVOID  pvPrivData;
204         /* length of private data in bytes */
205         IMG_UINT32 ui32PrivDataLength;
207         /* meminfos */
208         PDC_MEM_INFO *ppsMemInfos;
210         /* number of meminfos */
211         IMG_UINT32 ui32NumMemInfos;
213 } DISPLAYCLASS_FLIP_COMMAND2;
215 /* start command IDs from 0 */
216 #define DC_FLIP_COMMAND         0
218 /* States used in PFN_SET_DC_STATE */
219 #define DC_STATE_NO_FLUSH_COMMANDS              0
220 #define DC_STATE_FLUSH_COMMANDS                 1
222 /* function to retrieve kernel services function table from kernel services */
223 typedef IMG_BOOL (*PFN_DC_GET_PVRJTABLE)(PPVRSRV_DC_DISP2SRV_KMJTABLE);
225 /* Prototype for platforms that access the JTable via linkage */
226 IMG_IMPORT IMG_BOOL PVRGetDisplayClassJTable(PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable);
229 #if defined (__cplusplus)
231 #endif
233 #endif /* defined(SUPPORT_PVRSRV_DEVICE_CLASS) */
235 #endif/* #if !defined (__KERNELDISPLAY_H__) */
237 /******************************************************************************
238  End of file (kerneldisplay.h)
239 ******************************************************************************/