i965: fix bugs in projective texture coordinates
[mesa.git] / src / gallium / winsys / drm / nouveau / drm / nouveau_winsys_pipe.h
1 #ifndef NOUVEAU_PIPE_WINSYS_H
2 #define NOUVEAU_PIPE_WINSYS_H
3
4 #include "pipe/internal/p_winsys_screen.h"
5 #include "pipe/p_context.h"
6
7 #include "nouveau/nouveau_winsys.h"
8
9 #include "nouveau_device.h"
10
11 struct nouveau_pipe_buffer {
12 struct pipe_buffer base;
13 struct nouveau_bo *bo;
14 };
15
16 static INLINE struct nouveau_pipe_buffer *
17 nouveau_pipe_buffer(struct pipe_buffer *buf)
18 {
19 return (struct nouveau_pipe_buffer *)buf;
20 }
21
22 struct nouveau_pipe_winsys {
23 struct pipe_winsys base;
24
25 struct pipe_screen *pscreen;
26
27 struct nouveau_channel *channel;
28 uint32_t next_handle;
29
30 unsigned nr_pctx;
31 struct pipe_context **pctx;
32 };
33
34 static INLINE struct nouveau_pipe_winsys *
35 nouveau_pipe_winsys(struct pipe_winsys *ws)
36 {
37 return (struct nouveau_pipe_winsys *)ws;
38 }
39
40 static INLINE struct nouveau_pipe_winsys *
41 nouveau_screen(struct pipe_screen *pscreen)
42 {
43 return nouveau_pipe_winsys(pscreen->winsys);
44 }
45
46 struct pipe_winsys *
47 nouveau_pipe_winsys_new(struct nouveau_device *);
48
49 struct nouveau_winsys *
50 nouveau_winsys_new(struct pipe_winsys *ws);
51
52 #endif