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 struct nouveau_winsys
{
17 struct nouveau_context
*nv
;
19 struct nouveau_channel
*channel
;
21 int (*res_init
)(struct nouveau_resource
**heap
, unsigned start
,
23 int (*res_alloc
)(struct nouveau_resource
*heap
, int size
, void *priv
,
24 struct nouveau_resource
**);
25 void (*res_free
)(struct nouveau_resource
**);
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
);
32 int (*grobj_alloc
)(struct nouveau_winsys
*, int grclass
,
33 struct nouveau_grobj
**);
34 void (*grobj_free
)(struct nouveau_grobj
**);
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
);
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);
52 extern struct pipe_screen
*
53 nv10_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
56 extern struct pipe_context
*
57 nv10_create(struct pipe_screen
*, unsigned pctx_id
);
59 extern struct pipe_screen
*
60 nv30_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
63 extern struct pipe_context
*
64 nv30_create(struct pipe_screen
*, unsigned pctx_id
);
66 extern struct pipe_screen
*
67 nv40_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
70 extern struct pipe_context
*
71 nv40_create(struct pipe_screen
*, unsigned pctx_id
);
73 extern struct pipe_screen
*
74 nv50_screen_create(struct pipe_winsys
*ws
, struct nouveau_winsys
*,
77 extern struct pipe_context
*
78 nv50_create(struct pipe_screen
*, unsigned pctx_id
);