diff options
author | Ben Skeggs | 2015-11-25 16:24:55 -0600 |
---|---|---|
committer | Ben Skeggs | 2015-12-21 21:22:38 -0600 |
commit | f208f2afdee6222ea8f6692a6ec4381cc999eb05 (patch) | |
tree | aed0737619ecfbfaac073a5812f79f26482546bf | |
parent | 4291eea18fd81ca084935fb09a0e97a6661f4f85 (diff) | |
download | external-libdrm-f208f2afdee6222ea8f6692a6ec4381cc999eb05.tar.gz external-libdrm-f208f2afdee6222ea8f6692a6ec4381cc999eb05.tar.xz external-libdrm-f208f2afdee6222ea8f6692a6ec4381cc999eb05.zip |
nouveau: clean up nouveau.h, noting deprecated members/functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r-- | nouveau/nouveau.h | 227 |
1 files changed, 114 insertions, 113 deletions
diff --git a/nouveau/nouveau.h b/nouveau/nouveau.h index f3cf8f58..335ce77d 100644 --- a/nouveau/nouveau.h +++ b/nouveau/nouveau.h | |||
@@ -4,24 +4,43 @@ | |||
4 | #include <stdint.h> | 4 | #include <stdint.h> |
5 | #include <stdbool.h> | 5 | #include <stdbool.h> |
6 | 6 | ||
7 | #define NOUVEAU_DEVICE_CLASS 0x80000000 | 7 | /* Supported class information, provided by the kernel */ |
8 | #define NOUVEAU_FIFO_CHANNEL_CLASS 0x80000001 | 8 | struct nouveau_sclass { |
9 | #define NOUVEAU_NOTIFIER_CLASS 0x80000002 | 9 | int32_t oclass; |
10 | #define NOUVEAU_PARENT_CLASS 0xffffffff | 10 | int minver; |
11 | int maxver; | ||
12 | }; | ||
11 | 13 | ||
12 | struct nouveau_list { | 14 | /* Client-provided array describing class versions that are desired. |
13 | struct nouveau_list *prev; | 15 | * |
14 | struct nouveau_list *next; | 16 | * These are used to match against the kernel's list of supported classes. |
17 | */ | ||
18 | struct nouveau_mclass { | ||
19 | int32_t oclass; | ||
20 | int version; | ||
21 | void *data; | ||
15 | }; | 22 | }; |
16 | 23 | ||
17 | struct nouveau_object { | 24 | struct nouveau_object { |
18 | struct nouveau_object *parent; | 25 | struct nouveau_object *parent; |
19 | uint64_t handle; | 26 | uint64_t handle; |
20 | uint32_t oclass; | 27 | uint32_t oclass; |
21 | uint32_t length; | 28 | uint32_t length; /* deprecated */ |
22 | void *data; | 29 | void *data; /* deprecated */ |
23 | }; | 30 | }; |
24 | 31 | ||
32 | int nouveau_object_new(struct nouveau_object *parent, uint64_t handle, | ||
33 | uint32_t oclass, void *data, uint32_t length, | ||
34 | struct nouveau_object **); | ||
35 | void nouveau_object_del(struct nouveau_object **); | ||
36 | int nouveau_object_mthd(struct nouveau_object *, uint32_t mthd, | ||
37 | void *data, uint32_t size); | ||
38 | int nouveau_object_sclass_get(struct nouveau_object *, | ||
39 | struct nouveau_sclass **); | ||
40 | void nouveau_object_sclass_put(struct nouveau_sclass **); | ||
41 | int nouveau_object_mclass(struct nouveau_object *, | ||
42 | const struct nouveau_mclass *); | ||
43 | |||
25 | struct nouveau_drm { | 44 | struct nouveau_drm { |
26 | struct nouveau_object client; | 45 | struct nouveau_object client; |
27 | int fd; | 46 | int fd; |
@@ -40,81 +59,11 @@ nouveau_drm(struct nouveau_object *obj) | |||
40 | int nouveau_drm_new(int fd, struct nouveau_drm **); | 59 | int nouveau_drm_new(int fd, struct nouveau_drm **); |
41 | void nouveau_drm_del(struct nouveau_drm **); | 60 | void nouveau_drm_del(struct nouveau_drm **); |
42 | 61 | ||
43 | struct nouveau_fifo { | ||
44 | struct nouveau_object *object; | ||
45 | uint32_t channel; | ||
46 | uint32_t pushbuf; | ||
47 | uint64_t unused1[3]; | ||
48 | }; | ||
49 | |||
50 | struct nv04_fifo { | ||
51 | struct nouveau_fifo base; | ||
52 | uint32_t vram; | ||
53 | uint32_t gart; | ||
54 | uint32_t notify; | ||
55 | }; | ||
56 | |||
57 | struct nvc0_fifo { | ||
58 | struct nouveau_fifo base; | ||
59 | uint32_t notify; | ||
60 | }; | ||
61 | |||
62 | #define NVE0_FIFO_ENGINE_GR 0x00000001 | ||
63 | #define NVE0_FIFO_ENGINE_VP 0x00000002 | ||
64 | #define NVE0_FIFO_ENGINE_PPP 0x00000004 | ||
65 | #define NVE0_FIFO_ENGINE_BSP 0x00000008 | ||
66 | #define NVE0_FIFO_ENGINE_CE0 0x00000010 | ||
67 | #define NVE0_FIFO_ENGINE_CE1 0x00000020 | ||
68 | #define NVE0_FIFO_ENGINE_ENC 0x00000040 | ||
69 | |||
70 | struct nve0_fifo { | ||
71 | struct { | ||
72 | struct nouveau_fifo base; | ||
73 | uint32_t notify; | ||
74 | }; | ||
75 | uint32_t engine; | ||
76 | }; | ||
77 | |||
78 | struct nv04_notify { | ||
79 | struct nouveau_object *object; | ||
80 | uint32_t offset; | ||
81 | uint32_t length; | ||
82 | }; | ||
83 | |||
84 | /* Supported class information, provided by the kernel */ | ||
85 | struct nouveau_sclass { | ||
86 | int32_t oclass; | ||
87 | int minver; | ||
88 | int maxver; | ||
89 | }; | ||
90 | |||
91 | /* Client-provided array describing class versions that are desired. | ||
92 | * | ||
93 | * These are used to match against the kernel's list of supported classes. | ||
94 | */ | ||
95 | struct nouveau_mclass { | ||
96 | int32_t oclass; /* 0 == EOL */ | ||
97 | int version; | ||
98 | void *data; | ||
99 | }; | ||
100 | |||
101 | int nouveau_object_new(struct nouveau_object *parent, uint64_t handle, | ||
102 | uint32_t oclass, void *data, uint32_t length, | ||
103 | struct nouveau_object **); | ||
104 | void nouveau_object_del(struct nouveau_object **); | ||
105 | int nouveau_object_mthd(struct nouveau_object *, uint32_t mthd, | ||
106 | void *data, uint32_t size); | ||
107 | int nouveau_object_sclass_get(struct nouveau_object *, | ||
108 | struct nouveau_sclass **); | ||
109 | void nouveau_object_sclass_put(struct nouveau_sclass **); | ||
110 | int nouveau_object_mclass(struct nouveau_object *, | ||
111 | const struct nouveau_mclass *); | ||
112 | |||
113 | struct nouveau_device { | 62 | struct nouveau_device { |
114 | struct nouveau_object object; | 63 | struct nouveau_object object; |
115 | int fd; | 64 | int fd; /* deprecated */ |
116 | uint32_t lib_version; | 65 | uint32_t lib_version; /* deprecated */ |
117 | uint32_t drm_version; | 66 | uint32_t drm_version; /* deprecated */ |
118 | uint32_t chipset; | 67 | uint32_t chipset; |
119 | uint64_t vram_size; | 68 | uint64_t vram_size; |
120 | uint64_t gart_size; | 69 | uint64_t gart_size; |
@@ -122,20 +71,23 @@ struct nouveau_device { | |||
122 | uint64_t gart_limit; | 71 | uint64_t gart_limit; |
123 | }; | 72 | }; |
124 | 73 | ||
125 | int nouveau_device_new(struct nouveau_object *parent, int32_t oclass, | 74 | int nouveau_device_new(struct nouveau_object *parent, int32_t oclass, |
126 | void *data, uint32_t size, struct nouveau_device **); | 75 | void *data, uint32_t size, struct nouveau_device **); |
127 | int nouveau_device_wrap(int fd, int close, struct nouveau_device **); | ||
128 | int nouveau_device_open(const char *busid, struct nouveau_device **); | ||
129 | void nouveau_device_del(struct nouveau_device **); | 76 | void nouveau_device_del(struct nouveau_device **); |
130 | int nouveau_getparam(struct nouveau_device *, uint64_t param, uint64_t *value); | 77 | |
131 | int nouveau_setparam(struct nouveau_device *, uint64_t param, uint64_t value); | 78 | int nouveau_getparam(struct nouveau_device *, uint64_t param, uint64_t *value); |
79 | int nouveau_setparam(struct nouveau_device *, uint64_t param, uint64_t value); | ||
80 | |||
81 | /* deprecated */ | ||
82 | int nouveau_device_wrap(int fd, int close, struct nouveau_device **); | ||
83 | int nouveau_device_open(const char *busid, struct nouveau_device **); | ||
132 | 84 | ||
133 | struct nouveau_client { | 85 | struct nouveau_client { |
134 | struct nouveau_device *device; | 86 | struct nouveau_device *device; |
135 | int id; | 87 | int id; |
136 | }; | 88 | }; |
137 | 89 | ||
138 | int nouveau_client_new(struct nouveau_device *, struct nouveau_client **); | 90 | int nouveau_client_new(struct nouveau_device *, struct nouveau_client **); |
139 | void nouveau_client_del(struct nouveau_client **); | 91 | void nouveau_client_del(struct nouveau_client **); |
140 | 92 | ||
141 | union nouveau_bo_config { | 93 | union nouveau_bo_config { |
@@ -182,22 +134,27 @@ struct nouveau_bo { | |||
182 | union nouveau_bo_config config; | 134 | union nouveau_bo_config config; |
183 | }; | 135 | }; |
184 | 136 | ||
185 | int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align, | 137 | int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align, |
186 | uint64_t size, union nouveau_bo_config *, | 138 | uint64_t size, union nouveau_bo_config *, |
139 | struct nouveau_bo **); | ||
140 | int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle, | ||
187 | struct nouveau_bo **); | 141 | struct nouveau_bo **); |
188 | int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle, | 142 | int nouveau_bo_name_ref(struct nouveau_device *v, uint32_t name, |
189 | struct nouveau_bo **); | 143 | struct nouveau_bo **); |
190 | int nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, | 144 | int nouveau_bo_name_get(struct nouveau_bo *, uint32_t *name); |
191 | struct nouveau_bo **); | ||
192 | int nouveau_bo_name_get(struct nouveau_bo *, uint32_t *name); | ||
193 | void nouveau_bo_ref(struct nouveau_bo *, struct nouveau_bo **); | 145 | void nouveau_bo_ref(struct nouveau_bo *, struct nouveau_bo **); |
194 | int nouveau_bo_map(struct nouveau_bo *, uint32_t access, | 146 | int nouveau_bo_map(struct nouveau_bo *, uint32_t access, |
147 | struct nouveau_client *); | ||
148 | int nouveau_bo_wait(struct nouveau_bo *, uint32_t access, | ||
195 | struct nouveau_client *); | 149 | struct nouveau_client *); |
196 | int nouveau_bo_wait(struct nouveau_bo *, uint32_t access, | 150 | int nouveau_bo_prime_handle_ref(struct nouveau_device *, int prime_fd, |
197 | struct nouveau_client *); | 151 | struct nouveau_bo **); |
198 | int nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd, | 152 | int nouveau_bo_set_prime(struct nouveau_bo *, int *prime_fd); |
199 | struct nouveau_bo **); | 153 | |
200 | int nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd); | 154 | struct nouveau_list { |
155 | struct nouveau_list *prev; | ||
156 | struct nouveau_list *next; | ||
157 | }; | ||
201 | 158 | ||
202 | struct nouveau_bufref { | 159 | struct nouveau_bufref { |
203 | struct nouveau_list thead; | 160 | struct nouveau_list thead; |
@@ -219,8 +176,8 @@ struct nouveau_bufctx { | |||
219 | int relocs; | 176 | int relocs; |
220 | }; | 177 | }; |
221 | 178 | ||
222 | int nouveau_bufctx_new(struct nouveau_client *, int bins, | 179 | int nouveau_bufctx_new(struct nouveau_client *, int bins, |
223 | struct nouveau_bufctx **); | 180 | struct nouveau_bufctx **); |
224 | void nouveau_bufctx_del(struct nouveau_bufctx **); | 181 | void nouveau_bufctx_del(struct nouveau_bufctx **); |
225 | struct nouveau_bufref * | 182 | struct nouveau_bufref * |
226 | nouveau_bufctx_refn(struct nouveau_bufctx *, int bin, | 183 | nouveau_bufctx_refn(struct nouveau_bufctx *, int bin, |
@@ -249,16 +206,16 @@ struct nouveau_pushbuf_refn { | |||
249 | uint32_t flags; | 206 | uint32_t flags; |
250 | }; | 207 | }; |
251 | 208 | ||
252 | int nouveau_pushbuf_new(struct nouveau_client *, struct nouveau_object *channel, | 209 | int nouveau_pushbuf_new(struct nouveau_client *, struct nouveau_object *chan, |
253 | int nr, uint32_t size, bool immediate, | 210 | int nr, uint32_t size, bool immediate, |
254 | struct nouveau_pushbuf **); | 211 | struct nouveau_pushbuf **); |
255 | void nouveau_pushbuf_del(struct nouveau_pushbuf **); | 212 | void nouveau_pushbuf_del(struct nouveau_pushbuf **); |
256 | int nouveau_pushbuf_space(struct nouveau_pushbuf *, uint32_t dwords, | 213 | int nouveau_pushbuf_space(struct nouveau_pushbuf *, uint32_t dwords, |
257 | uint32_t relocs, uint32_t pushes); | 214 | uint32_t relocs, uint32_t pushes); |
258 | void nouveau_pushbuf_data(struct nouveau_pushbuf *, struct nouveau_bo *, | 215 | void nouveau_pushbuf_data(struct nouveau_pushbuf *, struct nouveau_bo *, |
259 | uint64_t offset, uint64_t length); | 216 | uint64_t offset, uint64_t length); |
260 | int nouveau_pushbuf_refn(struct nouveau_pushbuf *, | 217 | int nouveau_pushbuf_refn(struct nouveau_pushbuf *, |
261 | struct nouveau_pushbuf_refn *, int nr); | 218 | struct nouveau_pushbuf_refn *, int nr); |
262 | /* Emits a reloc into the push buffer at the current position, you *must* | 219 | /* Emits a reloc into the push buffer at the current position, you *must* |
263 | * have previously added the referenced buffer to a buffer context, and | 220 | * have previously added the referenced buffer to a buffer context, and |
264 | * validated it against the current push buffer. | 221 | * validated it against the current push buffer. |
@@ -266,10 +223,54 @@ int nouveau_pushbuf_refn(struct nouveau_pushbuf *, | |||
266 | void nouveau_pushbuf_reloc(struct nouveau_pushbuf *, struct nouveau_bo *, | 223 | void nouveau_pushbuf_reloc(struct nouveau_pushbuf *, struct nouveau_bo *, |
267 | uint32_t data, uint32_t flags, | 224 | uint32_t data, uint32_t flags, |
268 | uint32_t vor, uint32_t tor); | 225 | uint32_t vor, uint32_t tor); |
269 | int nouveau_pushbuf_validate(struct nouveau_pushbuf *); | 226 | int nouveau_pushbuf_validate(struct nouveau_pushbuf *); |
270 | uint32_t nouveau_pushbuf_refd(struct nouveau_pushbuf *, struct nouveau_bo *); | 227 | uint32_t nouveau_pushbuf_refd(struct nouveau_pushbuf *, struct nouveau_bo *); |
271 | int nouveau_pushbuf_kick(struct nouveau_pushbuf *, struct nouveau_object *channel); | 228 | int nouveau_pushbuf_kick(struct nouveau_pushbuf *, struct nouveau_object *chan); |
272 | struct nouveau_bufctx * | 229 | struct nouveau_bufctx * |
273 | nouveau_pushbuf_bufctx(struct nouveau_pushbuf *, struct nouveau_bufctx *); | 230 | nouveau_pushbuf_bufctx(struct nouveau_pushbuf *, struct nouveau_bufctx *); |
274 | 231 | ||
232 | #define NOUVEAU_DEVICE_CLASS 0x80000000 | ||
233 | #define NOUVEAU_FIFO_CHANNEL_CLASS 0x80000001 | ||
234 | #define NOUVEAU_NOTIFIER_CLASS 0x80000002 | ||
235 | |||
236 | struct nouveau_fifo { | ||
237 | struct nouveau_object *object; | ||
238 | uint32_t channel; | ||
239 | uint32_t pushbuf; | ||
240 | uint64_t unused1[3]; | ||
241 | }; | ||
242 | |||
243 | struct nv04_fifo { | ||
244 | struct nouveau_fifo base; | ||
245 | uint32_t vram; | ||
246 | uint32_t gart; | ||
247 | uint32_t notify; | ||
248 | }; | ||
249 | |||
250 | struct nvc0_fifo { | ||
251 | struct nouveau_fifo base; | ||
252 | uint32_t notify; | ||
253 | }; | ||
254 | |||
255 | #define NVE0_FIFO_ENGINE_GR 0x00000001 | ||
256 | #define NVE0_FIFO_ENGINE_VP 0x00000002 | ||
257 | #define NVE0_FIFO_ENGINE_PPP 0x00000004 | ||
258 | #define NVE0_FIFO_ENGINE_BSP 0x00000008 | ||
259 | #define NVE0_FIFO_ENGINE_CE0 0x00000010 | ||
260 | #define NVE0_FIFO_ENGINE_CE1 0x00000020 | ||
261 | #define NVE0_FIFO_ENGINE_ENC 0x00000040 | ||
262 | |||
263 | struct nve0_fifo { | ||
264 | struct { | ||
265 | struct nouveau_fifo base; | ||
266 | uint32_t notify; | ||
267 | }; | ||
268 | uint32_t engine; | ||
269 | }; | ||
270 | |||
271 | struct nv04_notify { | ||
272 | struct nouveau_object *object; | ||
273 | uint32_t offset; | ||
274 | uint32_t length; | ||
275 | }; | ||
275 | #endif | 276 | #endif |