gpu: pvr: V2: Find and fix all incorrect sync counter completion checks
[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
38 enum PVRSRV_ERROR SGXSubmitTransferKM(void *hDevHandle,
39                                 struct PVRSRV_TRANSFER_SGX_KICK *psKick,
40                                 struct PVRSRV_PER_PROCESS_DATA *proc);
41
42
43 enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle,
44                                 struct SGX_CCB_KICK *psCCBKick,
45                                 struct PVRSRV_PER_PROCESS_DATA *proc);
46
47 enum PVRSRV_ERROR SGXGetPhysPageAddrKM(void *hDevMemHeap,
48                 struct IMG_DEV_VIRTADDR sDevVAddr,
49                 struct IMG_DEV_PHYADDR *pDevPAddr,
50                 struct IMG_CPU_PHYADDR *pCpuPAddr);
51
52 enum PVRSRV_ERROR SGXGetMMUPDAddrKM(void *hDevCookie,
53                 void *hDevMemContext, struct IMG_DEV_PHYADDR *psPDDevPAddr);
54
55 enum PVRSRV_ERROR SGXGetClientInfoKM(void *hDevCookie,
56                                          struct SGX_CLIENT_INFO *psClientInfo);
57
58 enum PVRSRV_ERROR SGXGetMiscInfoKM(struct PVRSRV_SGXDEV_INFO *psDevInfo,
59                                        struct SGX_MISC_INFO *psMiscInfo,
60                                        struct PVRSRV_DEVICE_NODE *psDeviceNode);
61
62 enum PVRSRV_ERROR SGXReadDiffCountersKM(void *hDevHandle, u32 ui32Reg,
63                             u32 *pui32Old, IMG_BOOL bNew, u32 ui32New,
64                             u32 ui32NewReset, u32 ui32CountersReg,
65                             u32 *pui32Time, IMG_BOOL *pbActive,
66                             struct PVRSRV_SGXDEV_DIFF_INFO *psDiffs);
67 enum PVRSRV_ERROR SGXReadHWPerfCBKM(void *hDevHandle, u32 ui32ArraySize,
68                             struct PVRSRV_SGX_HWPERF_CB_ENTRY *psHWPerfCBData,
69                             u32 *pui32DataCount, u32 *pui32ClockSpeed,
70                             u32 *pui32HostTimeStamp);
71
72 enum PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(
73                             struct PVRSRV_SGXDEV_INFO *psDevInfo,
74                             struct PVRSRV_KERNEL_SYNC_INFO *psSyncInfo,
75                             IMG_BOOL bWaitForComplete);
76
77 enum PVRSRV_ERROR SGXGetInfoForSrvinitKM(void *hDevHandle,
78                             struct SGX_BRIDGE_INFO_FOR_SRVINIT *psInitInfo);
79
80 enum PVRSRV_ERROR DevInitSGXPart2KM(struct PVRSRV_PER_PROCESS_DATA *psPerProc,
81                             void *hDevHandle,
82                             struct SGX_BRIDGE_INIT_INFO *psInitInfo);
83
84 enum PVRSRV_ERROR SGXFindSharedPBDescKM(
85         struct PVRSRV_PER_PROCESS_DATA *psPerProc,
86         void *hDevCookie, IMG_BOOL bLockOnFailure, u32 ui32TotalPBSize,
87         void **phSharedPBDesc,
88         struct PVRSRV_KERNEL_MEM_INFO **ppsSharedPBDescKernelMemInfo,
89         struct PVRSRV_KERNEL_MEM_INFO **ppsHWPBDescKernelMemInfo,
90         struct PVRSRV_KERNEL_MEM_INFO **ppsBlockKernelMemInfo,
91         struct PVRSRV_KERNEL_MEM_INFO ***pppsSharedPBDescSubKernelMemInfos,
92         u32 *ui32SharedPBDescSubKernelMemInfosCount);
93
94 enum PVRSRV_ERROR SGXUnrefSharedPBDescKM(void *hSharedPBDesc);
95
96 enum PVRSRV_ERROR SGXAddSharedPBDescKM(
97                 struct PVRSRV_PER_PROCESS_DATA *psPerProc,
98                 void *hDevCookie,
99                 struct PVRSRV_KERNEL_MEM_INFO *psSharedPBDescKernelMemInfo,
100                 struct PVRSRV_KERNEL_MEM_INFO *psHWPBDescKernelMemInfo,
101                 struct PVRSRV_KERNEL_MEM_INFO *psBlockKernelMemInfo,
102                 u32 ui32TotalPBSize, void **phSharedPBDesc,
103                 struct PVRSRV_KERNEL_MEM_INFO **psSharedPBDescSubKernelMemInfos,
104                 u32 ui32SharedPBDescSubKernelMemInfosCount);
105
106 enum PVRSRV_ERROR SGXGetInternalDevInfoKM(void *hDevCookie,
107                         struct SGX_INTERNAL_DEVINFO *psSGXInternalDevInfo);
108
109 int sgx_force_reset(void);
110
111 IMG_BOOL isSGXPerfServerActive(void);
112 void       SGXPerfServerMonitor(u32 u32TimeStamp);
113
114 #endif