1 /**********************************************************************
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
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.
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.
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.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25 ******************************************************************************/
27 #if !defined(__SGX_BRIDGE_KM_H__)
28 #define __SGX_BRIDGE_KM_H__
30 #include "sgxapi_km.h"
32 #include "sgxinfokm.h"
33 #include "sgx_bridge.h"
34 #include "pvr_bridge.h"
37 #if defined (__cplusplus)
42 PVRSRV_ERROR SGXSubmitTransferKM(IMG_HANDLE hDevHandle,
43 PVRSRV_TRANSFER_SGX_KICK * psKick);
45 #if defined(SGX_FEATURE_2D_HARDWARE)
47 PVRSRV_ERROR SGXSubmit2DKM(IMG_HANDLE hDevHandle,
48 PVRSRV_2D_SGX_KICK * psKick);
52 PVRSRV_ERROR SGXDoKickKM(IMG_HANDLE hDevHandle,
53 PVR3DIF4_CCB_KICK * psCCBKick);
56 PVRSRV_ERROR SGXGetPhysPageAddrKM(IMG_HANDLE hDevMemHeap,
57 IMG_DEV_VIRTADDR sDevVAddr,
58 IMG_DEV_PHYADDR * pDevPAddr,
59 IMG_CPU_PHYADDR * pCpuPAddr);
62 PVRSRV_ERROR IMG_CALLCONV SGXGetMMUPDAddrKM(IMG_HANDLE hDevCookie,
69 PVRSRV_ERROR SGXGetClientInfoKM(IMG_HANDLE hDevCookie,
70 PVR3DIF4_CLIENT_INFO *
74 PVRSRV_ERROR SGXGetMiscInfoKM(PVRSRV_SGXDEV_INFO * psDevInfo,
75 SGX_MISC_INFO * psMiscInfo);
77 #if defined(SUPPORT_SGX_HWPERF)
79 PVRSRV_ERROR SGXReadDiffCountersKM(IMG_HANDLE hDevHandle,
81 IMG_UINT32 * pui32Old,
84 IMG_UINT32 ui32NewReset,
85 IMG_UINT32 ui32CountersReg,
86 IMG_UINT32 * pui32Time,
88 PVRSRV_SGXDEV_DIFF_INFO *
93 PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(PVRSRV_SGXDEV_INFO *
95 PVRSRV_KERNEL_SYNC_INFO *
97 IMG_BOOL bWaitForComplete);
100 PVRSRV_ERROR SGXGetInfoForSrvinitKM(IMG_HANDLE hDevHandle,
101 SGX_BRIDGE_INFO_FOR_SRVINIT *
105 PVRSRV_ERROR DevInitSGXPart2KM(PVRSRV_PER_PROCESS_DATA * psPerProc,
106 IMG_HANDLE hDevHandle,
107 SGX_BRIDGE_INIT_INFO * psInitInfo);
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,
124 ui32SharedPBDescSubKernelMemInfosCount);
126 IMG_IMPORT PVRSRV_ERROR
127 SGXUnrefSharedPBDescKM(IMG_HANDLE hSharedPBDesc);
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,
142 ui32SharedPBDescSubKernelMemInfosCount);
144 IMG_IMPORT PVRSRV_ERROR
145 SGXGetInternalDevInfoKM(IMG_HANDLE hDevCookie,
146 PVR3DIF4_INTERNAL_DEVINFO *
147 psSGXInternalDevInfo);
149 #if defined (__cplusplus)