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 ******************************************************************************/
31 RESMAN_TYPE_SHARED_PB_DESC = 1,
32 RESMAN_TYPE_SHARED_PB_DESC_CREATE_LOCK,
33 RESMAN_TYPE_HW_RENDER_CONTEXT,
34 RESMAN_TYPE_HW_TRANSFER_CONTEXT,
35 RESMAN_TYPE_HW_2D_CONTEXT,
36 RESMAN_TYPE_TRANSFER_CONTEXT,
38 RESMAN_TYPE_DISPLAYCLASS_SWAPCHAIN,
39 RESMAN_TYPE_DISPLAYCLASS_DEVICE,
41 RESMAN_TYPE_BUFFERCLASS_DEVICE,
43 RESMAN_TYPE_OS_USERMODE_MAPPING,
45 RESMAN_TYPE_DEVICEMEM_CONTEXT,
46 RESMAN_TYPE_DEVICECLASSMEM_MAPPING,
47 RESMAN_TYPE_DEVICEMEM_MAPPING,
48 RESMAN_TYPE_DEVICEMEM_WRAP,
49 RESMAN_TYPE_DEVICEMEM_ALLOCATION,
50 RESMAN_TYPE_EVENT_OBJECT,
51 RESMAN_TYPE_SHARED_MEM_INFO,
53 RESMAN_TYPE_KERNEL_DEVICEMEM_ALLOCATION
56 #define RESMAN_CRITERIA_ALL 0x00000000
57 #define RESMAN_CRITERIA_RESTYPE 0x00000001
58 #define RESMAN_CRITERIA_PVOID_PARAM 0x00000002
59 #define RESMAN_CRITERIA_UI32_PARAM 0x00000004
62 struct RESMAN_CONTEXT;
64 enum PVRSRV_ERROR ResManInit(void);
65 void ResManDeInit(void);
67 struct RESMAN_ITEM *ResManRegisterRes(struct RESMAN_CONTEXT *hResManContext,
68 u32 ui32ResType, void *pvParam,
70 enum PVRSRV_ERROR (*pfnFreeResource)
71 (void *pvParam, u32 ui32Param));
73 void ResManFreeResByPtr(struct RESMAN_ITEM *psResItem);
75 void ResManFreeResByCriteria(struct RESMAN_CONTEXT *hResManContext,
76 u32 ui32SearchCriteria, u32 ui32ResType, void *pvParam,
79 enum PVRSRV_ERROR ResManDissociateRes(struct RESMAN_ITEM *psResItem,
83 enum PVRSRV_ERROR ResManFindResourceByPtr(struct RESMAN_CONTEXT *hResManContext,
84 struct RESMAN_ITEM *psItem);
86 struct RESMAN_CONTEXT *pvr_get_resman_ctx(void *resource);
87 struct PVRSRV_PER_PROCESS_DATA *pvr_get_proc_by_ctx(struct RESMAN_CONTEXT *ctx);
89 enum PVRSRV_ERROR PVRSRVResManConnect(void *hPerProc,
90 struct RESMAN_CONTEXT **phResManContext);
92 void PVRSRVResManDisconnect(struct RESMAN_CONTEXT *hResManContext,
93 IMG_BOOL bKernelContext);