1.3.13.1607/3_00_00_08+flat+Lindent
[sgx.git] / pvr / sgx_bridge_km.h
1 /**********************************************************************
2  *
3  * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
4  * 
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  * 
9  * This program is distributed in the hope it will be useful but, except 
10  * as otherwise stated in writing, without any warranty; without even the 
11  * implied warranty of merchantability or fitness for a particular purpose. 
12  * See the GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17  * 
18  * The full GNU General Public License is included in this distribution in
19  * the file called "COPYING".
20  *
21  * Contact Information:
22  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23  * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
24  *
25  ******************************************************************************/
26
27 #if !defined(__SGX_BRIDGE_KM_H__)
28 #define __SGX_BRIDGE_KM_H__
29
30 #include "sgxapi_km.h"
31 #include "sgxinfo.h"
32 #include "sgxinfokm.h"
33 #include "sgx_bridge.h"
34 #include "pvr_bridge.h"
35 #include "perproc.h"
36
37 #if defined (__cplusplus)
38 extern "C" {
39 #endif
40
41         IMG_IMPORT
42             PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle,
43                                              PVRSRV_TRANSFER_SGX_KICK * psKick);
44
45 #if defined(SGX_FEATURE_2D_HARDWARE)
46         IMG_IMPORT
47             PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle,
48                                        PVRSRV_2D_SGX_KICK * psKick);
49 #endif
50
51         IMG_IMPORT
52             PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle,
53                                      PVR3DIF4_CCB_KICK * psCCBKick);
54
55         IMG_IMPORT
56             PVRSRV_ERROR SGXGetPhysPageAddrKM(IMG_HANDLE hDevMemHeap,
57                                               IMG_DEV_VIRTADDR sDevVAddr,
58                                               IMG_DEV_PHYADDR * pDevPAddr,
59                                               IMG_CPU_PHYADDR * pCpuPAddr);
60
61         IMG_IMPORT
62             PVRSRV_ERROR IMG_CALLCONV SGXGetMMUPDAddrKM(IMG_HANDLE hDevCookie,
63                                                         IMG_HANDLE
64                                                         hDevMemContext,
65                                                         IMG_DEV_PHYADDR *
66                                                         psPDDevPAddr);
67
68         IMG_IMPORT
69             PVRSRV_ERROR SGXGetClientInfoKM(IMG_HANDLE hDevCookie,
70                                             PVR3DIF4_CLIENT_INFO *
71                                             psClientInfo);
72
73         IMG_IMPORT
74             PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO * psDevInfo,
75                                           SGX_MISC_INFO * psMiscInfo);
76
77 #if defined(SUPPORT_SGX_HWPERF)
78         IMG_IMPORT
79             PVRSRV_ERROR SGXReadDiffCountersKM(IMG_HANDLE hDevHandle,
80                                                IMG_UINT32 ui32Reg,
81                                                IMG_UINT32 * pui32Old,
82                                                IMG_BOOL bNew,
83                                                IMG_UINT32 ui32New,
84                                                IMG_UINT32 ui32NewReset,
85                                                IMG_UINT32 ui32CountersReg,
86                                                IMG_UINT32 * pui32Time,
87                                                IMG_BOOL * pbActive,
88                                                PVRSRV_SGXDEV_DIFF_INFO *
89                                                psDiffs);
90 #endif
91
92         IMG_IMPORT
93             PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(PVRSRV_SGXDEV_INFO *
94                                                    psDevInfo,
95                                                    PVRSRV_KERNEL_SYNC_INFO *
96                                                    psSyncInfo,
97                                                    IMG_BOOL bWaitForComplete);
98
99         IMG_IMPORT
100             PVRSRV_ERROR SGXGetInfoForSrvinitKM(IMG_HANDLE hDevHandle,
101                                                 SGX_BRIDGE_INFO_FOR_SRVINIT *
102                                                 psInitInfo);
103
104         IMG_IMPORT
105             PVRSRV_ERROR DevInitSGXPart2KM(PVRSRV_PER_PROCESS_DATA * psPerProc,
106                                            IMG_HANDLE hDevHandle,
107                                            SGX_BRIDGE_INIT_INFO * psInitInfo);
108
109         IMG_IMPORT PVRSRV_ERROR
110             SGXFindSharedPBDescKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
111                                   IMG_HANDLE hDevCookie,
112                                   IMG_BOOL bLockOnFailure,
113                                   IMG_UINT32 ui32TotalPBSize,
114                                   IMG_HANDLE * phSharedPBDesc,
115                                   PVRSRV_KERNEL_MEM_INFO **
116                                   ppsSharedPBDescKernelMemInfo,
117                                   PVRSRV_KERNEL_MEM_INFO **
118                                   ppsHWPBDescKernelMemInfo,
119                                   PVRSRV_KERNEL_MEM_INFO **
120                                   ppsBlockKernelMemInfo,
121                                   PVRSRV_KERNEL_MEM_INFO ***
122                                   pppsSharedPBDescSubKernelMemInfos,
123                                   IMG_UINT32 *
124                                   ui32SharedPBDescSubKernelMemInfosCount);
125
126         IMG_IMPORT PVRSRV_ERROR
127             SGXUnrefSharedPBDescKM(IMG_HANDLE hSharedPBDesc);
128
129         IMG_IMPORT PVRSRV_ERROR
130             SGXAddSharedPBDescKM(PVRSRV_PER_PROCESS_DATA * psPerProc,
131                                  IMG_HANDLE hDevCookie,
132                                  PVRSRV_KERNEL_MEM_INFO *
133                                  psSharedPBDescKernelMemInfo,
134                                  PVRSRV_KERNEL_MEM_INFO *
135                                  psHWPBDescKernelMemInfo,
136                                  PVRSRV_KERNEL_MEM_INFO * psBlockKernelMemInfo,
137                                  IMG_UINT32 ui32TotalPBSize,
138                                  IMG_HANDLE * phSharedPBDesc,
139                                  PVRSRV_KERNEL_MEM_INFO **
140                                  psSharedPBDescSubKernelMemInfos,
141                                  IMG_UINT32
142                                  ui32SharedPBDescSubKernelMemInfosCount);
143
144         IMG_IMPORT PVRSRV_ERROR
145             SGXGetInternalDevInfoKM(IMG_HANDLE hDevCookie,
146                                     PVR3DIF4_INTERNAL_DEVINFO *
147                                     psSGXInternalDevInfo);
148
149 #if defined (__cplusplus)
150 }
151 #endif
152 #endif