aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/pvr/sgx/sgxutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/pvr/sgx/sgxutils.h')
-rw-r--r--drivers/gpu/pvr/sgx/sgxutils.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/sgx/sgxutils.h b/drivers/gpu/pvr/sgx/sgxutils.h
new file mode 100644
index 00000000000..bc4c0536795
--- /dev/null
+++ b/drivers/gpu/pvr/sgx/sgxutils.h
@@ -0,0 +1,99 @@
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#include "perproc.h"
28#include "sgxinfokm.h"
29
30#define CCB_OFFSET_IS_VALID(type, psCCBMemInfo, psCCBKick, offset) \
31 ((sizeof(type) <= (psCCBMemInfo)->ui32AllocSize) && \
32 ((psCCBKick)->offset <= (psCCBMemInfo)->ui32AllocSize - sizeof(type)))
33
34#define CCB_DATA_FROM_OFFSET(type, psCCBMemInfo, psCCBKick, offset) \
35 ((type *)(((IMG_CHAR *)(psCCBMemInfo)->pvLinAddrKM) + \
36 (psCCBKick)->offset))
37
38
39IMG_IMPORT
40IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE *psDeviceNode,
41 IMG_UINT32 ui32CallerID);
42
43IMG_IMPORT
44PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_SGXDEV_INFO *psDevInfo,
45 SGXMKIF_CMD_TYPE eCommandType,
46 SGXMKIF_COMMAND *psCommandData,
47 IMG_UINT32 ui32CallerID,
48 IMG_UINT32 ui32PDumpFlags);
49IMG_IMPORT
50PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE *psDeviceNode,
51 SGXMKIF_CMD_TYPE eCommandType,
52 SGXMKIF_COMMAND *psCommandData,
53 IMG_UINT32 ui32CallerID,
54 IMG_UINT32 ui32PDumpFlags);
55
56IMG_IMPORT
57PVRSRV_ERROR SGXScheduleProcessQueuesKM(PVRSRV_DEVICE_NODE *psDeviceNode);
58
59IMG_IMPORT
60IMG_BOOL SGXIsDevicePowered(PVRSRV_DEVICE_NODE *psDeviceNode);
61
62IMG_IMPORT
63IMG_HANDLE SGXRegisterHWRenderContextKM(IMG_HANDLE psDeviceNode,
64 IMG_DEV_VIRTADDR *psHWRenderContextDevVAddr,
65 PVRSRV_PER_PROCESS_DATA *psPerProc);
66
67IMG_IMPORT
68IMG_HANDLE SGXRegisterHWTransferContextKM(IMG_HANDLE psDeviceNode,
69 IMG_DEV_VIRTADDR *psHWTransferContextDevVAddr,
70 PVRSRV_PER_PROCESS_DATA *psPerProc);
71
72IMG_IMPORT
73IMG_VOID SGXFlushHWRenderTargetKM(IMG_HANDLE psSGXDevInfo, IMG_DEV_VIRTADDR psHWRTDataSetDevVAddr);
74
75IMG_IMPORT
76PVRSRV_ERROR SGXUnregisterHWRenderContextKM(IMG_HANDLE hHWRenderContext);
77
78IMG_IMPORT
79PVRSRV_ERROR SGXUnregisterHWTransferContextKM(IMG_HANDLE hHWTransferContext);
80
81#if defined(SGX_FEATURE_2D_HARDWARE)
82IMG_IMPORT
83IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE psDeviceNode,
84 IMG_DEV_VIRTADDR *psHW2DContextDevVAddr,
85 PVRSRV_PER_PROCESS_DATA *psPerProc);
86
87IMG_IMPORT
88PVRSRV_ERROR SGXUnregisterHW2DContextKM(IMG_HANDLE hHW2DContext);
89#endif
90
91IMG_UINT32 SGXConvertTimeStamp(PVRSRV_SGXDEV_INFO *psDevInfo,
92 IMG_UINT32 ui32TimeWraps,
93 IMG_UINT32 ui32Time);
94
95IMG_VOID SGXCleanupRequest(PVRSRV_DEVICE_NODE *psDeviceNode,
96 IMG_DEV_VIRTADDR *psHWDataDevVAddr,
97 IMG_UINT32 ui32CleanupType);
98
99