1
/**********************************************************************
3
* Copyright (C) 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
******************************************************************************/
28
#include "sgxinfokm.h"
31
#define CCB_OFFSET_IS_VALID(type, psCCBMemInfo, psCCBKick, offset) \
32
((sizeof(type) <= (psCCBMemInfo)->uAllocSize) && \
33
((psCCBKick)->offset <= (psCCBMemInfo)->uAllocSize - sizeof(type)))
35
#define CCB_DATA_FROM_OFFSET(type, psCCBMemInfo, psCCBKick, offset) \
36
((type *)(((IMG_CHAR *)(psCCBMemInfo)->pvLinAddrKM) + \
41
IMG_VOID SGXTestActivePowerEvent(PVRSRV_DEVICE_NODE *psDeviceNode,
42
IMG_UINT32 ui32CallerID);
45
PVRSRV_ERROR SGXScheduleCCBCommand(PVRSRV_DEVICE_NODE *psDeviceNode,
46
SGXMKIF_CMD_TYPE eCommandType,
47
SGXMKIF_COMMAND *psCommandData,
48
IMG_UINT32 ui32CallerID,
49
IMG_UINT32 ui32PDumpFlags,
50
IMG_HANDLE hDevMemContext,
51
IMG_BOOL bLastInScene);
53
PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE *psDeviceNode,
54
SGXMKIF_CMD_TYPE eCommandType,
55
SGXMKIF_COMMAND *psCommandData,
56
IMG_UINT32 ui32CallerID,
57
IMG_UINT32 ui32PDumpFlags,
58
IMG_HANDLE hDevMemContext,
59
IMG_BOOL bLastInScene);
62
PVRSRV_ERROR SGXScheduleProcessQueuesKM(PVRSRV_DEVICE_NODE *psDeviceNode);
65
IMG_BOOL SGXIsDevicePowered(PVRSRV_DEVICE_NODE *psDeviceNode);
68
IMG_HANDLE SGXRegisterHWRenderContextKM(IMG_HANDLE psDeviceNode,
69
IMG_DEV_VIRTADDR *psHWRenderContextDevVAddr,
70
PVRSRV_PER_PROCESS_DATA *psPerProc);
73
IMG_HANDLE SGXRegisterHWTransferContextKM(IMG_HANDLE psDeviceNode,
74
IMG_DEV_VIRTADDR *psHWTransferContextDevVAddr,
75
PVRSRV_PER_PROCESS_DATA *psPerProc);
78
PVRSRV_ERROR SGXFlushHWRenderTargetKM(IMG_HANDLE psSGXDevInfo,
79
IMG_DEV_VIRTADDR psHWRTDataSetDevVAddr,
80
IMG_BOOL bForceCleanup);
83
PVRSRV_ERROR SGXUnregisterHWRenderContextKM(IMG_HANDLE hHWRenderContext, IMG_BOOL bForceCleanup);
86
PVRSRV_ERROR SGXUnregisterHWTransferContextKM(IMG_HANDLE hHWTransferContext, IMG_BOOL bForceCleanup);
88
#if defined(SGX_FEATURE_2D_HARDWARE)
90
IMG_HANDLE SGXRegisterHW2DContextKM(IMG_HANDLE psDeviceNode,
91
IMG_DEV_VIRTADDR *psHW2DContextDevVAddr,
92
PVRSRV_PER_PROCESS_DATA *psPerProc);
95
PVRSRV_ERROR SGXUnregisterHW2DContextKM(IMG_HANDLE hHW2DContext, IMG_BOOL bForceCleanup);
98
IMG_UINT32 SGXConvertTimeStamp(PVRSRV_SGXDEV_INFO *psDevInfo,
99
IMG_UINT32 ui32TimeWraps,
100
IMG_UINT32 ui32Time);
102
PVRSRV_ERROR SGXCleanupRequest(PVRSRV_DEVICE_NODE *psDeviceNode,
103
IMG_DEV_VIRTADDR *psHWDataDevVAddr,
104
IMG_UINT32 ui32CleanupType,
105
IMG_BOOL bForceCleanup);
108
PVRSRV_ERROR PVRSRVGetSGXRevDataKM(PVRSRV_DEVICE_NODE* psDeviceNode, IMG_UINT32 *pui32SGXCoreRev,
109
IMG_UINT32 *pui32SGXCoreID);
111
PVRSRV_ERROR SGXContextSuspend(PVRSRV_DEVICE_NODE *psDeviceNode,
112
IMG_DEV_VIRTADDR *psHWContextDevVAddr,