1 /*************************************************************************/ /*!
3 @Title Services API Header
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Exported services 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 __SERVICES_H__
45 #define __SERVICES_H__
47 #if defined (__cplusplus)
52 #include "servicesext.h"
53 #include "sync_external.h"
54 #include "pdumpdefs.h"
55 #include "lock_types.h"
56 #include "pvr_debug.h"
62 /* LDDM build needs to include this for the allocation structure */
63 #include "umallocation.h"
66 #include "pvrsrv_device_types.h"
68 /* The comment below is the front page for code-generated doxygen documentation */
70 ******************************************************************************
72 This document details the APIs and implementation of the Consumer Services.
73 It is intended to be used in conjunction with the Consumer Services
74 Software Architectural Specification and the Consumer Services Software
75 Functional Specification.
76 *****************************************************************************/
78 /******************************************************************************
80 *****************************************************************************/
82 /*! 4k page size definition */
83 #define PVRSRV_4K_PAGE_SIZE 4096UL /*!< Size of a 4K Page */
84 #define PVRSRV_4K_PAGE_SIZE_ALIGNSHIFT 12 /*!< Amount to shift an address by so that
85 it is always page-aligned */
86 /*! 16k page size definition */
87 #define PVRSRV_16K_PAGE_SIZE 16384UL /*!< Size of a 16K Page */
88 #define PVRSRV_16K_PAGE_SIZE_ALIGNSHIFT 14 /*!< Amount to shift an address by so that
89 it is always page-aligned */
90 /*! 64k page size definition */
91 #define PVRSRV_64K_PAGE_SIZE 65536UL /*!< Size of a 64K Page */
92 #define PVRSRV_64K_PAGE_SIZE_ALIGNSHIFT 16 /*!< Amount to shift an address by so that
93 it is always page-aligned */
94 /*! 256k page size definition */
95 #define PVRSRV_256K_PAGE_SIZE 262144UL /*!< Size of a 256K Page */
96 #define PVRSRV_256K_PAGE_SIZE_ALIGNSHIFT 18 /*!< Amount to shift an address by so that
97 it is always page-aligned */
98 /*! 1MB page size definition */
99 #define PVRSRV_1M_PAGE_SIZE 1048576UL /*!< Size of a 1M Page */
100 #define PVRSRV_1M_PAGE_SIZE_ALIGNSHIFT 20 /*!< Amount to shift an address by so that
101 it is always page-aligned */
102 /*! 2MB page size definition */
103 #define PVRSRV_2M_PAGE_SIZE 2097152UL /*!< Size of a 2M Page */
104 #define PVRSRV_2M_PAGE_SIZE_ALIGNSHIFT 21 /*!< Amount to shift an address by so that
105 it is always page-aligned */
108 #define EVENTOBJNAME_MAXLENGTH (50) /*!< Max length of an event object name */
112 Flags for Services connection.
113 Allows to define per-client policy for Services
115 #define SRV_FLAGS_PERSIST (1U << 0) /*!< Persist client flag */
116 #define SRV_FLAGS_INIT_PROCESS (1U << 1) /*!< Allows connect to succeed if SrvInit
117 * has not yet run (used by SrvInit itself) */
118 #define SRV_FLAGS_PDUMPCTRL (1U << 31) /*!< PDump Ctrl client flag */
121 Pdump flags which are accessible to Services clients
125 #define PVRSRV_PDUMP_FLAGS_CONTINUOUS 0x40000000UL /*!< pdump continuous */
127 #define PVRSRV_UNDEFINED_HEAP_ID (~0LU)
130 ******************************************************************************
132 *****************************************************************************/
135 IMG_EGL = 0x00000001, /*!< EGL Module */
136 IMG_OPENGLES1 = 0x00000002, /*!< OGLES1 Module */
137 IMG_OPENGLES3 = 0x00000003, /*!< OGLES3 Module */
138 IMG_D3DM = 0x00000004, /*!< D3DM Module */
139 IMG_SRV_UM = 0x00000005, /*!< Services User-Mode */
140 IMG_SRV_INIT = 0x00000006, /*!< Services initialisation */
141 IMG_SRVCLIENT = 0x00000007, /*!< Services Client */
142 IMG_WDDMKMD = 0x00000008, /*!< WDDM KMD */
143 IMG_WDDM3DNODE = 0x00000009, /*!< WDDM 3D Node */
144 IMG_WDDMMVIDEONODE = 0x0000000A, /*!< WDDM MVideo Node */
145 IMG_WDDMVPBNODE = 0x0000000B, /*!< WDDM VPB Node */
146 IMG_OPENGL = 0x0000000C, /*!< OpenGL */
147 IMG_D3D = 0x0000000D, /*!< D3D */
148 IMG_OPENCL = 0x0000000E, /*!< OpenCL */
149 IMG_ANDROID_HAL = 0x0000000F, /*!< Graphics HAL */
150 IMG_WEC_GPE = 0x00000010, /*!< WinEC-specific GPE */
151 IMG_PVRGPE = 0x00000011, /*!< WinEC/WinCE GPE */
152 IMG_RSCOMPUTE = 0x00000012, /*!< RenderScript Compute */
153 IMG_OPENRL = 0x00000013, /*!< OpenRL Module */
154 IMG_PDUMPCTRL = 0x00000014, /*!< PDump control client */
158 /*! Max length of an App-Hint string */
159 #define APPHINT_MAX_STRING_SIZE 256
162 ******************************************************************************
164 *****************************************************************************/
167 IMG_STRING_TYPE = 1, /*!< String type */
168 IMG_FLOAT_TYPE , /*!< Float type */
169 IMG_UINT_TYPE , /*!< Unsigned Int type */
170 IMG_INT_TYPE , /*!< (Signed) Int type */
171 IMG_FLAG_TYPE /*!< Flag Type */
175 /******************************************************************************
176 * Structure definitions.
177 *****************************************************************************/
180 * Forward declaration
182 typedef struct _PVRSRV_DEV_DATA_ *PPVRSRV_DEV_DATA;
184 * Forward declaration (look on connection.h)
186 typedef struct _PVRSRV_CONNECTION_ PVRSRV_CONNECTION;
189 /*************************************************************************/ /*!
191 */ /*************************************************************************/
192 typedef struct _PVRSRV_CLIENT_DEV_DATA_
194 IMG_UINT32 ui32NumDevices; /*!< Number of services-managed devices connected */
195 PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES]; /*!< Device identifiers */
196 PVRSRV_ERROR (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*!< device-specific connection callback */
197 PVRSRV_ERROR (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*!< device-specific debug trace callback */
199 } PVRSRV_CLIENT_DEV_DATA;
202 ******************************************************************************
203 * This structure allows the user mode glue code to have an OS independent
205 *****************************************************************************/
206 typedef struct _PVRSRV_DEV_DATA_
208 PVRSRV_CONNECTION *psConnection; /*!< Services connection info */
209 IMG_HANDLE hDevCookie; /*!< Dev cookie */
213 /*************************************************************************/ /*!
214 PVR Client Event handling in Services
215 */ /**************************************************************************/
216 typedef enum _PVRSRV_CLIENT_EVENT_
218 PVRSRV_CLIENT_EVENT_HWTIMEOUT = 0, /*!< hw timeout event */
219 } PVRSRV_CLIENT_EVENT;
221 /**************************************************************************/ /*!
222 @Function PVRSRVClientEvent
223 @Description Handles timeouts occurring in client drivers
224 @Input eEvent event type
225 @Input psDevData pointer to the PVRSRV_DEV_DATA context
226 @Input pvData client-specific data
227 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
229 */ /**************************************************************************/
231 PVRSRV_ERROR IMG_CALLCONV PVRSRVClientEvent(const PVRSRV_CLIENT_EVENT eEvent,
232 PVRSRV_DEV_DATA *psDevData,
235 /******************************************************************************
236 * PVR Services API prototypes.
237 *****************************************************************************/
239 /**************************************************************************/ /*!
240 @Function PVRSRVConnect
241 @Description Creates a connection from an application to the services
242 module and initialises device-specific call-back functions.
243 @Output ppsConnection on Success, *ppsConnection is set to the new
244 PVRSRV_CONNECTION instance.
245 @Input ui32SrvFlags a bit-wise OR of the following:
247 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
249 */ /**************************************************************************/
251 PVRSRV_ERROR IMG_CALLCONV PVRSRVConnect(PVRSRV_CONNECTION **ppsConnection, IMG_UINT32 ui32SrvFlags);
253 /**************************************************************************/ /*!
254 @Function PVRSRVDisconnect
255 @Description Disconnects from the services module
256 @Input psConnection the connection to be disconnected
257 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
259 */ /**************************************************************************/
261 PVRSRV_ERROR IMG_CALLCONV PVRSRVDisconnect(PVRSRV_CONNECTION *psConnection);
263 /**************************************************************************/ /*!
264 @Function PVRSRVEnumerateDevices
265 @Description Enumerate all services managed devices in the
268 The function returns a list of the device IDs stored either
269 in the services (or constructed in the user mode glue
270 component in certain environments). The number of devices
271 in the list is also returned.
273 The user is required to provide a buffer large enough to
274 receive an array of MAX_NUM_DEVICE_IDS *
275 PVRSRV_DEVICE_IDENTIFIER structures.
277 In a binary layered component which does not support dynamic
278 runtime selection, the glue code should compile to return
279 the supported devices statically, e.g. multiple instances of
280 the same device if multiple devices are supported
282 In the case of an environment (for instance) where one
283 services managed device may connect to two display devices
284 this code would enumerate all three devices and even
285 non-dynamic device selection code should retain the facility
286 to parse the list to find the index of a given device.}
288 @Input psConnection Services connection
289 @Output puiNumDevices Number of devices present in the system
290 @Output puiDevIDs Pointer to called supplied array of
291 PVRSRV_DEVICE_IDENTIFIER structures. The
292 array is assumed to be at least
293 PVRSRV_MAX_DEVICES long.
294 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
296 */ /**************************************************************************/
298 PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevices(const PVRSRV_CONNECTION *psConnection,
299 IMG_UINT32 *puiNumDevices,
300 PVRSRV_DEVICE_IDENTIFIER *puiDevIDs);
302 /**************************************************************************/ /*!
303 @Function PVRSRVAcquireDeviceData
304 @Description Returns device info structure pointer for the requested device.
305 This populates a PVRSRV_DEV_DATA structure with appropriate
306 pointers to the DevInfo structure for the device requested.
308 In a non-plug-and-play the first call to GetDeviceInfo for a
309 device causes device initialisation
311 Calls to GetDeviceInfo are reference counted
312 @Input psConnection Services connection
313 @Input uiDevIndex Index to the required device obtained from the
314 PVRSRVEnumerateDevice function
315 @Output psDevData The returned Device Data
316 @Input eDeviceType Required device type. If type is unknown use
317 uiDevIndex to locate device data
318 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
320 */ /**************************************************************************/
322 PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceData(PVRSRV_CONNECTION *psConnection,
323 IMG_UINT32 uiDevIndex,
324 PVRSRV_DEV_DATA *psDevData,
325 PVRSRV_DEVICE_TYPE eDeviceType);
327 /**************************************************************************/ /*!
328 @Function PVRSRVPollForValue
329 @Description Polls for a value to match a masked read of System Memory.
330 The function returns when either (1) the value read back
331 matches ui32Value, or (2) the maximum number of tries has
333 @Input psConnection Services connection
334 @Input hOSEvent Handle to OS event object to wait for
335 @Input pui32LinMemAddr the address of the memory to poll
336 @Input ui32Value the required value
337 @Input ui32Mask the mask to use
338 @Input ui32Waitus interval between tries (us)
339 @Input ui32Tries number of tries to make before giving up
340 @Return PVRSRV_OK on success. Otherwise, a
342 */ /**************************************************************************/
344 PVRSRV_ERROR PVRSRVPollForValue(const PVRSRV_CONNECTION *psConnection,
346 volatile IMG_UINT32 *pui32LinMemAddr,
347 IMG_UINT32 ui32Value,
349 IMG_UINT32 ui32Waitus,
350 IMG_UINT32 ui32Tries);
352 /* this function is almost the same as PVRSRVPollForValue. The only difference
353 * is that it now handles the interval between tries itself. Therefore it can
354 * correctly handles the differences between the different platforms.
357 PVRSRV_ERROR PVRSRVWaitForValue(const PVRSRV_CONNECTION *psConnection,
359 volatile IMG_UINT32 *pui32LinMemAddr,
360 IMG_UINT32 ui32Value,
361 IMG_UINT32 ui32Mask);
364 /**************************************************************************/ /*!
365 @Function PVRSRVConditionCheckCallback
366 @Description Function prototype for use with the PVRSRVWaitForCondition()
367 API. Clients implement this callback to test if the condition
368 waited for has been met and become true.
370 @Input pvUserData Pointer to client user data needed for
372 @Output pbCondMet Updated on exit with condition state
374 @Return PVRSRV_OK when condition tested without error
375 PVRSRV_* other system error that will lead to the
376 abnormal termination of the wait API.
378 /******************************************************************************/
380 PVRSRV_ERROR (*PVRSRVConditionCheckCallback)(
381 IMG_PVOID pvUserData,
382 IMG_BOOL* pbCondMet);
385 /**************************************************************************/ /*!
386 @Function PVRSRVWaitForCondition
387 @Description Wait using PVRSRVEventObjectWait() for a
388 condition (pfnCallback) to become true. It periodically
389 checks the condition state by employing a loop and
390 waiting on either the event supplied or sleeping for a brief
391 time (if hEvent is null) each time the condition is
392 checked and found not to be met. When the condition is true
393 the function returns. It will also return when the time
394 period has been exceeded or an error has occurred.
396 @Input psConnection Services connection
397 @Input hEvent Event to wait on or NULL not to use event
398 objects but OS wait for a short time.
399 @Input pfnCallback Client condition check callback
400 @Input pvUserData Client user data supplied to callback
402 @Return PVRSRV_OK When condition met
403 PVRSRV_ERROR_TIMEOUT When condition not met and time is up
404 PVRSRV_* Otherwise, some other error code
405 */ /**************************************************************************/
407 PVRSRV_ERROR IMG_CALLCONV PVRSRVWaitForCondition(
408 const PVRSRV_CONNECTION* psConnection,
410 PVRSRVConditionCheckCallback pfnCallback,
411 IMG_PVOID pvUserData);
414 /**************************************************************************/ /*!
415 @Function PVRSRVWaitUntilSyncPrimOpReady
416 @Description Wait using PVRSRVWaitForCondition for a sync operation to
419 @Input psConnection Services connection
420 @Input hEvent Event to wait on or NULL not to use event
421 objects but OS wait for a short time.
422 @Input psOpCookie Sync operation cookie to test
424 @Return PVRSRV_OK When condition met
425 PVRSRV_ERROR_TIMEOUT When condition not met and time is up
426 PVRSRV_* Otherwise, some other error code
427 */ /**************************************************************************/
429 PVRSRV_ERROR IMG_CALLCONV PVRSRVWaitUntilSyncPrimOpReady(
430 const PVRSRV_CONNECTION* psConnection,
432 PSYNC_OP_COOKIE psOpCookie);
435 /******************************************************************************
436 * PDUMP Function prototypes...
437 *****************************************************************************/
439 /**************************************************************************/ /*!
440 @Function PVRSRVPDumpInit
441 @Description Pdump initialisation
442 @Input psConnection Services connection
443 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
445 */ /**************************************************************************/
447 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpInit(const PVRSRV_CONNECTION *psConnection);
449 /**************************************************************************/ /*!
450 @Function PVRSRVPDumpStartInitPhase
451 @Description Resume the pdump init phase state
452 @Input psConnection Services connection
453 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
455 */ /**************************************************************************/
457 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStartInitPhase(const PVRSRV_CONNECTION *psConnection);
459 /**************************************************************************/ /*!
460 @Function PVRSRVPDumpStopInitPhase
461 @Description Stop the pdump init phase state
462 @Input psConnection Services connection
463 @Input eModuleID Which module is requesting to stop the init phase
464 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
466 */ /**************************************************************************/
468 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStopInitPhase(const PVRSRV_CONNECTION *psConnection,
469 IMG_MODULE_ID eModuleID);
471 /**************************************************************************/ /*!
472 @Function PVRSRVPDumpSetFrame
473 @Description Sets the pdump frame
474 @Input psConnection Services connection
475 @Input ui32Frame frame id
476 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
478 */ /**************************************************************************/
480 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSetFrame(const PVRSRV_CONNECTION *psConnection,
481 IMG_UINT32 ui32Frame);
483 /**************************************************************************/ /*!
484 @Function PVRSRVPDumpGetFrame
485 @Description Gets the current pdump frame
486 @Input psConnection Services connection
487 @Output pui32Frame frame id
488 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_error code
489 */ /**************************************************************************/
491 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpGetFrame(const PVRSRV_CONNECTION *psConnection,
492 IMG_UINT32 *pui32Frame);
494 /**************************************************************************/ /*!
495 @Function PVRSRVPDumpIsLastCaptureFrame
496 @Description Returns whether this is the last frame of the capture range
497 @Input psConnection Services connection
498 @Return IMG_TRUE if last frame,
500 */ /**************************************************************************/
502 IMG_BOOL IMG_CALLCONV PVRSRVPDumpIsLastCaptureFrame(const PVRSRV_CONNECTION *psConnection);
504 /**************************************************************************/ /*!
505 @Function PVRSRVPDumpAfterRender
506 @Description Executes TraceBuffer and SignatureBuffer commands
507 @Input psDevData Device data
508 */ /**************************************************************************/
510 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpAfterRender(PVRSRV_DEV_DATA *psDevData);
512 /**************************************************************************/ /*!
513 @Function PVRSRVPDumpComment
514 @Description PDumps a comment
515 @Input psConnection Services connection
516 @Input pszComment Comment to be inserted
517 @Input bContinuous pdump contiunous boolean
518 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
520 */ /**************************************************************************/
522 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpComment(const PVRSRV_CONNECTION *psConnection,
523 const IMG_CHAR *pszComment,
524 IMG_BOOL bContinuous);
526 /**************************************************************************/ /*!
527 @Function PVRSRVPDumpCommentf
528 @Description PDumps a formatted comment
529 @Input psConnection Services connection
530 @Input bContinuous pdump continuous boolean
531 @Input pszFormat Format string
532 @Input ... vararg list
533 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
535 */ /**************************************************************************/
537 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentf(const PVRSRV_CONNECTION *psConnection,
538 IMG_BOOL bContinuous,
539 const IMG_CHAR *pszFormat, ...)
540 IMG_FORMAT_PRINTF(3, 4);
542 /**************************************************************************/ /*!
543 @Function PVRSRVPDumpCommentWithFlagsf
544 @Description PDumps a formatted comment, passing in flags
545 @Input psConnection Services connection
546 @Input ui32Flags Flags
547 @Input pszFormat Format string
548 @Input ... vararg list
549 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
551 */ /**************************************************************************/
553 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentWithFlagsf(const PVRSRV_CONNECTION *psConnection,
554 IMG_UINT32 ui32Flags,
555 const IMG_CHAR *pszFormat, ...)
556 IMG_FORMAT_PRINTF(3, 4);
559 /**************************************************************************/ /*!
560 @Function PVRSRVPDumpIsCapturing
561 @Description Reports whether PDump is currently capturing or not
562 @Input psConnection Services connection
563 @Output pbIsCapturing Indicates whether PDump is currently
565 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
567 */ /**************************************************************************/
569 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpIsCapturing(const PVRSRV_CONNECTION *psConnection,
570 IMG_BOOL *pbIsCapturing);
573 /**************************************************************************/ /*!
574 @Function PVRSRVPDumpIsCapturingTest
575 @Description checks whether pdump is currently in frame capture range
576 @Input psConnection Services connection
578 */ /**************************************************************************/
580 IMG_BOOL IMG_CALLCONV PVRSRVPDumpIsCapturingTest(const PVRSRV_CONNECTION *psConnection);
583 PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSetDefaultCaptureParams(const PVRSRV_CONNECTION *psConnection,
585 IMG_UINT32 ui32Start,
587 IMG_UINT32 ui32Interval,
588 IMG_UINT32 ui32MaxParamFileSize);
592 #ifdef INLINE_IS_PRAGMA
593 #pragma inline(PVRSRVPDumpInit)
595 static INLINE PVRSRV_ERROR
596 PVRSRVPDumpInit(const PVRSRV_CONNECTION *psConnection)
598 PVR_UNREFERENCED_PARAMETER(psConnection);
602 #ifdef INLINE_IS_PRAGMA
603 #pragma inline(PVRSRVPDumpStartInitPhase)
605 static INLINE PVRSRV_ERROR
606 PVRSRVPDumpStartInitPhase(const PVRSRV_CONNECTION *psConnection)
608 PVR_UNREFERENCED_PARAMETER(psConnection);
612 #ifdef INLINE_IS_PRAGMA
613 #pragma inline(PVRSRVPDumpStopInitPhase)
615 static INLINE PVRSRV_ERROR
616 PVRSRVPDumpStopInitPhase(const PVRSRV_CONNECTION *psConnection)
618 PVR_UNREFERENCED_PARAMETER(psConnection);
622 #ifdef INLINE_IS_PRAGMA
623 #pragma inline(PVRSRVPDumpSetFrame)
625 static INLINE PVRSRV_ERROR
626 PVRSRVPDumpSetFrame(const PVRSRV_CONNECTION *psConnection,
627 IMG_UINT32 ui32Frame)
629 PVR_UNREFERENCED_PARAMETER(psConnection);
630 PVR_UNREFERENCED_PARAMETER(ui32Frame);
634 #ifdef INLINE_IS_PRAGMA
635 #pragma inline(PVRSRVPDumpGetFrame)
637 static INLINE PVRSRV_ERROR
638 PVRSRVPDumpGetFrame(const PVRSRV_CONNECTION *psConnection,
639 IMG_UINT32 *pui32Frame)
641 PVR_UNREFERENCED_PARAMETER(psConnection);
642 PVR_UNREFERENCED_PARAMETER(pui32Frame);
647 #ifdef INLINE_IS_PRAGMA
648 #pragma inline(PVRSRVPDumpIsLastCaptureFrame)
650 static INLINE IMG_BOOL
651 PVRSRVPDumpIsLastCaptureFrame(const PVRSRV_CONNECTION *psConnection)
653 PVR_UNREFERENCED_PARAMETER(psConnection);
657 #ifdef INLINE_IS_PRAGMA
658 #pragma inline(PVRSRVPDumpAfterRender)
660 static INLINE PVRSRV_ERROR
661 PVRSRVPDumpAfterRender(PVRSRV_DEV_DATA *psDevData)
663 PVR_UNREFERENCED_PARAMETER(psDevData);
667 #ifdef INLINE_IS_PRAGMA
668 #pragma inline(PVRSRVPDumpComment)
670 static INLINE PVRSRV_ERROR
671 PVRSRVPDumpComment(const PVRSRV_CONNECTION *psConnection,
672 const IMG_CHAR *pszComment,
673 IMG_BOOL bContinuous)
675 PVR_UNREFERENCED_PARAMETER(psConnection);
676 PVR_UNREFERENCED_PARAMETER(pszComment);
677 PVR_UNREFERENCED_PARAMETER(bContinuous);
681 #ifdef INLINE_IS_PRAGMA
682 #pragma inline(PVRSRVPDumpCommentf)
684 static INLINE PVRSRV_ERROR
685 PVRSRVPDumpCommentf(const PVRSRV_CONNECTION *psConnection,
686 IMG_BOOL bContinuous,
687 const IMG_CHAR *pszFormat, ...)
689 PVR_UNREFERENCED_PARAMETER(psConnection);
690 PVR_UNREFERENCED_PARAMETER(bContinuous);
691 PVR_UNREFERENCED_PARAMETER(pszFormat);
695 #ifdef INLINE_IS_PRAGMA
696 #pragma inline(PVRSRVPDumpCommentWithFlagsf)
698 static INLINE PVRSRV_ERROR
699 PVRSRVPDumpCommentWithFlagsf(const PVRSRV_CONNECTION *psConnection,
700 IMG_UINT32 ui32Flags,
701 const IMG_CHAR *pszFormat, ...)
703 PVR_UNREFERENCED_PARAMETER(psConnection);
704 PVR_UNREFERENCED_PARAMETER(ui32Flags);
705 PVR_UNREFERENCED_PARAMETER(pszFormat);
710 #ifdef INLINE_IS_PRAGMA
711 #pragma inline(PVRSRVPDumpIsCapturing)
713 static INLINE PVRSRV_ERROR
714 PVRSRVPDumpIsCapturing(const PVRSRV_CONNECTION *psConnection,
715 IMG_BOOL *pbIsCapturing)
717 PVR_UNREFERENCED_PARAMETER(psConnection);
718 *pbIsCapturing = IMG_FALSE;
722 #ifdef INLINE_IS_PRAGMA
723 #pragma inline(PVRSRVPDumpIsCapturingTest)
725 static INLINE IMG_BOOL
726 PVRSRVPDumpIsCapturingTest(const PVRSRV_CONNECTION *psConnection)
728 PVR_UNREFERENCED_PARAMETER(psConnection);
732 #ifdef INLINE_IS_PRAGMA
733 #pragma inline(PDumpSetPidCapRange)
735 static INLINE PVRSRV_ERROR
736 PVRSRVPDumpSetDefaultCaptureParams(const PVRSRV_CONNECTION *psConnection,
738 IMG_UINT32 ui32Start,
740 IMG_UINT32 ui32Interval,
741 IMG_UINT32 ui32MaxParamFileSize)
743 PVR_UNREFERENCED_PARAMETER(psConnection);
744 PVR_UNREFERENCED_PARAMETER(ui32Mode);
745 PVR_UNREFERENCED_PARAMETER(ui32Start);
746 PVR_UNREFERENCED_PARAMETER(ui32End);
747 PVR_UNREFERENCED_PARAMETER(ui32Interval);
748 PVR_UNREFERENCED_PARAMETER(ui32MaxParamFileSize);
756 /**************************************************************************/ /*!
757 @Function PVRSRVLoadLibrary
758 @Description Load the named Dynamic-Link (Shared) Library. This will perform
759 reference counting in association with PVRSRVUnloadLibrary,
760 so for example if the same library is loaded twice and unloaded once,
761 a reference to the library will remain.
762 @Input pszLibraryName the name of the library to load
763 @Return On success, the handle of the newly-loaded
764 library. Otherwise, zero.
765 */ /**************************************************************************/
766 IMG_IMPORT IMG_HANDLE PVRSRVLoadLibrary(const IMG_CHAR *pszLibraryName);
768 /**************************************************************************/ /*!
769 @Function PVRSRVUnloadLibrary
770 @Description Unload the Dynamic-Link (Shared) Library which had previously been
771 loaded using PVRSRVLoadLibrary(). See PVRSRVLoadLibrary() for
772 information regarding reference counting.
773 @Input hExtDrv handle of the Dynamic-Link / Shared library
774 to unload, as returned by PVRSRVLoadLibrary().
775 @Return PVRSRV_OK if successful. Otherwise,
776 PVRSRV_ERROR_UNLOAD_LIBRARY_FAILED.
777 */ /**************************************************************************/
778 IMG_IMPORT PVRSRV_ERROR PVRSRVUnloadLibrary(IMG_HANDLE hExtDrv);
780 /**************************************************************************/ /*!
781 @Function PVRSRVGetLibFuncAddr
782 @Description Returns the address of a function in a Dynamic-Link / Shared
784 @Input hExtDrv handle of the Dynamic-Link / Shared Library
785 in which the function resides
786 @Input pszFunctionName the name of the function
787 @Output ppvFuncAddr on success, the address of the function
788 requested. Otherwise, NULL.
789 @Return PVRSRV_OK if successful. Otherwise,
790 PVRSRV_ERROR_UNABLE_TO_GET_FUNC_ADDR.
791 */ /**************************************************************************/
792 IMG_IMPORT PVRSRV_ERROR PVRSRVGetLibFuncAddr(IMG_HANDLE hExtDrv,
793 const IMG_CHAR *pszFunctionName,
794 IMG_VOID **ppvFuncAddr);
796 /**************************************************************************/ /*!
797 @Function PVRSRVClockus
798 @Description Returns the current system clock time, in microseconds. Note
799 that this does not necessarily guarantee microsecond accuracy.
800 @Return the curent system clock time, in
802 */ /**************************************************************************/
803 IMG_IMPORT IMG_UINT32 PVRSRVClockus (void);
805 /**************************************************************************/ /*!
806 @Function PVRSRVWaitus
807 @Description Waits for the specified number of microseconds
808 @Input ui32Timeus the time to wait for, in microseconds
810 */ /**************************************************************************/
811 IMG_IMPORT IMG_VOID PVRSRVWaitus (IMG_UINT32 ui32Timeus);
813 /**************************************************************************/ /*!
814 @Function PVRSRVReleaseThreadQuanta
815 @Description Releases thread quanta
817 */ /**************************************************************************/
818 IMG_IMPORT IMG_VOID PVRSRVReleaseThreadQuanta (void);
820 /**************************************************************************/ /*!
821 @Function PVRSRVGetCurrentProcessID
822 @Description Returns handle for current process
823 @Return ID of current process
824 */ /**************************************************************************/
825 IMG_IMPORT IMG_PID IMG_CALLCONV PVRSRVGetCurrentProcessID(void);
827 /**************************************************************************/ /*!
828 @Function PVRSRVSetLocale
829 @Description Thin wrapper on posix setlocale
831 @Return IMG_NULL (currently)
832 */ /**************************************************************************/
833 IMG_IMPORT IMG_CHAR * IMG_CALLCONV PVRSRVSetLocale(const IMG_CHAR *pszLocale);
836 /**************************************************************************/ /*!
837 @Function PVRSRVCreateAppHintState
838 @Description Create app hint state
839 @Input eModuleID module id
840 @Input pszAppName app name
841 @Output ppvState state
843 */ /**************************************************************************/
844 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVCreateAppHintState(IMG_MODULE_ID eModuleID,
845 const IMG_CHAR *pszAppName,
846 IMG_VOID **ppvState);
847 /**************************************************************************/ /*!
848 @Function PVRSRVFreeAppHintState
849 @Description Free the app hint state, if it was created
850 @Input eModuleID module id
851 @Input pvHintState app hint state
853 */ /**************************************************************************/
854 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeAppHintState(IMG_MODULE_ID eModuleID,
855 IMG_VOID *pvHintState);
857 /**************************************************************************/ /*!
858 @Function PVRSRVGetAppHint
859 @Description Return the value of this hint from state or use default
860 @Input pvHintState hint state
861 @Input pszHintName hint name
862 @Input eDataType data type
863 @Input pvDefault default value
864 @Output pvReturn hint value
865 @Return True if hint read, False if used default
866 */ /**************************************************************************/
867 IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetAppHint(IMG_VOID *pvHintState,
868 const IMG_CHAR *pszHintName,
869 IMG_DATA_TYPE eDataType,
870 const IMG_VOID *pvDefault,
873 /******************************************************************************
875 *****************************************************************************/
878 /**************************************************************************/ /*!
879 @Function PVRSRVAllocUserModeMem
880 @Description Allocate a block of user-mode memory
881 @Input ui32Size the amount of memory to allocate
882 @Return On success, a pointer to the memory allocated.
884 */ /**************************************************************************/
885 IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMem (IMG_SIZE_T ui32Size);
887 /**************************************************************************/ /*!
888 @Function PVRSRVCallocUserModeMem
889 @Description Allocate a block of user-mode memory
890 @Input ui32Size the amount of memory to allocate
891 @Return On success, a pointer to the memory allocated.
893 */ /**************************************************************************/
894 IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMem (IMG_SIZE_T ui32Size);
896 /**************************************************************************/ /*!
897 @Function PVRSRVReallocUserModeMem
898 @Description Re-allocate a block of memory
899 @Input pvBase the address of the existing memory, previously
900 allocated with PVRSRVAllocUserModeMem
901 @Input uNewSize the newly-desired size of the memory chunk
902 @Return On success, a pointer to the memory block. If the
903 size of the block could not be changed, the
904 return value is NULL.
905 */ /**************************************************************************/
906 IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMem (IMG_PVOID pvBase, IMG_SIZE_T uNewSize);
907 /**************************************************************************/ /*!
908 @Function PVRSRVFreeUserModeMem
909 @Description Free a block of memory previously allocated with
910 PVRSRVAllocUserModeMem
911 @Input pvMem pointer to the block of memory to be freed
913 */ /**************************************************************************/
914 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMem (IMG_PVOID pvMem);
916 /**************************************************************************/ /*!
917 @Function PVRSRVMemCopy
918 @Description Copy a block of memory
919 Safe implementation of memset for use with device memory.
920 @Input pvDst Pointer to the destination
921 @Input pvSrc Pointer to the source location
922 @Input uiSize The amount of memory to copy in bytes
924 */ /**************************************************************************/
925 IMG_IMPORT IMG_VOID PVRSRVMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T uiSize);
927 /**************************************************************************/ /*!
928 @Function PVRSRVMemSet
929 @Description Set all bytes in a region of memory to the specified value.
930 Safe implementation of memset for use with device memory.
931 @Input pvDest Pointer to the start of the memory region
932 @Input ui8Value The value to be written
933 @Input uiSize The number of bytes to be set to ui8Value
935 */ /**************************************************************************/
936 IMG_IMPORT IMG_VOID PVRSRVMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T uiSize);
938 /**************************************************************************/ /*!
939 @Function PVRSRVLockProcessGlobalMutex
940 @Description Locking function for non-recursive coarse-grained mutex shared
941 between all threads in a proccess.
943 */ /**************************************************************************/
944 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockProcessGlobalMutex(void);
946 /**************************************************************************/ /*!
947 @Function PVRSRVUnlockProcessGlobalMutex
948 @Description Unlocking function for non-recursive coarse-grained mutex shared
949 between all threads in a proccess.
951 */ /**************************************************************************/
952 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockProcessGlobalMutex(void);
955 typedef struct _OS_MUTEX_ *PVRSRV_MUTEX_HANDLE;
957 /**************************************************************************/ /*!
958 @Function PVRSRVCreateMutex
959 @Description creates a mutex
960 @Output phMutex ptr to mutex handle
961 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
963 */ /**************************************************************************/
964 #if !defined(PVR_DEBUG_MUTEXES)
965 IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex);
967 IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex,
968 IMG_CHAR pszMutexName[],
969 IMG_CHAR pszFilename[],
971 #define PVRSRVCreateMutex(phMutex) \
972 PVRSRVCreateMutex(phMutex, #phMutex, __FILE__, __LINE__)
975 /**************************************************************************/ /*!
976 @Function PVRSRVDestroyMutex
977 @Description Create a mutex.
978 @Input hMutex On success, filled with the new Mutex
979 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
981 */ /**********************************************************************/
982 #if !defined(PVR_DEBUG_MUTEXES)
983 IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex);
985 IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex,
986 IMG_CHAR pszMutexName[],
987 IMG_CHAR pszFilename[],
989 #define PVRSRVDestroyMutex(hMutex) \
990 PVRSRVDestroyMutex(hMutex, #hMutex, __FILE__, __LINE__)
993 /**************************************************************************/ /*!
994 @Function PVRSRVLockMutex
995 @Description Lock the mutex passed
996 @Input hMutex handle of the mutex to be locked
998 */ /**********************************************************************/
999 #if !defined(PVR_DEBUG_MUTEXES)
1000 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex);
1002 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex,
1003 IMG_CHAR pszMutexName[],
1004 IMG_CHAR pszFilename[],
1006 #define PVRSRVLockMutex(hMutex) \
1007 PVRSRVLockMutex(hMutex, #hMutex, __FILE__, __LINE__)
1010 /**************************************************************************/ /*!
1011 @Function PVRSRVUnlockMutex
1012 @Description Unlock the mutex passed
1013 @Input hMutex handle of the mutex to be unlocked
1015 */ /**********************************************************************/
1016 #if !defined(PVR_DEBUG_MUTEXES)
1017 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex);
1019 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex,
1020 IMG_CHAR pszMutexName[],
1021 IMG_CHAR pszFilename[],
1023 #define PVRSRVUnlockMutex(hMutex) \
1024 PVRSRVUnlockMutex(hMutex, #hMutex, __FILE__, __LINE__)
1027 struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_;
1028 typedef struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_ *PVRSRV_SEMAPHORE_HANDLE; /*!< Convenience typedef */
1031 #if defined(_MSC_VER)
1033 Used when waiting for a semaphore to become unlocked. Indicates that
1034 the caller is willing to wait forever.
1036 #define IMG_SEMAPHORE_WAIT_INFINITE ((IMG_UINT64)0xFFFFFFFFFFFFFFFF)
1039 Used when waiting for a semaphore to become unlocked. Indicates that
1040 the caller is willing to wait forever.
1042 #define IMG_SEMAPHORE_WAIT_INFINITE ((IMG_UINT64)0xFFFFFFFFFFFFFFFFull)
1045 #ifdef INLINE_IS_PRAGMA
1046 #pragma inline(PVRSRVCreateSemaphore)
1048 /**************************************************************************/ /*!
1049 @Function PVRSRVCreateSemaphore
1050 @Description Create a semaphore with an initial count
1051 @Output phSemaphore on success, ptr to the handle of the new
1052 semaphore. Otherwise, zero.
1053 @Input iInitialCount initial count
1054 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
1056 */ /**************************************************************************/
1057 static INLINE PVRSRV_ERROR PVRSRVCreateSemaphore(PVRSRV_SEMAPHORE_HANDLE *phSemaphore,
1058 IMG_INT iInitialCount)
1060 PVR_UNREFERENCED_PARAMETER(iInitialCount);
1065 #ifdef INLINE_IS_PRAGMA
1066 #pragma inline(PVRSRVDestroySemaphore)
1068 /**************************************************************************/ /*!
1069 @Function PVRSRVDestroySemaphore
1070 @Description destroy the semaphore passed
1071 @Input hSemaphore the semaphore to be destroyed
1072 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
1074 */ /**************************************************************************/
1075 static INLINE PVRSRV_ERROR PVRSRVDestroySemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore)
1077 PVR_UNREFERENCED_PARAMETER(hSemaphore);
1081 #ifdef INLINE_IS_PRAGMA
1082 #pragma inline(PVRSRVWaitSemaphore)
1084 /**************************************************************************/ /*!
1085 @Function PVRSRVWaitSemaphore
1086 @Description wait on the specified semaphore
1087 @Input hSemaphore the semephore on which to wait
1088 @Input ui64TimeoutMicroSeconds the time to wait for the semaphore to
1089 become unlocked, if locked when the function
1091 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
1093 */ /**************************************************************************/
1094 static INLINE PVRSRV_ERROR PVRSRVWaitSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore,
1095 IMG_UINT64 ui64TimeoutMicroSeconds)
1097 PVR_UNREFERENCED_PARAMETER(hSemaphore);
1098 PVR_UNREFERENCED_PARAMETER(ui64TimeoutMicroSeconds);
1099 return PVRSRV_ERROR_INVALID_PARAMS;
1102 #ifdef INLINE_IS_PRAGMA
1103 #pragma inline(PVRSRVPostSemaphore)
1105 /**************************************************************************/ /*!
1106 @Function PVRSRVPostSemaphore
1107 @Description post semphore
1108 @Input hSemaphore handle to semaphore
1109 @Input iPostCount post count
1111 */ /**************************************************************************/
1112 static INLINE IMG_VOID PVRSRVPostSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, IMG_INT iPostCount)
1114 PVR_UNREFERENCED_PARAMETER(hSemaphore);
1115 PVR_UNREFERENCED_PARAMETER(iPostCount);
1118 /* Non-exported APIs */
1119 #if defined(DEBUG) && (defined(__linux__) || defined(_WIN32) || defined(__QNXNTO__))
1120 /**************************************************************************/ /*!
1121 @Function PVRSRVAllocUserModeMemTracking
1122 @Description Wrapper function for malloc, used for memory-leak detection
1123 @Input ui32Size number of bytes to be allocated
1124 @Input pszFileName filename of the calling code
1125 @Input ui32LineNumber line number of the calling code
1126 @Return On success, a ptr to the newly-allocated
1127 memory. Otherwise, NULL.
1128 */ /**************************************************************************/
1129 IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMemTracking(IMG_SIZE_T ui32Size,
1130 IMG_CHAR *pszFileName,
1131 IMG_UINT32 ui32LineNumber);
1133 /**************************************************************************/ /*!
1134 @Function PVRSRVCallocUserModeMemTracking
1135 @Description Wrapper function for calloc, used for memory-leak detection
1136 @Input ui32Size number of bytes to be allocated
1137 @Input pszFileName filename of the calling code
1138 @Input ui32LineNumber line number of the calling code
1139 @Return On success, a ptr to the newly-allocated
1140 memory. Otherwise, NULL.
1141 */ /**************************************************************************/
1142 IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMemTracking(IMG_SIZE_T ui32Size,
1143 IMG_CHAR *pszFileName,
1144 IMG_UINT32 ui32LineNumber);
1146 /**************************************************************************/ /*!
1147 @Function PVRSRVFreeUserModeMemTracking
1148 @Description Wrapper for free - see PVRSRVAllocUserModeMemTracking
1149 @Input pvMem pointer to the memory to be freed
1151 */ /**************************************************************************/
1152 IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem);
1154 /**************************************************************************/ /*!
1155 @Function PVRSRVReallocUserModeMemTracking
1156 @Description Wrapper for realloc, used in memory-leak detection
1157 @Input pvMem pointer to the existing memory block
1158 @Input ui32NewSize the desired new size of the block
1159 @Input pszFileName the filename of the calling code
1160 @Input ui32LineNumber the line number of the calling code
1161 @Return on success, a pointer to the memory block.
1162 This may not necessarily be the same
1163 location as the block was at before the
1164 call. On failure, NULL is returned.
1165 */ /**************************************************************************/
1166 IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem,
1167 IMG_SIZE_T ui32NewSize,
1168 IMG_CHAR *pszFileName,
1169 IMG_UINT32 ui32LineNumber);
1170 #endif /* defined(DEBUG) && (defined(__linux__) || defined(_WIN32)) */
1172 /**************************************************************************/ /*!
1173 @Function PVRSRVDumpDebugInfo
1174 @Description Dump debug information to kernel log
1175 @Input psConnection Services connection
1177 */ /**************************************************************************/
1179 PVRSRVDumpDebugInfo(const PVRSRV_CONNECTION *psConnection, IMG_UINT32 ui32VerbLevel);
1181 /**************************************************************************/ /*!
1182 @Function PVRSRVGetDevClockSpeed
1183 @Description Gets the RGX clock speed
1184 @Input psConnection Services connection
1185 @Input psDevData Pointer to the PVRSRV_DEV_DATA context
1186 @Output pui32RGXClockSpeed Variable for storing clock speed
1187 @Return IMG_BOOL True if the operation was successful
1188 */ /**************************************************************************/
1189 IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetDevClockSpeed(const PVRSRV_CONNECTION *psConnection,
1190 PVRSRV_DEV_DATA *psDevData,
1191 IMG_PUINT32 pui32RGXClockSpeed);
1193 /**************************************************************************/ /*!
1194 @Function PVRSRVResetHWRLogs
1195 @Description Resets the HWR Logs buffer (the hardware recovery count is not reset)
1196 @Input psConnection Services connection
1197 @Input psDevData Pointer to the PVRSRV_DEV_DATA context
1198 @Return PVRSRV_ERROR PVRSRV_OK on success. Otherwise, a PVRSRV_
1200 */ /**************************************************************************/
1201 IMG_IMPORT PVRSRV_ERROR
1202 PVRSRVResetHWRLogs(const PVRSRV_CONNECTION *psConnection, PVRSRV_DEV_DATA *psDevData);
1204 /******************************************************************************
1205 * PVR Event Object API(s)
1206 *****************************************************************************/
1208 /*****************************************************************************
1209 @Function PVRSRVAcquireGlobalEventObject
1210 @Description Gets a handle to an event
1211 Outputs : phOSEvent Global eventobject event
1213 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
1216 ******************************************************************************/
1217 IMG_IMPORT PVRSRV_ERROR
1218 PVRSRVAcquireGlobalEventObject(const PVRSRV_CONNECTION *psConnection,
1219 IMG_HANDLE *phOSEvent);
1221 /*****************************************************************************
1222 Function Name : PVRSRVReleaseGlobalEventObject
1223 Inputs : phOSEvent Global eventobject event
1225 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
1228 ******************************************************************************/
1229 IMG_IMPORT PVRSRV_ERROR
1230 PVRSRVReleaseGlobalEventObject(const PVRSRV_CONNECTION *psConnection,
1231 IMG_HANDLE hOSEvent);
1233 /**************************************************************************/ /*!
1234 @Function PVRSRVEventObjectWait
1235 @Description Wait (block) on the OS-specific event object passed
1236 @Input psConnection Services connection
1237 @Input hOSEvent the event object to wait on
1238 @Return PVRSRV_OK on success. Otherwise, a PVRSRV_
1240 */ /**************************************************************************/
1241 IMG_IMPORT PVRSRV_ERROR
1242 PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection,
1243 IMG_HANDLE hOSEvent);
1246 IMG_IMPORT PVRSRV_ERROR
1247 PVRSRVKickDevices(const PVRSRV_CONNECTION *psConnection);
1250 /**************************************************************************/ /*!
1251 @Function RGXSoftReset
1252 @Description Resets some modules of the RGX device
1253 @Input psConnection Services connection
1254 @Input psDevData Pointer to the PVRSRV_DEV_DATA context
1255 @Output ui64ResetValue a mask for which each bit set correspond
1256 to a module to reset.
1257 @Return PVRSRV_ERROR
1258 */ /***************************************************************************/
1259 IMG_IMPORT PVRSRV_ERROR
1260 PVRSRVSoftReset(const PVRSRV_CONNECTION *psConnection,
1261 PVRSRV_DEV_DATA *psDevData,
1262 IMG_UINT64 ui64ResetValue);
1267 #define TIME_NOT_PASSED_UINT32(a,b,c) (((a) - (b)) < (c))
1270 #if defined (__cplusplus)
1273 #endif /* __SERVICES_H__ */
1275 /******************************************************************************
1276 End of file (services.h)
1277 ******************************************************************************/