1 #ifndef NOUVEAU_WINSYS_H
2 #define NOUVEAU_WINSYS_H
5 #include "pipe/p_winsys.h"
6 #include "pipe/p_defines.h"
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"
16 #define NOUVEAU_CAP_HW_VTXBUF (0xbeef0000)
17 #define NOUVEAU_CAP_HW_IDXBUF (0xbeef0001)
19 #define NOUVEAU_BUFFER_USAGE_TEXTURE (1 << 16)
21 struct nouveau_winsys
{
22 struct nouveau_context
*nv
;
24 struct nouveau_channel
*channel
;
26 int (*res_init
)(struct nouveau_resource
**heap
, unsigned start
,
28 int (*res_alloc
)(struct nouveau_resource
*heap
, int size
, void *priv
,
29 struct nouveau_resource
**);
30 void (*res_free
)(struct nouveau_resource
**);
32 int (*push_reloc
)(struct nouveau_winsys
*, void *ptr
,
33 struct pipe_buffer
*, uint32_t data
,
34 uint32_t flags
, uint32_t vor
, uint32_t tor
);
35 int (*push_flush
)(struct nouveau_winsys
*, unsigned size
,
36 struct pipe_fence_handle
**fence
);
38 int (*grobj_alloc
)(struct nouveau_winsys
*, int grclass
,
39 struct nouveau_grobj
**);
40 void (*grobj_free
)(struct nouveau_grobj
**);
42 int (*notifier_alloc
)(struct nouveau_winsys
*, int count
,
43 struct nouveau_notifier
**);
44 void (*notifier_free
)(struct nouveau_notifier
**);
45 void (*notifier_reset
)(struct nouveau_notifier
*, int id
);
46 uint32_t (*notifier_status
)(struct nouveau_notifier
*, int id
);
47 uint32_t (*notifier_retval
)(struct nouveau_notifier
*, int id
);
48 int (*notifier_wait
)(struct nouveau_notifier
*, int id
,
49 int status
, int timeout
);
51 int (*surface_copy
)(struct nouveau_winsys
*, struct pipe_surface
*,
52 unsigned, unsigned, struct pipe_surface
*,
53 unsigned, unsigned, unsigned, unsigned);
54 int (*surface_fill
)(struct nouveau_winsys
*, struct pipe_surface
*,
55 unsigned, unsigned, unsigned, unsigned, unsigned);
58 extern struct pipe_screen
*
59 nv10_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
62 extern struct pipe_context
*
63 nv10_create(struct pipe_screen
*, unsigned pctx_id
);
65 extern struct pipe_screen
*
66 nv30_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
69 extern struct pipe_context
*
70 nv30_create(struct pipe_screen
*, unsigned pctx_id
);
72 extern struct pipe_screen
*
73 nv40_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
76 extern struct pipe_context
*
77 nv40_create(struct pipe_screen
*, unsigned pctx_id
);
79 extern struct pipe_screen
*
80 nv50_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
83 extern struct pipe_context
*
84 nv50_create(struct pipe_screen
*, unsigned pctx_id
);