1 /*************************************************************************/ /*!
3 @Title RGX API Header kernel mode
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Exported RGX API details
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 #ifndef __RGXAPI_KM_H__
45 #define __RGXAPI_KM_H__
47 #if defined(SUPPORT_SHARED_SLC)
49 ******************************************************************************
53 @Description Init the SLC after a power up. It is required to call this
54 function if using SUPPORT_SHARED_SLC. Otherwise, it shouldn't
57 @Input hDevHandle : RGX Device Node
59 @Return PVRSRV_ERROR :
61 ******************************************************************************/
62 PVRSRV_ERROR RGXInitSLC(IMG_HANDLE hDevHandle);
65 #if defined(SUPPORT_KERNEL_HWPERF)
67 #include "rgx_hwperf_km.h"
70 /******************************************************************************
71 * RGX HW Performance Profiling Control API(s)
72 *****************************************************************************/
74 /**************************************************************************/ /*!
75 @Function RGXHWPerfConnect
76 @Description Obtain a connection object to the HWPerf device
77 @Output phDevData Address of a handle to a connection object
78 @Return PVRSRV_ERROR: for system error codes
79 */ /***************************************************************************/
80 PVRSRV_ERROR RGXHWPerfConnect(
81 IMG_HANDLE* phDevData);
84 /**************************************************************************/ /*!
85 @Function RGXHWPerfDisconnect
86 @Description Disconnect from the HWPerf device
87 @Input hSrvHandle Handle to connection object as returned from
89 @Return PVRSRV_ERROR: for system error codes
90 */ /***************************************************************************/
91 PVRSRV_ERROR RGXHWPerfDisconnect(
95 /**************************************************************************/ /*!
96 @Function RGXHWPerfControl
97 @Description Enable or disable the generation of RGX HWPerf event packets.
99 @Input hDevData Handle to connection object
100 @Input bToggle Switch to toggle or apply mask.
101 @Input ui64Mask Mask of events to control.
102 @Return PVRSRV_ERROR: for system error codes
103 */ /***************************************************************************/
104 PVRSRV_ERROR IMG_CALLCONV RGXHWPerfControl(
107 IMG_UINT64 ui64Mask);
110 /**************************************************************************/ /*!
111 @Function RGXHWPerfConfigureAndEnableCounters
112 @Description Enable and configure the performance counter block for
113 one or more device layout modules.
114 See RGXConfigureAndEnableHWPerfCounters().
115 @Input hDevData Handle to connection object
116 @Input ui32NumBlocks Number of elements in the array
117 @Input asBlockConfigs Address of the array of configuration blocks
118 @Return PVRSRV_ERROR: for system error codes
119 */ /***************************************************************************/
120 PVRSRV_ERROR IMG_CALLCONV RGXHWPerfConfigureAndEnableCounters(
122 IMG_UINT32 ui32NumBlocks,
123 RGX_HWPERF_CONFIG_CNTBLK* asBlockConfigs);
126 /**************************************************************************/ /*!
127 @Function RGXDisableHWPerfCounters
128 @Description Disable the performance counter block for one or more
129 device layout modules. See RGXDisableHWPerfCounters().
130 @Input hDevData Handle to connection/device object
131 @Input ui32NumBlocks Number of elements in the array
132 @Input aeBlockIDs An array of bytes with values taken from
133 the RGX_HWPERF_CNTBLK_ID enumeration.
134 @Return PVRSRV_ERROR: for system error codes
135 */ /***************************************************************************/
136 PVRSRV_ERROR IMG_CALLCONV RGXHWPerfDisableCounters(
138 IMG_UINT32 ui32NumBlocks,
139 IMG_UINT16* aeBlockIDs);
142 /******************************************************************************
143 * RGX HW Performance Profiling Retrieval API(s)
145 * The client must ensure their use of this acquire/release API for a single
146 * connection/stream must not be shared with multiple execution contexts e.g.
147 * between a kernel thread and an ISR handler. It is the client’s
148 * responsibility to ensure this API is not interrupted by a high priority
150 *****************************************************************************/
152 /**************************************************************************/ /*!
153 @Function RGXHWPerfAcquireData
154 @Description When there is data available to read this call returns with
155 the address and length of the data buffer the
156 client can safely read. This buffer may contain one or more
157 event packets. If no data is available then this call
158 returns OK and sets *puiBufLen to 0 on exit.
159 Clients must pair this call with a ReleaseData call.
160 @Input hDevData Handle to connection/device object
161 @Output ppBuf Address of a pointer to a byte buffer. On exit
162 it contains the address of buffer to read from
163 @Output puiBufLen Pointer to an integer. On exit it is the size
164 of the data to read from the buffer
165 @Return PVRSRV_ERROR: for system error codes
166 */ /***************************************************************************/
167 PVRSRV_ERROR RGXHWPerfAcquireData(
170 IMG_UINT32* pui32BufLen);
173 /**************************************************************************/ /*!
174 @Function RGXHWPerfReleaseData
175 @Description Called after client has read the event data out of the buffer
176 retrieved from the Acquire Data call to release resources.
177 @Input hDevData Handle to connection/device object
178 @Return PVRSRV_ERROR: for system error codes
179 */ /***************************************************************************/
181 PVRSRV_ERROR RGXHWPerfReleaseData(
182 IMG_HANDLE hDevData);
185 #endif /* SUPPORT_KERNEL_HWPERF */
188 #endif /* __RGXAPI_KM_H__ */
190 /******************************************************************************
191 End of file (rgxapi_km.h)
192 ******************************************************************************/