gpu: pvr: pdumpfs: add Kconfig and debugfs pdump mode handling
[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 #define UPDATE_QUEUE_ROFF(psQueue, ui32Size)                            \
31         psQueue->ui32ReadOffset = (psQueue->ui32ReadOffset + ui32Size)  \
32                                         & (psQueue->ui32QueueSize - 1);
33
34 struct COMMAND_COMPLETE_DATA {
35         IMG_BOOL bInUse;
36
37         u32 ui32DstSyncCount;
38         u32 ui32SrcSyncCount;
39         struct PVRSRV_SYNC_OBJECT *psDstSync;
40         struct PVRSRV_SYNC_OBJECT *psSrcSync;
41         u32 ui32AllocSize;
42 };
43
44 enum PVRSRV_ERROR PVRSRVProcessQueues(IMG_BOOL bFlush);
45
46 #if defined(__KERNEL__)
47 #include <linux/types.h>
48 off_t QueuePrintQueues(char *buffer, size_t size, off_t off);
49 #endif
50
51 enum PVRSRV_ERROR PVRSRVCreateCommandQueueKM(u32 ui32QueueSize,
52                 struct PVRSRV_QUEUE_INFO **ppsQueueInfo);
53 enum PVRSRV_ERROR PVRSRVDestroyCommandQueueKM(
54                 struct PVRSRV_QUEUE_INFO *psQueueInfo);
55
56 enum PVRSRV_ERROR PVRSRVInsertCommandKM(struct PVRSRV_QUEUE_INFO *psQueue,
57                 struct PVRSRV_COMMAND **ppsCommand, u32 ui32DevIndex,
58                 u16 CommandType, u32 ui32DstSyncCount,
59                 struct PVRSRV_KERNEL_SYNC_INFO *apsDstSync[],
60                 u32 ui32SrcSyncCount,
61                 struct PVRSRV_KERNEL_SYNC_INFO *apsSrcSync[],
62                 u32 ui32DataByteSize);
63
64 enum PVRSRV_ERROR PVRSRVGetQueueSpaceKM(struct PVRSRV_QUEUE_INFO *psQueue,
65                 u32 ui32ParamSize, void **ppvSpace);
66
67 enum PVRSRV_ERROR PVRSRVSubmitCommandKM(struct PVRSRV_QUEUE_INFO *psQueue,
68                 struct PVRSRV_COMMAND *psCommand);
69
70 void PVRSRVCommandCompleteKM(void *hCmdCookie, IMG_BOOL bScheduleMISR);
71
72 void PVRSRVCommandCompleteCallbacks(void);
73
74 enum PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(u32 ui32DevIndex,
75                 IMG_BOOL (**ppfnCmdProcList)(void *, u32, void *),
76                 u32 ui32MaxSyncsPerCmd[][2], u32 ui32CmdCount);
77 enum PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(u32 ui32DevIndex,
78                 u32 ui32CmdCount);
79
80
81 #endif