Merge remote branch 'origin/gallium-0.2' into gallium-0.2
[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_device.h"
12 #include "nouveau/nouveau_grobj.h"
13 #include "nouveau/nouveau_notifier.h"
14 #include "nouveau/nouveau_resource.h"
15 #include "nouveau/nouveau_pushbuf.h"
16
17 #define NOUVEAU_CAP_HW_VTXBUF (0xbeef0000)
18 #define NOUVEAU_CAP_HW_IDXBUF (0xbeef0001)
19
20 #define NOUVEAU_BUFFER_USAGE_TEXTURE (1 << 16)
21 #define NOUVEAU_BUFFER_USAGE_ZETA (1 << 17)
22
23 struct nouveau_winsys {
24 struct nouveau_context *nv;
25
26 struct nouveau_channel *channel;
27
28 int (*res_init)(struct nouveau_resource **heap, unsigned start,
29 unsigned size);
30 int (*res_alloc)(struct nouveau_resource *heap, int size, void *priv,
31 struct nouveau_resource **);
32 void (*res_free)(struct nouveau_resource **);
33
34 int (*push_reloc)(struct nouveau_winsys *, void *ptr,
35 struct pipe_buffer *, uint32_t data,
36 uint32_t flags, uint32_t vor, uint32_t tor);
37 int (*push_flush)(struct nouveau_winsys *, unsigned size,
38 struct pipe_fence_handle **fence);
39
40 int (*grobj_alloc)(struct nouveau_winsys *, int grclass,
41 struct nouveau_grobj **);
42 void (*grobj_free)(struct nouveau_grobj **);
43
44 int (*notifier_alloc)(struct nouveau_winsys *, int count,
45 struct nouveau_notifier **);
46 void (*notifier_free)(struct nouveau_notifier **);
47 void (*notifier_reset)(struct nouveau_notifier *, int id);
48 uint32_t (*notifier_status)(struct nouveau_notifier *, int id);
49 uint32_t (*notifier_retval)(struct nouveau_notifier *, int id);
50 int (*notifier_wait)(struct nouveau_notifier *, int id,
51 int status, int timeout);
52
53 int (*surface_copy)(struct nouveau_winsys *, struct pipe_surface *,
54 unsigned, unsigned, struct pipe_surface *,
55 unsigned, unsigned, unsigned, unsigned);
56 int (*surface_fill)(struct nouveau_winsys *, struct pipe_surface *,
57 unsigned, unsigned, unsigned, unsigned, unsigned);
58 };
59
60 extern struct pipe_screen *
61 nv04_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
62
63 extern struct pipe_context *
64 nv04_create(struct pipe_screen *, unsigned pctx_id);
65
66 extern struct pipe_screen *
67 nv10_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
68
69 extern struct pipe_context *
70 nv10_create(struct pipe_screen *, unsigned pctx_id);
71
72 extern struct pipe_screen *
73 nv30_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
74
75 extern struct pipe_context *
76 nv30_create(struct pipe_screen *, unsigned pctx_id);
77
78 extern struct pipe_screen *
79 nv40_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
80
81 extern struct pipe_context *
82 nv40_create(struct pipe_screen *, unsigned pctx_id);
83
84 extern struct pipe_screen *
85 nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *);
86
87 extern struct pipe_context *
88 nv50_create(struct pipe_screen *, unsigned pctx_id);
89
90 #endif