aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/pvr/lists.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/pvr/lists.c')
-rw-r--r--drivers/gpu/pvr/lists.c99
1 files changed, 99 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/lists.c b/drivers/gpu/pvr/lists.c
new file mode 100644
index 00000000000..58389bf4a16
--- /dev/null
+++ b/drivers/gpu/pvr/lists.c
@@ -0,0 +1,99 @@
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#include "lists.h"
28#include "services_headers.h"
29
30IMPLEMENT_LIST_ANY_VA(BM_HEAP)
31IMPLEMENT_LIST_ANY_2(BM_HEAP, PVRSRV_ERROR, PVRSRV_OK)
32IMPLEMENT_LIST_ANY_VA_2(BM_HEAP, PVRSRV_ERROR, PVRSRV_OK)
33IMPLEMENT_LIST_FOR_EACH_VA(BM_HEAP)
34IMPLEMENT_LIST_REMOVE(BM_HEAP)
35IMPLEMENT_LIST_INSERT(BM_HEAP)
36
37IMPLEMENT_LIST_ANY_VA(BM_CONTEXT)
38IMPLEMENT_LIST_ANY_VA_2(BM_CONTEXT, IMG_HANDLE, IMG_NULL)
39IMPLEMENT_LIST_ANY_VA_2(BM_CONTEXT, PVRSRV_ERROR, PVRSRV_OK)
40IMPLEMENT_LIST_FOR_EACH(BM_CONTEXT)
41IMPLEMENT_LIST_REMOVE(BM_CONTEXT)
42IMPLEMENT_LIST_INSERT(BM_CONTEXT)
43
44IMPLEMENT_LIST_ANY_2(PVRSRV_DEVICE_NODE, PVRSRV_ERROR, PVRSRV_OK)
45IMPLEMENT_LIST_ANY_VA(PVRSRV_DEVICE_NODE)
46IMPLEMENT_LIST_ANY_VA_2(PVRSRV_DEVICE_NODE, PVRSRV_ERROR, PVRSRV_OK)
47IMPLEMENT_LIST_FOR_EACH(PVRSRV_DEVICE_NODE)
48IMPLEMENT_LIST_FOR_EACH_VA(PVRSRV_DEVICE_NODE)
49IMPLEMENT_LIST_INSERT(PVRSRV_DEVICE_NODE)
50IMPLEMENT_LIST_REMOVE(PVRSRV_DEVICE_NODE)
51
52IMPLEMENT_LIST_ANY_VA(PVRSRV_POWER_DEV)
53IMPLEMENT_LIST_ANY_VA_2(PVRSRV_POWER_DEV, PVRSRV_ERROR, PVRSRV_OK)
54IMPLEMENT_LIST_INSERT(PVRSRV_POWER_DEV)
55IMPLEMENT_LIST_REMOVE(PVRSRV_POWER_DEV)
56
57
58IMG_VOID* MatchDeviceKM_AnyVaCb(PVRSRV_DEVICE_NODE* psDeviceNode, va_list va)
59{
60 IMG_UINT32 ui32DevIndex;
61 IMG_BOOL bIgnoreClass;
62 PVRSRV_DEVICE_CLASS eDevClass;
63
64 ui32DevIndex = va_arg(va, IMG_UINT32);
65 bIgnoreClass = va_arg(va, IMG_BOOL);
66 if (!bIgnoreClass)
67 {
68 eDevClass = va_arg(va, PVRSRV_DEVICE_CLASS);
69 }
70 else
71 {
72
73
74 eDevClass = PVRSRV_DEVICE_CLASS_FORCE_I32;
75 }
76
77 if ((bIgnoreClass || psDeviceNode->sDevId.eDeviceClass == eDevClass) &&
78 psDeviceNode->sDevId.ui32DeviceIndex == ui32DevIndex)
79 {
80 return psDeviceNode;
81 }
82 return IMG_NULL;
83}
84
85IMG_VOID* MatchPowerDeviceIndex_AnyVaCb(PVRSRV_POWER_DEV *psPowerDev, va_list va)
86{
87 IMG_UINT32 ui32DeviceIndex;
88
89 ui32DeviceIndex = va_arg(va, IMG_UINT32);
90
91 if (psPowerDev->ui32DeviceIndex == ui32DeviceIndex)
92 {
93 return psPowerDev;
94 }
95 else
96 {
97 return IMG_NULL;
98 }
99}