]> git.pld-linux.org Git - packages/libdrm.git/blob - libdrm-git.patch
- up to 2.4.28
[packages/libdrm.git] / libdrm-git.patch
1 diff --git a/tests/radeon/list.h b/tests/radeon/list.h
2 new file mode 100644
3 index 0000000..305c903
4 --- /dev/null
5 +++ b/tests/radeon/list.h
6 @@ -0,0 +1,137 @@
7 +/*
8 + *
9 + * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA.
10 + * All Rights Reserved.
11 + *
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:
19 + *
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.
27 + *
28 + * The above copyright notice and this permission notice (including the
29 + * next paragraph) shall be included in all copies or substantial portions
30 + * of the Software.
31 + *
32 + */
33 +
34 +/**
35 + * \file
36 + * List macros heavily inspired by the Linux kernel
37 + * list handling. No list looping yet.
38 + *
39 + * Is not threadsafe, so common operations need to
40 + * be protected using an external mutex.
41 + */
42 +#ifndef _U_DOUBLE_LIST_H_
43 +#define _U_DOUBLE_LIST_H_
44 +
45 +#include <stddef.h>
46 +
47 +struct list_head
48 +{
49 +    struct list_head *prev;
50 +    struct list_head *next;
51 +};
52 +
53 +static void list_inithead(struct list_head *item)
54 +{
55 +    item->prev = item;
56 +    item->next = item;
57 +}
58 +
59 +static void list_add(struct list_head *item, struct list_head *list)
60 +{
61 +    item->prev = list;
62 +    item->next = list->next;
63 +    list->next->prev = item;
64 +    list->next = item;
65 +}
66 +
67 +static void list_addtail(struct list_head *item, struct list_head *list)
68 +{
69 +    item->next = list;
70 +    item->prev = list->prev;
71 +    list->prev->next = item;
72 +    list->prev = item;
73 +}
74 +
75 +static void list_replace(struct list_head *from, struct list_head *to)
76 +{
77 +    to->prev = from->prev;
78 +    to->next = from->next;
79 +    from->next->prev = to;
80 +    from->prev->next = to;
81 +}
82 +
83 +static void list_del(struct list_head *item)
84 +{
85 +    item->prev->next = item->next;
86 +    item->next->prev = item->prev;
87 +}
88 +
89 +static void list_delinit(struct list_head *item)
90 +{
91 +    item->prev->next = item->next;
92 +    item->next->prev = item->prev;
93 +    item->next = item;
94 +    item->prev = item;
95 +}
96 +
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)
103 +
104 +#define LIST_ENTRY(__type, __item, __field)   \
105 +    ((__type *)(((char *)(__item)) - offsetof(__type, __field)))
106 +
107 +#define LIST_IS_EMPTY(__list)                   \
108 +    ((__list)->next == (__list))
109 +
110 +#ifndef container_of
111 +#define container_of(ptr, sample, member)                              \
112 +    (void *)((char *)(ptr)                                             \
113 +            - ((char *)&(sample)->member - (char *)(sample)))
114 +#endif
115 +
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))
120 +
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))
126 +
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))
132 +
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))
137 +
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))
142 +
143 +#endif /*_U_DOUBLE_LIST_H_*/
144 diff --git a/tests/radeon/rbo.h b/tests/radeon/rbo.h
145 new file mode 100644
146 index 0000000..c25c73a
147 --- /dev/null
148 +++ b/tests/radeon/rbo.h
149 @@ -0,0 +1,50 @@
150 +/*
151 + * Copyright © 2011 Red Hat
152 + *
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:
159 + *
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
162 + * Software.
163 + *
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
170 + * IN THE SOFTWARE.
171 + *
172 + * Authors:
173 + *    Jerome Glisse <j.glisse@gmail.com>
174 + */
175 +#ifndef RBO_H
176 +#define RBO_H
177 +
178 +#include "list.h"
179 +
180 +struct rbo {
181 +    struct list_head    list;
182 +    int                 fd;
183 +    unsigned            refcount;
184 +    unsigned            mapcount;
185 +    unsigned            handle;
186 +    unsigned            size;
187 +    unsigned            alignment;
188 +    void                *data;
189 +};
190 +
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);
198 +
199 +#endif
200 commit 902ee661f1864aaf8325621085f6a1b5a6a3673a
201 Author: Dave Airlie <airlied@redhat.com>
202 Date:   Mon Dec 5 21:24:48 2011 +0000
203
204     test/radeon: add missing files for dist
205
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 = \
211  
212  radeon_ttm_SOURCES = \
213         rbo.c \
214 +       rbo.h \
215 +       list.h \
216         radeon_ttm.c
This page took 0.097165 seconds and 3 git commands to generate.