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,
40 struct PVRSRV_PER_PROCESS_DATA *proc);
43 enum PVRSRV_ERROR SGXDoKickKM(void *hDevHandle,
44 struct SGX_CCB_KICK *psCCBKick,
45 struct PVRSRV_PER_PROCESS_DATA *proc);
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);
52 enum PVRSRV_ERROR SGXGetMMUPDAddrKM(void *hDevCookie,
53 void *hDevMemContext, struct IMG_DEV_PHYADDR *psPDDevPAddr);
55 enum PVRSRV_ERROR SGXGetClientInfoKM(void *hDevCookie,
56 struct SGX_CLIENT_INFO *psClientInfo);
58 enum PVRSRV_ERROR SGXGetMiscInfoKM(struct PVRSRV_SGXDEV_INFO *psDevInfo,
59 struct SGX_MISC_INFO *psMiscInfo,
60 struct PVRSRV_DEVICE_NODE *psDeviceNode);
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);
72 enum PVRSRV_ERROR SGX2DQueryBlitsCompleteKM(
73 struct PVRSRV_SGXDEV_INFO *psDevInfo,
74 struct PVRSRV_KERNEL_SYNC_INFO *psSyncInfo,
75 IMG_BOOL bWaitForComplete);
77 enum PVRSRV_ERROR SGXGetInfoForSrvinitKM(void *hDevHandle,
78 struct SGX_BRIDGE_INFO_FOR_SRVINIT *psInitInfo);
80 enum PVRSRV_ERROR DevInitSGXPart2KM(struct PVRSRV_PER_PROCESS_DATA *psPerProc,
82 struct SGX_BRIDGE_INIT_INFO *psInitInfo);
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);
94 enum PVRSRV_ERROR SGXUnrefSharedPBDescKM(void *hSharedPBDesc);
96 enum PVRSRV_ERROR SGXAddSharedPBDescKM(
97 struct PVRSRV_PER_PROCESS_DATA *psPerProc,
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);
106 enum PVRSRV_ERROR SGXGetInternalDevInfoKM(void *hDevCookie,
107 struct SGX_INTERNAL_DEVINFO *psSGXInternalDevInfo);
109 int sgx_force_reset(void);
111 IMG_BOOL isSGXPerfServerActive(void);
112 void SGXPerfServerMonitor(u32 u32TimeStamp);