1 diff --git a/tests/radeon/list.h b/tests/radeon/list.h
5 +++ b/tests/radeon/list.h
9 + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA.
10 + * All Rights Reserved.
12 + * Permission is hereby granted, free of charge, to any person obtaining a
13 + * copy of this software and associated documentation files (the
14 + * "Software"), to deal in the Software without restriction, including
15 + * without limitation the rights to use, copy, modify, merge, publish,
16 + * distribute, sub license, and/or sell copies of the Software, and to
17 + * permit persons to whom the Software is furnished to do so, subject to
18 + * the following conditions:
20 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
23 + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
24 + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
25 + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
26 + * USE OR OTHER DEALINGS IN THE SOFTWARE.
28 + * The above copyright notice and this permission notice (including the
29 + * next paragraph) shall be included in all copies or substantial portions
36 + * List macros heavily inspired by the Linux kernel
37 + * list handling. No list looping yet.
39 + * Is not threadsafe, so common operations need to
40 + * be protected using an external mutex.
42 +#ifndef _U_DOUBLE_LIST_H_
43 +#define _U_DOUBLE_LIST_H_
49 + struct list_head *prev;
50 + struct list_head *next;
53 +static void list_inithead(struct list_head *item)
59 +static void list_add(struct list_head *item, struct list_head *list)
62 + item->next = list->next;
63 + list->next->prev = item;
67 +static void list_addtail(struct list_head *item, struct list_head *list)
70 + item->prev = list->prev;
71 + list->prev->next = item;
75 +static void list_replace(struct list_head *from, struct list_head *to)
77 + to->prev = from->prev;
78 + to->next = from->next;
79 + from->next->prev = to;
80 + from->prev->next = to;
83 +static void list_del(struct list_head *item)
85 + item->prev->next = item->next;
86 + item->next->prev = item->prev;
89 +static void list_delinit(struct list_head *item)
91 + item->prev->next = item->next;
92 + item->next->prev = item->prev;
97 +#define LIST_INITHEAD(__item) list_inithead(__item)
98 +#define LIST_ADD(__item, __list) list_add(__item, __list)
99 +#define LIST_ADDTAIL(__item, __list) list_addtail(__item, __list)
100 +#define LIST_REPLACE(__from, __to) list_replace(__from, __to)
101 +#define LIST_DEL(__item) list_del(__item)
102 +#define LIST_DELINIT(__item) list_delinit(__item)
104 +#define LIST_ENTRY(__type, __item, __field) \
105 + ((__type *)(((char *)(__item)) - offsetof(__type, __field)))
107 +#define LIST_IS_EMPTY(__list) \
108 + ((__list)->next == (__list))
110 +#ifndef container_of
111 +#define container_of(ptr, sample, member) \
112 + (void *)((char *)(ptr) \
113 + - ((char *)&(sample)->member - (char *)(sample)))
116 +#define LIST_FOR_EACH_ENTRY(pos, head, member) \
117 + for (pos = container_of((head)->next, pos, member); \
118 + &pos->member != (head); \
119 + pos = container_of(pos->member.next, pos, member))
121 +#define LIST_FOR_EACH_ENTRY_SAFE(pos, storage, head, member) \
122 + for (pos = container_of((head)->next, pos, member), \
123 + storage = container_of(pos->member.next, pos, member); \
124 + &pos->member != (head); \
125 + pos = storage, storage = container_of(storage->member.next, storage, member))
127 +#define LIST_FOR_EACH_ENTRY_SAFE_REV(pos, storage, head, member) \
128 + for (pos = container_of((head)->prev, pos, member), \
129 + storage = container_of(pos->member.prev, pos, member); \
130 + &pos->member != (head); \
131 + pos = storage, storage = container_of(storage->member.prev, storage, member))
133 +#define LIST_FOR_EACH_ENTRY_FROM(pos, start, head, member) \
134 + for (pos = container_of((start), pos, member); \
135 + &pos->member != (head); \
136 + pos = container_of(pos->member.next, pos, member))
138 +#define LIST_FOR_EACH_ENTRY_FROM_REV(pos, start, head, member) \
139 + for (pos = container_of((start), pos, member); \
140 + &pos->member != (head); \
141 + pos = container_of(pos->member.prev, pos, member))
143 +#endif /*_U_DOUBLE_LIST_H_*/
144 diff --git a/tests/radeon/rbo.h b/tests/radeon/rbo.h
146 index 0000000..c25c73a
148 +++ b/tests/radeon/rbo.h
151 + * Copyright © 2011 Red Hat
153 + * Permission is hereby granted, free of charge, to any person obtaining a
154 + * copy of this software and associated documentation files (the "Software"),
155 + * to deal in the Software without restriction, including without limitation
156 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
157 + * and/or sell copies of the Software, and to permit persons to whom the
158 + * Software is furnished to do so, subject to the following conditions:
160 + * The above copyright notice and this permission notice (including the next
161 + * paragraph) shall be included in all copies or substantial portions of the
164 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
165 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
166 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
167 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
168 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
169 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
173 + * Jerome Glisse <j.glisse@gmail.com>
181 + struct list_head list;
187 + unsigned alignment;
191 +struct rbo *rbo(int fd, unsigned handle, unsigned size,
192 + unsigned alignment, void *ptr);
193 +int rbo_map(struct rbo *bo);
194 +void rbo_unmap(struct rbo *bo);
195 +struct rbo *rbo_incref(struct rbo *bo);
196 +struct rbo *rbo_decref(struct rbo *bo);
197 +int rbo_wait(struct rbo *bo);
200 commit 902ee661f1864aaf8325621085f6a1b5a6a3673a
201 Author: Dave Airlie <airlied@redhat.com>
202 Date: Mon Dec 5 21:24:48 2011 +0000
204 test/radeon: add missing files for dist
206 diff --git a/tests/radeon/Makefile.am b/tests/radeon/Makefile.am
207 index 021ca72..1775669 100644
208 --- a/tests/radeon/Makefile.am
209 +++ b/tests/radeon/Makefile.am
210 @@ -9,4 +9,6 @@ noinst_PROGRAMS = \
212 radeon_ttm_SOURCES = \