1 #ifndef NOUVEAU_WINSYS_H
2 #define NOUVEAU_WINSYS_H
5 #include "pipe/p_winsys.h"
6 #include "pipe/p_defines.h"
8 #include "pipe/nouveau/nouveau_bo.h"
9 #include "pipe/nouveau/nouveau_channel.h"
10 #include "pipe/nouveau/nouveau_class.h"
11 #include "pipe/nouveau/nouveau_grobj.h"
12 #include "pipe/nouveau/nouveau_notifier.h"
14 struct nouveau_resource
{
15 struct nouveau_resource
*prev
;
16 struct nouveau_resource
*next
;
25 struct nouveau_winsys
{
26 struct nouveau_context
*nv
;
28 struct nouveau_channel
*channel
;
30 int (*res_init
)(struct nouveau_resource
**heap
, int size
);
31 int (*res_alloc
)(struct nouveau_resource
*heap
, int size
, void *priv
,
32 struct nouveau_resource
**);
33 void (*res_free
)(struct nouveau_resource
**);
35 /*XXX: this is crappy, and bound to be slow.. however, it's nice and
36 * simple, it'll do for the moment*/
37 uint32_t *(*begin_ring
)(struct nouveau_grobj
*, int mthd
, int size
);
38 void (*out_reloc
)(struct nouveau_channel
*, void *ptr
,
39 struct nouveau_bo
*, uint32_t data
,
40 uint32_t flags
, uint32_t vor
, uint32_t tor
);
41 void (*fire_ring
)(struct nouveau_channel
*);
43 int (*grobj_alloc
)(struct nouveau_winsys
*, int grclass
,
44 struct nouveau_grobj
**);
45 void (*grobj_free
)(struct nouveau_grobj
**);
47 int (*notifier_alloc
)(struct nouveau_winsys
*, int count
,
48 struct nouveau_notifier
**);
49 void (*notifier_free
)(struct nouveau_notifier
**);
50 void (*notifier_reset
)(struct nouveau_notifier
*, int id
);
51 uint32_t (*notifier_status
)(struct nouveau_notifier
*, int id
);
52 uint32_t (*notifier_retval
)(struct nouveau_notifier
*, int id
);
53 int (*notifier_wait
)(struct nouveau_notifier
*, int id
,
54 int status
, int timeout
);
56 int (*region_copy
)(struct nouveau_context
*, struct pipe_region
*,
57 unsigned, unsigned, unsigned, struct pipe_region
*,
58 unsigned, unsigned, unsigned, unsigned, unsigned);
59 int (*region_fill
)(struct nouveau_context
*, struct pipe_region
*,
60 unsigned, unsigned, unsigned, unsigned, unsigned,
62 int (*region_data
)(struct nouveau_context
*, struct pipe_region
*,
63 unsigned, unsigned, unsigned, const void *,
64 unsigned, unsigned, unsigned, unsigned, unsigned);
67 extern struct pipe_context
*
68 nv40_create(struct pipe_winsys
*, struct nouveau_winsys
*, unsigned chipset
);