1 /**********************************************************************
2 Copyright (c) Imagination Technologies Ltd.
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 ******************************************************************************/
27 #if defined(__cplusplus)
31 #define UPDATE_QUEUE_ROFF(psQueue, ui32Size) \
32 psQueue->ui32ReadOffset = (psQueue->ui32ReadOffset + ui32Size) \
33 & (psQueue->ui32QueueSize - 1);
35 typedef struct _COMMAND_COMPLETE_DATA_
39 IMG_UINT32 ui32DstSyncCount;
40 IMG_UINT32 ui32SrcSyncCount;
41 PVRSRV_SYNC_OBJECT *psDstSync;
42 PVRSRV_SYNC_OBJECT *psSrcSync;
43 IMG_UINT32 ui32AllocSize;
44 }COMMAND_COMPLETE_DATA, *PCOMMAND_COMPLETE_DATA;
46 #if !defined(USE_CODE)
47 IMG_VOID QueueDumpDebugInfo(IMG_VOID);
50 PVRSRV_ERROR PVRSRVProcessQueues (IMG_UINT32 ui32CallerID,
53 #if defined(__linux__) && defined(__KERNEL__)
54 #include <linux/types.h>
55 #include <linux/seq_file.h>
57 QueuePrintQueues (IMG_CHAR * buffer, size_t size, off_t off);
59 #ifdef PVR_PROC_USE_SEQ_FILE
60 void* ProcSeqOff2ElementQueue(struct seq_file * sfile, loff_t off);
61 void ProcSeqShowQueue(struct seq_file *sfile,void* el);
68 PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
69 PVRSRV_QUEUE_INFO **ppsQueueInfo);
71 PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueueInfo);
74 PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO *psQueue,
75 PVRSRV_COMMAND **ppsCommand,
76 IMG_UINT32 ui32DevIndex,
77 IMG_UINT16 CommandType,
78 IMG_UINT32 ui32DstSyncCount,
79 PVRSRV_KERNEL_SYNC_INFO *apsDstSync[],
80 IMG_UINT32 ui32SrcSyncCount,
81 PVRSRV_KERNEL_SYNC_INFO *apsSrcSync[],
82 IMG_SIZE_T ui32DataByteSize );
85 PVRSRV_ERROR IMG_CALLCONV PVRSRVGetQueueSpaceKM(PVRSRV_QUEUE_INFO *psQueue,
86 IMG_SIZE_T ui32ParamSize,
90 PVRSRV_ERROR IMG_CALLCONV PVRSRVSubmitCommandKM(PVRSRV_QUEUE_INFO *psQueue,
91 PVRSRV_COMMAND *psCommand);
94 IMG_VOID PVRSRVCommandCompleteKM(IMG_HANDLE hCmdCookie, IMG_BOOL bScheduleMISR);
96 IMG_VOID PVRSRVCommandCompleteCallbacks(IMG_VOID);
99 PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32 ui32DevIndex,
100 PFN_CMD_PROC *ppfnCmdProcList,
101 IMG_UINT32 ui32MaxSyncsPerCmd[][2],
102 IMG_UINT32 ui32CmdCount);
104 PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32 ui32DevIndex,
105 IMG_UINT32 ui32CmdCount);
110 #if defined (__cplusplus)