summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs2015-11-25 16:24:55 -0600
committerBen Skeggs2015-12-21 21:22:38 -0600
commitf208f2afdee6222ea8f6692a6ec4381cc999eb05 (patch)
treeaed0737619ecfbfaac073a5812f79f26482546bf
parent4291eea18fd81ca084935fb09a0e97a6661f4f85 (diff)
downloadexternal-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.h227
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 8struct 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
12struct 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 */
18struct nouveau_mclass {
19 int32_t oclass;
20 int version;
21 void *data;
15}; 22};
16 23
17struct nouveau_object { 24struct 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
32int nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
33 uint32_t oclass, void *data, uint32_t length,
34 struct nouveau_object **);
35void nouveau_object_del(struct nouveau_object **);
36int nouveau_object_mthd(struct nouveau_object *, uint32_t mthd,
37 void *data, uint32_t size);
38int nouveau_object_sclass_get(struct nouveau_object *,
39 struct nouveau_sclass **);
40void nouveau_object_sclass_put(struct nouveau_sclass **);
41int nouveau_object_mclass(struct nouveau_object *,
42 const struct nouveau_mclass *);
43
25struct nouveau_drm { 44struct 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)
40int nouveau_drm_new(int fd, struct nouveau_drm **); 59int nouveau_drm_new(int fd, struct nouveau_drm **);
41void nouveau_drm_del(struct nouveau_drm **); 60void nouveau_drm_del(struct nouveau_drm **);
42 61
43struct nouveau_fifo {
44 struct nouveau_object *object;
45 uint32_t channel;
46 uint32_t pushbuf;
47 uint64_t unused1[3];
48};
49
50struct nv04_fifo {
51 struct nouveau_fifo base;
52 uint32_t vram;
53 uint32_t gart;
54 uint32_t notify;
55};
56
57struct 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
70struct nve0_fifo {
71 struct {
72 struct nouveau_fifo base;
73 uint32_t notify;
74 };
75 uint32_t engine;
76};
77
78struct 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 */
85struct 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 */
95struct nouveau_mclass {
96 int32_t oclass; /* 0 == EOL */
97 int version;
98 void *data;
99};
100
101int nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
102 uint32_t oclass, void *data, uint32_t length,
103 struct nouveau_object **);
104void nouveau_object_del(struct nouveau_object **);
105int nouveau_object_mthd(struct nouveau_object *, uint32_t mthd,
106 void *data, uint32_t size);
107int nouveau_object_sclass_get(struct nouveau_object *,
108 struct nouveau_sclass **);
109void nouveau_object_sclass_put(struct nouveau_sclass **);
110int nouveau_object_mclass(struct nouveau_object *,
111 const struct nouveau_mclass *);
112
113struct nouveau_device { 62struct 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
125int nouveau_device_new(struct nouveau_object *parent, int32_t oclass, 74int 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 **);
127int nouveau_device_wrap(int fd, int close, struct nouveau_device **);
128int nouveau_device_open(const char *busid, struct nouveau_device **);
129void nouveau_device_del(struct nouveau_device **); 76void nouveau_device_del(struct nouveau_device **);
130int nouveau_getparam(struct nouveau_device *, uint64_t param, uint64_t *value); 77
131int nouveau_setparam(struct nouveau_device *, uint64_t param, uint64_t value); 78int nouveau_getparam(struct nouveau_device *, uint64_t param, uint64_t *value);
79int nouveau_setparam(struct nouveau_device *, uint64_t param, uint64_t value);
80
81/* deprecated */
82int nouveau_device_wrap(int fd, int close, struct nouveau_device **);
83int nouveau_device_open(const char *busid, struct nouveau_device **);
132 84
133struct nouveau_client { 85struct nouveau_client {
134 struct nouveau_device *device; 86 struct nouveau_device *device;
135 int id; 87 int id;
136}; 88};
137 89
138int nouveau_client_new(struct nouveau_device *, struct nouveau_client **); 90int nouveau_client_new(struct nouveau_device *, struct nouveau_client **);
139void nouveau_client_del(struct nouveau_client **); 91void nouveau_client_del(struct nouveau_client **);
140 92
141union nouveau_bo_config { 93union 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
185int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align, 137int 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 **);
140int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle,
187 struct nouveau_bo **); 141 struct nouveau_bo **);
188int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle, 142int nouveau_bo_name_ref(struct nouveau_device *v, uint32_t name,
189 struct nouveau_bo **); 143 struct nouveau_bo **);
190int nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, 144int nouveau_bo_name_get(struct nouveau_bo *, uint32_t *name);
191 struct nouveau_bo **);
192int nouveau_bo_name_get(struct nouveau_bo *, uint32_t *name);
193void nouveau_bo_ref(struct nouveau_bo *, struct nouveau_bo **); 145void nouveau_bo_ref(struct nouveau_bo *, struct nouveau_bo **);
194int nouveau_bo_map(struct nouveau_bo *, uint32_t access, 146int nouveau_bo_map(struct nouveau_bo *, uint32_t access,
147 struct nouveau_client *);
148int nouveau_bo_wait(struct nouveau_bo *, uint32_t access,
195 struct nouveau_client *); 149 struct nouveau_client *);
196int nouveau_bo_wait(struct nouveau_bo *, uint32_t access, 150int nouveau_bo_prime_handle_ref(struct nouveau_device *, int prime_fd,
197 struct nouveau_client *); 151 struct nouveau_bo **);
198int nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd, 152int nouveau_bo_set_prime(struct nouveau_bo *, int *prime_fd);
199 struct nouveau_bo **); 153
200int nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd); 154struct nouveau_list {
155 struct nouveau_list *prev;
156 struct nouveau_list *next;
157};
201 158
202struct nouveau_bufref { 159struct 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
222int nouveau_bufctx_new(struct nouveau_client *, int bins, 179int nouveau_bufctx_new(struct nouveau_client *, int bins,
223 struct nouveau_bufctx **); 180 struct nouveau_bufctx **);
224void nouveau_bufctx_del(struct nouveau_bufctx **); 181void nouveau_bufctx_del(struct nouveau_bufctx **);
225struct nouveau_bufref * 182struct nouveau_bufref *
226nouveau_bufctx_refn(struct nouveau_bufctx *, int bin, 183nouveau_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
252int nouveau_pushbuf_new(struct nouveau_client *, struct nouveau_object *channel, 209int 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 **);
255void nouveau_pushbuf_del(struct nouveau_pushbuf **); 212void nouveau_pushbuf_del(struct nouveau_pushbuf **);
256int nouveau_pushbuf_space(struct nouveau_pushbuf *, uint32_t dwords, 213int nouveau_pushbuf_space(struct nouveau_pushbuf *, uint32_t dwords,
257 uint32_t relocs, uint32_t pushes); 214 uint32_t relocs, uint32_t pushes);
258void nouveau_pushbuf_data(struct nouveau_pushbuf *, struct nouveau_bo *, 215void nouveau_pushbuf_data(struct nouveau_pushbuf *, struct nouveau_bo *,
259 uint64_t offset, uint64_t length); 216 uint64_t offset, uint64_t length);
260int nouveau_pushbuf_refn(struct nouveau_pushbuf *, 217int 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 *,
266void nouveau_pushbuf_reloc(struct nouveau_pushbuf *, struct nouveau_bo *, 223void 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);
269int nouveau_pushbuf_validate(struct nouveau_pushbuf *); 226int nouveau_pushbuf_validate(struct nouveau_pushbuf *);
270uint32_t nouveau_pushbuf_refd(struct nouveau_pushbuf *, struct nouveau_bo *); 227uint32_t nouveau_pushbuf_refd(struct nouveau_pushbuf *, struct nouveau_bo *);
271int nouveau_pushbuf_kick(struct nouveau_pushbuf *, struct nouveau_object *channel); 228int nouveau_pushbuf_kick(struct nouveau_pushbuf *, struct nouveau_object *chan);
272struct nouveau_bufctx * 229struct nouveau_bufctx *
273nouveau_pushbuf_bufctx(struct nouveau_pushbuf *, struct nouveau_bufctx *); 230nouveau_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
236struct nouveau_fifo {
237 struct nouveau_object *object;
238 uint32_t channel;
239 uint32_t pushbuf;
240 uint64_t unused1[3];
241};
242
243struct nv04_fifo {
244 struct nouveau_fifo base;
245 uint32_t vram;
246 uint32_t gart;
247 uint32_t notify;
248};
249
250struct 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
263struct nve0_fifo {
264 struct {
265 struct nouveau_fifo base;
266 uint32_t notify;
267 };
268 uint32_t engine;
269};
270
271struct nv04_notify {
272 struct nouveau_object *object;
273 uint32_t offset;
274 uint32_t length;
275};
275#endif 276#endif