1 /**********************************************************************
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
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.
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.
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.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25 ******************************************************************************/
27 #ifndef __SERVICES_H__
28 #define __SERVICES_H__
32 #include "servicesext.h"
33 #include "pdumpdefs.h"
37 #define PVRSRV_4K_PAGE_SIZE 4096UL
39 #define PVRSRV_MAX_CMD_SIZE 1024
41 #define PVRSRV_MAX_DEVICES 16
43 #define EVENTOBJNAME_MAXLENGTH 50
45 #define PVRSRV_MEM_READ (1UL<<0)
46 #define PVRSRV_MEM_WRITE (1UL<<1)
47 #define PVRSRV_MEM_CACHE_CONSISTENT (1UL<<2)
48 #define PVRSRV_MEM_NO_SYNCOBJ (1UL<<3)
49 #define PVRSRV_MEM_INTERLEAVED (1UL<<4)
50 #define PVRSRV_MEM_DUMMY (1UL<<5)
51 #define PVRSRV_MEM_EDM_PROTECT (1UL<<6)
52 #define PVRSRV_MEM_ZERO (1UL<<7)
53 #define PVRSRV_MEM_USER_SUPPLIED_DEVVADDR (1UL<<8)
54 #define PVRSRV_MEM_RAM_BACKED_ALLOCATION (1UL<<9)
55 #define PVRSRV_MEM_NO_RESMAN (1UL<<10)
56 #define PVRSRV_MEM_EXPORTED (1UL<<11)
58 #define PVRSRV_HAP_CACHED (1UL<<12)
59 #define PVRSRV_HAP_UNCACHED (1UL<<13)
60 #define PVRSRV_HAP_WRITECOMBINE (1UL<<14)
61 #define PVRSRV_HAP_CACHETYPE_MASK (PVRSRV_HAP_CACHED | \
62 PVRSRV_HAP_UNCACHED | \
63 PVRSRV_HAP_WRITECOMBINE)
64 #define PVRSRV_HAP_KERNEL_ONLY (1UL<<15)
65 #define PVRSRV_HAP_SINGLE_PROCESS (1UL<<16)
66 #define PVRSRV_HAP_MULTI_PROCESS (1UL<<17)
67 #define PVRSRV_HAP_FROM_EXISTING_PROCESS (1UL<<18)
68 #define PVRSRV_HAP_NO_CPU_VIRTUAL (1UL<<19)
69 #define PVRSRV_HAP_MAPTYPE_MASK (PVRSRV_HAP_KERNEL_ONLY | \
70 PVRSRV_HAP_SINGLE_PROCESS | \
71 PVRSRV_HAP_MULTI_PROCESS | \
72 PVRSRV_HAP_FROM_EXISTING_PROCESS | \
73 PVRSRV_HAP_NO_CPU_VIRTUAL)
74 #define PVRSRV_MEM_BACKINGSTORE_FIELD_SHIFT 24
76 #define PVRSRV_MAP_NOUSERVIRTUAL (1UL << 27)
78 #define PVRSRV_NO_CONTEXT_LOSS 0
79 #define PVRSRV_SEVERE_LOSS_OF_CONTEXT 1
80 #define PVRSRV_PRE_STATE_CHANGE_MASK 0x80
82 #define PVRSRV_DEFAULT_DEV_COOKIE 1
84 #define PVRSRV_MISC_INFO_TIMER_PRESENT (1UL << 0)
85 #define PVRSRV_MISC_INFO_CLOCKGATE_PRESENT (1UL << 1)
86 #define PVRSRV_MISC_INFO_MEMSTATS_PRESENT (1UL << 2)
87 #define PVRSRV_MISC_INFO_GLOBALEVENTOBJECT_PRESENT (1UL << 3)
88 #define PVRSRV_MISC_INFO_DDKVERSION_PRESENT (1UL << 4)
90 #define PVRSRV_PDUMP_MAX_FILENAME_SIZE 20
91 #define PVRSRV_PDUMP_MAX_COMMENT_SIZE 200
93 #define PVRSRV_CHANGEDEVMEM_ATTRIBS_CACHECOHERENT 0x00000001
95 #define PVRSRV_MAPEXTMEMORY_FLAGS_ALTERNATEVA 0x00000001
96 #define PVRSRV_MAPEXTMEMORY_FLAGS_PHYSCONTIG 0x00000002
98 #define PVRSRV_MODIFYSYNCOPS_FLAGS_WOP_INC 0x00000001
99 #define PVRSRV_MODIFYSYNCOPS_FLAGS_ROP_INC 0x00000002
100 #define PVRSRV_MODIFYSYNCOPS_FLAGS_WOC_INC 0x00000004
101 #define PVRSRV_MODIFYSYNCOPS_FLAGS_ROC_INC 0x00000008
103 enum PVRSRV_DEVICE_TYPE {
104 PVRSRV_DEVICE_TYPE_UNKNOWN = 0,
105 PVRSRV_DEVICE_TYPE_MBX1 = 1,
106 PVRSRV_DEVICE_TYPE_MBX1_LITE = 2,
108 PVRSRV_DEVICE_TYPE_M24VA = 3,
109 PVRSRV_DEVICE_TYPE_MVDA2 = 4,
110 PVRSRV_DEVICE_TYPE_MVED1 = 5,
111 PVRSRV_DEVICE_TYPE_MSVDX = 6,
113 PVRSRV_DEVICE_TYPE_SGX = 7,
115 PVRSRV_DEVICE_TYPE_VGX = 8,
117 PVRSRV_DEVICE_TYPE_EXT = 9,
119 PVRSRV_DEVICE_TYPE_LAST = 9,
121 PVRSRV_DEVICE_TYPE_FORCE_I32 = 0x7fffffff
124 #define HEAP_ID(_dev_ , _dev_heap_idx_) \
125 (((_dev_) << 24) | ((_dev_heap_idx_) & ((1 << 24) - 1)))
127 #define HEAP_IDX(_heap_id_) \
128 ((_heap_id_) & ((1 << 24) - 1))
130 #define HEAP_DEV(_heap_id_) \
133 #define PVRSRV_UNDEFINED_HEAP_ID (~0LU)
136 IMG_EGL = 0x00000001,
137 IMG_OPENGLES1 = 0x00000002,
138 IMG_OPENGLES2 = 0x00000003,
139 IMG_D3DM = 0x00000004,
140 IMG_SRV_UM = 0x00000005,
141 IMG_OPENVG = 0x00000006,
142 IMG_SRVCLIENT = 0x00000007,
143 IMG_VISTAKMD = 0x00000008,
144 IMG_VISTA3DNODE = 0x00000009,
145 IMG_VISTAMVIDEONODE = 0x0000000A,
146 IMG_VISTAVPBNODE = 0x0000000B,
147 IMG_OPENGL = 0x0000000C,
151 struct PVRSRV_CONNECTION {
156 struct PVRSRV_DEV_DATA {
157 struct PVRSRV_CONNECTION sConnection;
161 struct PVRSRV_HWREG {
166 struct PVRSRV_MEMBLK {
167 struct IMG_DEV_VIRTADDR sDevVirtAddr;
172 struct IMG_SYS_PHYADDR *psIntSysPAddr;
175 struct PVRSRV_KERNEL_MEM_INFO;
177 struct PVRSRV_CLIENT_MEM_INFO {
180 struct IMG_DEV_VIRTADDR sDevVAddr;
181 struct IMG_CPU_PHYADDR sCpuPAddr;
185 struct PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo;
187 void *hKernelMemInfo;
189 struct PVRSRV_CLIENT_MEM_INFO *psNext;
192 #define PVRSRV_MAX_CLIENT_HEAPS (32)
193 struct PVRSRV_HEAP_INFO {
196 struct IMG_DEV_VIRTADDR sDevVAddrBase;
197 u32 ui32HeapByteSize;
201 struct PVRSRV_DEVICE_IDENTIFIER {
202 enum PVRSRV_DEVICE_TYPE eDeviceType;
203 enum PVRSRV_DEVICE_CLASS eDeviceClass;
208 struct PVRSRV_EVENTOBJECT {
209 char szName[EVENTOBJNAME_MAXLENGTH];
213 struct PVRSRV_MISC_INFO {
214 u32 ui32StateRequest;
215 u32 ui32StatePresent;
217 void *pvSOCTimerRegisterKM;
218 void *pvSOCTimerRegisterUM;
219 void *hSOCTimerRegisterOSMemHandle;
220 void *hSOCTimerRegisterMappingInfo;
222 void *pvSOCClockGateRegs;
223 u32 ui32SOCClockGateRegsSize;
226 u32 ui32MemoryStrLen;
228 struct PVRSRV_EVENTOBJECT sGlobalEventObject;
229 void *hOSGlobalEvent;
231 u32 aui32DDKVersion[4];
234 enum PVRSRV_ERROR AllocateDeviceID(struct SYS_DATA *psSysData, u32 *pui32DevID);
235 enum PVRSRV_ERROR FreeDeviceID(struct SYS_DATA *psSysData, u32 ui32DevID);