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 PRGXFWIF_UFO_ADDR *pauiClientFenceUFOAddress,
115 IMG_UINT32 *paui32ClientFenceValue,
116 IMG_UINT32 ui32ClientUpdateCount,
117 PRGXFWIF_UFO_ADDR *pauiClientUpdateUFOAddress,
118 IMG_UINT32 *paui32ClientUpdateValue,
119 IMG_UINT32 ui32ServerSyncPrims,
120 IMG_UINT32 *paui32ServerSyncFlags,
121 SERVER_SYNC_PRIMITIVE **pasServerSyncs,
122 IMG_UINT32 ui32CmdSize,
124 IMG_BOOL bPDumpContinuous,
125 IMG_UINT32 ui32ExtJobRef,
126 IMG_UINT32 ui32IntJobRef);
129 *******************************************************************************
130 @Function PVRSRVRGXFlushComputeDataKM
133 Server-side implementation of RGXFlushComputeData
135 @Input psComputeContext - Compute context to flush
138 ******************************************************************************/
140 PVRSRV_ERROR PVRSRVRGXFlushComputeDataKM(RGX_SERVER_COMPUTE_CONTEXT *psComputeContext);
142 PVRSRV_ERROR PVRSRVRGXSetComputeContextPriorityKM(CONNECTION_DATA *psConnection,
143 RGX_SERVER_COMPUTE_CONTEXT *psComputeContext,
144 IMG_UINT32 ui32Priority);
146 /* Debug - check if compute context is waiting on a fence */
147 IMG_VOID CheckForStalledComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo,
148 DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf);
150 /* Debug/Watchdog - check if client compute contexts are stalled */
151 IMG_BOOL CheckForStalledClientComputeCtxt(PVRSRV_RGXDEV_INFO *psDevInfo);
154 *******************************************************************************
155 @Function PVRSRVRGXKickSyncCDMKM
158 Sending a sync kick command though this CDM context
161 ******************************************************************************/
162 IMG_EXPORT PVRSRV_ERROR
163 PVRSRVRGXKickSyncCDMKM(RGX_SERVER_COMPUTE_CONTEXT *psComputeContext,
164 IMG_UINT32 ui32ClientFenceCount,
165 PRGXFWIF_UFO_ADDR *pauiClientFenceUFOAddress,
166 IMG_UINT32 *paui32ClientFenceValue,
167 IMG_UINT32 ui32ClientUpdateCount,
168 PRGXFWIF_UFO_ADDR *pauiClientUpdateUFOAddress,
169 IMG_UINT32 *paui32ClientUpdateValue,
170 IMG_UINT32 ui32ServerSyncPrims,
171 IMG_UINT32 *paui32ServerSyncFlags,
172 SERVER_SYNC_PRIMITIVE **pasServerSyncs,
173 IMG_UINT32 ui32NumFenceFDs,
174 IMG_INT32 *paui32FenceFDs,
175 IMG_BOOL bPDumpContinuous);
177 #endif /* __RGXCOMPUTE_H__ */