nvc0: import nvc0 gallium driver
[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_defines.h"
6
7 #include "nouveau/nouveau_bo.h"
8 #include "nouveau/nouveau_channel.h"
9 #include "nouveau/nouveau_device.h"
10 #include "nouveau/nouveau_grobj.h"
11 #include "nouveau/nouveau_notifier.h"
12 #include "nouveau/nouveau_resource.h"
13 #ifndef NOUVEAU_NVC0
14 #include "nouveau/nouveau_pushbuf.h"
15 #endif
16
17 #ifndef NV04_PFIFO_MAX_PACKET_LEN
18 #define NV04_PFIFO_MAX_PACKET_LEN 2047
19 #endif
20
21 static INLINE uint32_t
22 nouveau_screen_transfer_flags(unsigned pipe)
23 {
24 uint32_t flags = 0;
25
26 if (pipe & PIPE_TRANSFER_READ)
27 flags |= NOUVEAU_BO_RD;
28 if (pipe & PIPE_TRANSFER_WRITE)
29 flags |= NOUVEAU_BO_WR;
30 if (pipe & PIPE_TRANSFER_DISCARD)
31 flags |= NOUVEAU_BO_INVAL;
32 if (pipe & PIPE_TRANSFER_UNSYNCHRONIZED)
33 flags |= NOUVEAU_BO_NOSYNC;
34 else if (pipe & PIPE_TRANSFER_DONTBLOCK)
35 flags |= NOUVEAU_BO_NOWAIT;
36
37 return flags;
38 }
39
40 extern struct pipe_screen *
41 nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
42
43 extern struct pipe_screen *
44 nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
45
46 extern struct pipe_screen *
47 nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *);
48
49 #endif