1 /*************************************************************************/ /*!
3 @Title RGX compute functionality
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Header for the RGX compute functionality
6 @License Dual MIT/GPLv2
8 The contents of this file are subject to the MIT license as set out below.
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
32 This License is also included in this distribution in the file called
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
44 #if !defined(__RGXCOMPUTE_H__)
45 #define __RGXCOMPUTE_H__
47 #include "devicemem.h"
49 #include "rgxfwutils.h"
50 #include "rgx_fwif_resetframework.h"
53 #include "sync_server.h"
54 #include "sync_internal.h"
55 #include "connection_server.h"
57 typedef struct _RGX_SERVER_COMPUTE_CONTEXT_ RGX_SERVER_COMPUTE_CONTEXT;
60 *******************************************************************************
61 @Function PVRSRVRGXCreateComputeContextKM
67 @Input psCmpCCBMemDesc -
68 @Input psCmpCCBCtlMemDesc -
69 @Output ppsFWComputeContextMemDesc -
72 ******************************************************************************/
74 PVRSRV_ERROR PVRSRVRGXCreateComputeContextKM(CONNECTION_DATA *psConnection,
75 PVRSRV_DEVICE_NODE *psDeviceNode,
76 IMG_UINT32 ui32Priority,
77 IMG_DEV_VIRTADDR sMCUFenceAddr,
78 IMG_UINT32 ui32FrameworkRegisterSize,
79 IMG_PBYTE pbyFrameworkRegisters,
80 IMG_HANDLE hMemCtxPrivData,
81 RGX_SERVER_COMPUTE_CONTEXT **ppsComputeContext);
84 *******************************************************************************
85 @Function PVRSRVRGXDestroyComputeContextKM
88 Server-side implementation of RGXDestroyComputeContext
90 @Input psCleanupData -
93 ******************************************************************************/
95 PVRSRV_ERROR PVRSRVRGXDestroyComputeContextKM(RGX_SERVER_COMPUTE_CONTEXT *psComputeContext);
99 *******************************************************************************
100 @Function PVRSRVRGXKickCDMKM
103 Server-side implementation of RGXKickCDM
105 @Input psDeviceNode - RGX Device node
106 @Input psFWComputeContextMemDesc - Mem desc for firmware compute context
107 @Input ui32cCCBWoffUpdate - New fw Woff for the client CDM CCB
110 ******************************************************************************/
112 PVRSRV_ERROR PVRSRVRGXKickCDMKM(RGX_SERVER_COMPUTE_CONTEXT *psComputeContext,
113 IMG_UINT32 ui32ClientFenceCount,
114 SYNC_PRIMITIVE_BLOCK **pauiClientFenceUFOSyncPrimBlock,
115 IMG_UINT32 *paui32ClientFenceSyncOffset,
116 IMG_UINT32 *paui32ClientFenceValue,
117 IMG_UINT32 ui32ClientUpdateCount,
118 SYNC_PRIMITIVE_BLOCK **pauiClientUpdateUFOSyncPrimBlock,
119 IMG_UINT32 *paui32ClientUpdateSyncOffset,
120 IMG_UINT32 *paui32ClientUpdateValue,
121 IMG_UINT32 ui32ServerSyncPrims,
122 IMG_UINT32 *paui32ServerSyncFlags,
123 SERVER_SYNC_PRIMITIVE **pasServerSyncs,
124 IMG_UINT32 ui32CmdSize,
126 IMG_BOOL bPDumpContinuous,
127 IMG_UINT32 ui32ExtJobRef,
128 IMG_UINT32 ui32IntJobRef);
131 *******************************************************************************
132 @Function PVRSRVRGXFlushComputeDataKM
135 Server-side implementation of RGXFlushComputeData
137 @Input psComputeContext - Compute context to flush
140 ******************************************************************************/
142 PVRSRV_ERROR PVRSRVRGXFlushComputeDataKM(RGX_SERVER_COMPUTE_CONTEXT *psComputeContext);
144 PVRSRV_ERROR PVRSRVRGXSetComputeContextPriorityKM(CONNECTION_DATA *psConnection,
145 RGX_SERVER_COMPUTE_CONTEXT *psComputeContext,
146 IMG_UINT32 ui32Priority);
148 /* Debug - check if compute context is waiting on a fence */
149 IMG_VOID CheckForStalledComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
150 DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
152 /* Debug/Watchdog - check if client compute contexts are stalled */
153 IMG_BOOL CheckForStalledClientComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo);
156 *******************************************************************************
157 @Function PVRSRVRGXKickSyncCDMKM
160 Sending a sync kick command though this CDM context
163 ******************************************************************************/
164 IMG_EXPORT PVRSRV_ERROR
165 PVRSRVRGXKickSyncCDMKM(RGX_SERVER_COMPUTE_CONTEXT *psComputeContext,
166 IMG_UINT32 ui32ClientFenceCount,
167 SYNC_PRIMITIVE_BLOCK **pauiClientFenceUFOSyncPrimBlock,
168 IMG_UINT32 *paui32ClientFenceSyncOffset,
169 IMG_UINT32 *paui32ClientFenceValue,
170 IMG_UINT32 ui32ClientUpdateCount,
171 SYNC_PRIMITIVE_BLOCK **pauiClientUpdateUFOSyncPrimBlock,
172 IMG_UINT32 *paui32ClientUpdateSyncOffset,
173 IMG_UINT32 *paui32ClientUpdateValue,
174 IMG_UINT32 ui32ServerSyncPrims,
175 IMG_UINT32 *paui32ServerSyncFlags,
176 SERVER_SYNC_PRIMITIVE **pasServerSyncs,
177 IMG_UINT32 ui32NumFenceFDs,
178 IMG_INT32 *paui32FenceFDs,
179 IMG_BOOL bPDumpContinuous);
181 #endif /* __RGXCOMPUTE_H__ */