nv10.
[mesa.git] / src / gallium / drivers / nouveau / nouveau_winsys.h
1 #ifndef NOUVEAU_WINSYS_H
2 #define NOUVEAU_WINSYS_H
3
4 #include <stdint.h>
5 #include "pipe/p_winsys.h"
6 #include "pipe/p_defines.h"
7
8 #include "nouveau/nouveau_bo.h"
9 #include "nouveau/nouveau_channel.h"
10 #include "nouveau/nouveau_class.h"
11 #include "nouveau/nouveau_grobj.h"
12 #include "nouveau/nouveau_notifier.h"
13 #include "nouveau/nouveau_resource.h"
14 #include "nouveau/nouveau_pushbuf.h"
15
16 struct nouveau_winsys {
17 struct nouveau_context *nv;
18
19 struct nouveau_channel *channel;
20
21 int (*res_init)(struct nouveau_resource **heap, unsigned start,
22 unsigned size);
23 int (*res_alloc)(struct nouveau_resource *heap, int size, void *priv,
24 struct nouveau_resource **);
25 void (*res_free)(struct nouveau_resource **);
26
27 int (*push_reloc)(struct nouveau_channel *, void *ptr,
28 struct pipe_buffer *, uint32_t data,
29 uint32_t flags, uint32_t vor, uint32_t tor);
30 int (*push_flush)(struct nouveau_channel *, unsigned size);
31
32 int (*grobj_alloc)(struct nouveau_winsys *, int grclass,
33 struct nouveau_grobj **);
34 void (*grobj_free)(struct nouveau_grobj **);
35
36 int (*notifier_alloc)(struct nouveau_winsys *, int count,
37 struct nouveau_notifier **);
38 void (*notifier_free)(struct nouveau_notifier **);
39 void (*notifier_reset)(struct nouveau_notifier *, int id);
40 uint32_t (*notifier_status)(struct nouveau_notifier *, int id);
41 uint32_t (*notifier_retval)(struct nouveau_notifier *, int id);
42 int (*notifier_wait)(struct nouveau_notifier *, int id,
43 int status, int timeout);
44
45 int (*surface_copy)(struct nouveau_winsys *, struct pipe_surface *,
46 unsigned, unsigned, struct pipe_surface *,
47 unsigned, unsigned, unsigned, unsigned);
48 int (*surface_fill)(struct nouveau_winsys *, struct pipe_surface *,
49 unsigned, unsigned, unsigned, unsigned, unsigned);
50 };
51
52 extern struct pipe_screen *
53 nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
54 unsigned chipset);
55
56 extern struct pipe_context *
57 nv10_create(struct pipe_screen *, unsigned pctx_id);
58
59 extern struct pipe_screen *
60 nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
61 unsigned chipset);
62
63 extern struct pipe_context *
64 nv30_create(struct pipe_screen *, unsigned pctx_id);
65
66 extern struct pipe_screen *
67 nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
68 unsigned chipset);
69
70 extern struct pipe_context *
71 nv40_create(struct pipe_screen *, unsigned pctx_id);
72
73 extern struct pipe_screen *
74 nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *,
75 unsigned chipset);
76
77 extern struct pipe_context *
78 nv50_create(struct pipe_screen *, unsigned pctx_id);
79
80 #endif