1.3.13.1607/3_00_00_08+flat+Lindent
[sgx.git] / pvr / queue.h
1 /**********************************************************************
2  *
3  * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
4  * 
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  * 
9  * This program is distributed in the hope it will be useful but, except 
10  * as otherwise stated in writing, without any warranty; without even the 
11  * implied warranty of merchantability or fitness for a particular purpose. 
12  * See the GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17  * 
18  * The full GNU General Public License is included in this distribution in
19  * the file called "COPYING".
20  *
21  * Contact Information:
22  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23  * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
24  *
25  ******************************************************************************/
26
27 #ifndef QUEUE_H
28 #define QUEUE_H
29
30 #if defined(__cplusplus)
31 extern "C" {
32 #endif
33
34 #define UPDATE_QUEUE_ROFF(psQueue, ui32Size)                                            \
35         psQueue->ui32ReadOffset = (psQueue->ui32ReadOffset + ui32Size)  \
36         & (psQueue->ui32QueueSize - 1);
37
38         typedef struct _COMMAND_COMPLETE_DATA_ {
39                 IMG_BOOL bInUse;
40
41                 IMG_UINT32 ui32DstSyncCount;
42                 IMG_UINT32 ui32SrcSyncCount;
43                 PVRSRV_SYNC_OBJECT *psDstSync;
44                 PVRSRV_SYNC_OBJECT *psSrcSync;
45         } COMMAND_COMPLETE_DATA, *PCOMMAND_COMPLETE_DATA;
46
47 #if !defined(USE_CODE)
48
49          IMG_IMPORT
50             PVRSRV_ERROR PVRSRVProcessQueues(IMG_UINT32 ui32CallerID,
51                                              IMG_BOOL bFlush);
52
53 #if defined(__linux__) && defined(__KERNEL__)
54 #include <linux/types.h>
55          off_t QueuePrintQueues(char *buffer, size_t size, off_t off);
56 #endif
57
58          IMG_IMPORT
59             PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_UINT32
60                                                                  ui32QueueSize,
61                                                                  PVRSRV_QUEUE_INFO
62                                                                  **
63                                                                  ppsQueueInfo);
64          IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV
65             PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO * psQueueInfo);
66
67          IMG_IMPORT
68             PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO *
69                                                             psQueue,
70                                                             PVRSRV_COMMAND **
71                                                             ppsCommand,
72                                                             IMG_UINT32
73                                                             ui32DevIndex,
74                                                             IMG_UINT16
75                                                             CommandType,
76                                                             IMG_UINT32
77                                                             ui32DstSyncCount,
78                                                             PVRSRV_KERNEL_SYNC_INFO
79                                                             * apsDstSync[],
80                                                             IMG_UINT32
81                                                             ui32SrcSyncCount,
82                                                             PVRSRV_KERNEL_SYNC_INFO
83                                                             * apsSrcSync[],
84                                                             IMG_UINT32
85                                                             ui32DataByteSize);
86
87          IMG_IMPORT
88             PVRSRV_ERROR IMG_CALLCONV PVRSRVGetQueueSpaceKM(PVRSRV_QUEUE_INFO *
89                                                             psQueue,
90                                                             IMG_UINT32
91                                                             ui32ParamSize,
92                                                             IMG_VOID **
93                                                             ppvSpace);
94
95          IMG_IMPORT
96             PVRSRV_ERROR IMG_CALLCONV PVRSRVSubmitCommandKM(PVRSRV_QUEUE_INFO *
97                                                             psQueue,
98                                                             PVRSRV_COMMAND *
99                                                             psCommand);
100
101          IMG_IMPORT
102             IMG_VOID PVRSRVCommandCompleteKM(IMG_HANDLE hCmdCookie,
103                                              IMG_BOOL bScheduleMISR);
104
105         IMG_VOID PVRSRVCommandCompleteCallbacks(IMG_VOID);
106
107          IMG_IMPORT
108             PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32 ui32DevIndex,
109                                                      PFN_CMD_PROC *
110                                                      ppfnCmdProcList,
111                                                      IMG_UINT32
112                                                      ui32MaxSyncsPerCmd[][2],
113                                                      IMG_UINT32 ui32CmdCount);
114          IMG_IMPORT PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32
115                                                            ui32DevIndex,
116                                                            IMG_UINT32
117                                                            ui32CmdCount);
118
119 #endif
120
121 #if defined (__cplusplus)
122 }
123 #endif
124 #endif