]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/device-ti-proprietary-open.git/blob - omap5/sgx_src/eurasia_km/services4/srvkm/include/queue.h
SGX-BIN: DDK update for OMAP5 1.9IMG2166536_TI.0003
[android-sdk/device-ti-proprietary-open.git] / omap5 / sgx_src / eurasia_km / services4 / srvkm / include / queue.h
1 /*************************************************************************/ /*!
2 @Title          Command Queue API
3 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4 @Description    Internal structures and definitions for command queues
5 @License        Dual MIT/GPLv2
7 The contents of this file are subject to the MIT license as set out below.
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
19 Alternatively, the contents of this file may be used under the terms of
20 the GNU General Public License Version 2 ("GPL") in which case the provisions
21 of GPL are applicable instead of those above.
23 If you wish to allow use of your version of this file only under the terms of
24 GPL, and not to allow others to use your version of this file under the terms
25 of the MIT license, indicate your decision by deleting the provisions above
26 and replace them with the notice and other provisions required by GPL as set
27 out in the file called "GPL-COPYING" included in this distribution. If you do
28 not delete the provisions above, a recipient may use your version of this file
29 under the terms of either the MIT license or GPL.
31 This License is also included in this distribution in the file called
32 "MIT-COPYING".
34 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 */ /**************************************************************************/
43 #ifndef QUEUE_H
44 #define QUEUE_H
47 #if defined(__cplusplus)
48 extern "C" {
49 #endif
51 /*!
52  * Macro to Read Offset in given command queue
53  */
54 #define UPDATE_QUEUE_ROFF(psQueue, ui32Size)                                            \
55         (psQueue)->ui32ReadOffset = ((psQueue)->ui32ReadOffset + (ui32Size))    \
56         & ((psQueue)->ui32QueueSize - 1);
58 /*!
59         generic cmd complete structure.
60         This structure represents the storage required between starting and finishing
61         a given cmd and is required to hold the generic sync object update data.
62         note: for any given system we know what command types we support and
63         therefore how much storage is required for any number of commands in progress
64  */
65  typedef struct _COMMAND_COMPLETE_DATA_
66  {
67         IMG_BOOL                        bInUse;
68         /* <arg(s) to PVRSRVProcessQueues>;     */      /*!< TBD */
69         IMG_UINT32                      ui32DstSyncCount;       /*!< number of dst sync objects */
70         IMG_UINT32                      ui32SrcSyncCount;       /*!< number of src sync objects */
71         PVRSRV_SYNC_OBJECT      *psDstSync;                     /*!< dst sync ptr list, 
72                                                 allocated on back of this structure */
73         PVRSRV_SYNC_OBJECT      *psSrcSync;                     /*!< src sync ptr list, 
74                                                 allocated on back of this structure */
75         IMG_UINT32                      ui32AllocSize;          /*!< allocated size*/
76         PFN_QUEUE_COMMAND_COMPLETE      pfnCommandComplete;     /*!< Command complete callback */
77         IMG_HANDLE                                      hCallbackData;          /*!< Command complete callback data */
78  }COMMAND_COMPLETE_DATA, *PCOMMAND_COMPLETE_DATA;
80 #if !defined(USE_CODE)
81 IMG_VOID QueueDumpDebugInfo(IMG_VOID);
83 IMG_IMPORT
84 PVRSRV_ERROR PVRSRVProcessQueues (IMG_BOOL              bFlush);
86 #if defined(__linux__) && defined(__KERNEL__) 
87 #include <linux/types.h>
88 #include <linux/seq_file.h>
89 void* ProcSeqOff2ElementQueue(struct seq_file * sfile, loff_t off);
90 void ProcSeqShowQueue(struct seq_file *sfile,void* el);
91 #endif
94 IMG_IMPORT
95 PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
96                                                                                                          PVRSRV_QUEUE_INFO **ppsQueueInfo);
97 IMG_IMPORT
98 PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueueInfo);
100 IMG_IMPORT
101 PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO       *psQueue,
102                                                                                                 PVRSRV_COMMAND          **ppsCommand,
103                                                                                                 IMG_UINT32                      ui32DevIndex,
104                                                                                                 IMG_UINT16                      CommandType,
105                                                                                                 IMG_UINT32                      ui32DstSyncCount,
106                                                                                                 PVRSRV_KERNEL_SYNC_INFO *apsDstSync[],
107                                                                                                 IMG_UINT32                      ui32SrcSyncCount,
108                                                                                                 PVRSRV_KERNEL_SYNC_INFO *apsSrcSync[],
109                                                                                                 IMG_SIZE_T                      ui32DataByteSize,
110                                                                                                 PFN_QUEUE_COMMAND_COMPLETE pfnCommandComplete,
111                                                                                                 IMG_HANDLE                      hCallbackData);
113 IMG_IMPORT
114 PVRSRV_ERROR IMG_CALLCONV PVRSRVGetQueueSpaceKM(PVRSRV_QUEUE_INFO *psQueue,
115                                                                                                 IMG_SIZE_T ui32ParamSize,
116                                                                                                 IMG_VOID **ppvSpace);
118 IMG_IMPORT
119 PVRSRV_ERROR IMG_CALLCONV PVRSRVSubmitCommandKM(PVRSRV_QUEUE_INFO *psQueue,
120                                                                                                 PVRSRV_COMMAND *psCommand);
122 IMG_IMPORT
123 IMG_VOID PVRSRVCommandCompleteKM(IMG_HANDLE hCmdCookie, IMG_BOOL bScheduleMISR);
125 IMG_IMPORT
126 PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32             ui32DevIndex,
127                                                                                  PFN_CMD_PROC   *ppfnCmdProcList,
128                                                                                  IMG_UINT32             ui32MaxSyncsPerCmd[][2],
129                                                                                  IMG_UINT32             ui32CmdCount);
130 IMG_IMPORT
131 PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32       ui32DevIndex,
132                                                                            IMG_UINT32   ui32CmdCount);
134 #endif /* !defined(USE_CODE) */
137 #if defined (__cplusplus)
139 #endif
141 #endif /* QUEUE_H */
143 /******************************************************************************
144  End of file (queue.h)
145 ******************************************************************************/