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"
38 enum PVRSRV_ERROR SGXSubmitTransferKM(void *hDevHandle,
39 struct PVRSRV_TRANSFER_SGX_KICK *psKick);
42 enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle,
43 struct SGX_CCB_KICK *psCCBKick);
45 enum PVRSRV_ERROR SGXGetPhysPageAddrKM(void *hDevMemHeap,
46 struct IMG_DEV_VIRTADDR sDevVAddr,
47 struct IMG_DEV_PHYADDR *pDevPAddr,
48 struct IMG_CPU_PHYADDR *pCpuPAddr);
50 enum PVRSRV_ERROR SGXGetMMUPDAddrKM(void *hDevCookie,
51 void *hDevMemContext, struct IMG_DEV_PHYADDR *psPDDevPAddr);
53 enum PVRSRV_ERROR SGXGetClientInfoKM(void *hDevCookie,
54 struct SGX_CLIENT_INFO *psClientInfo);
56 enum PVRSRV_ERROR SGXGetMiscInfoKM(struct PVRSRV_SGXDEV_INFO *psDevInfo,
57 struct SGX_MISC_INFO *psMiscInfo,
58 struct PVRSRV_DEVICE_NODE *psDeviceNode);
60 enum PVRSRV_ERROR SGXReadDiffCountersKM(void *hDevHandle, u32 ui32Reg,
61 u32 *pui32Old, IMG_BOOL bNew, u32 ui32New,
62 u32 ui32NewReset, u32 ui32CountersReg,
63 u32 *pui32Time, IMG_BOOL *pbActive,
64 struct PVRSRV_SGXDEV_DIFF_INFO *psDiffs);
65 enum PVRSRV_ERROR SGXReadHWPerfCBKM(void *hDevHandle, u32 ui32ArraySize,
66 struct PVRSRV_SGX_HWPERF_CB_ENTRY *psHWPerfCBData,
67 u32 *pui32DataCount, u32 *pui32ClockSpeed,
68 u32 *pui32HostTimeStamp);
70 enum PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(
71 struct PVRSRV_SGXDEV_INFO *psDevInfo,
72 struct PVRSRV_KERNEL_SYNC_INFO *psSyncInfo,
73 IMG_BOOL bWaitForComplete);
75 enum PVRSRV_ERROR SGXGetInfoForSrvinitKM(void *hDevHandle,
76 struct SGX_BRIDGE_INFO_FOR_SRVINIT *psInitInfo);
78 enum PVRSRV_ERROR DevInitSGXPart2KM(struct PVRSRV_PER_PROCESS_DATA *psPerProc,
80 struct SGX_BRIDGE_INIT_INFO *psInitInfo);
82 enum PVRSRV_ERROR SGXFindSharedPBDescKM(
83 struct PVRSRV_PER_PROCESS_DATA *psPerProc,
84 void *hDevCookie, IMG_BOOL bLockOnFailure, u32 ui32TotalPBSize,
85 void **phSharedPBDesc,
86 struct PVRSRV_KERNEL_MEM_INFO **ppsSharedPBDescKernelMemInfo,
87 struct PVRSRV_KERNEL_MEM_INFO **ppsHWPBDescKernelMemInfo,
88 struct PVRSRV_KERNEL_MEM_INFO **ppsBlockKernelMemInfo,
89 struct PVRSRV_KERNEL_MEM_INFO ***pppsSharedPBDescSubKernelMemInfos,
90 u32 *ui32SharedPBDescSubKernelMemInfosCount);
92 enum PVRSRV_ERROR SGXUnrefSharedPBDescKM(void *hSharedPBDesc);
94 enum PVRSRV_ERROR SGXAddSharedPBDescKM(
95 struct PVRSRV_PER_PROCESS_DATA *psPerProc,
97 struct PVRSRV_KERNEL_MEM_INFO *psSharedPBDescKernelMemInfo,
98 struct PVRSRV_KERNEL_MEM_INFO *psHWPBDescKernelMemInfo,
99 struct PVRSRV_KERNEL_MEM_INFO *psBlockKernelMemInfo,
100 u32 ui32TotalPBSize, void **phSharedPBDesc,
101 struct PVRSRV_KERNEL_MEM_INFO **psSharedPBDescSubKernelMemInfos,
102 u32 ui32SharedPBDescSubKernelMemInfosCount);
104 enum PVRSRV_ERROR SGXGetInternalDevInfoKM(void *hDevCookie,
105 struct SGX_INTERNAL_DEVINFO *psSGXInternalDevInfo);
107 int sgx_force_reset(void);
109 IMG_BOOL isSGXPerfServerActive(void);
110 void SGXPerfServerMonitor(u32 u32TimeStamp);