Merge branch 'mesa_7_7_branch'
[mesa.git] / src / gallium / drivers / nouveau / nouveau_screen.h
1 #ifndef __NOUVEAU_SCREEN_H__
2 #define __NOUVEAU_SCREEN_H__
3
4 struct nouveau_screen {
5 struct pipe_screen base;
6 struct nouveau_device *device;
7 struct nouveau_channel *channel;
8
9 int (*pre_pipebuffer_map_callback) (struct pipe_screen *pscreen,
10 struct pipe_buffer *pb, unsigned usage);
11 };
12
13 static inline struct nouveau_screen *
14 nouveau_screen(struct pipe_screen *pscreen)
15 {
16 return (struct nouveau_screen *)pscreen;
17 }
18
19 static inline struct nouveau_bo *
20 nouveau_bo(struct pipe_buffer *pb)
21 {
22 return pb ? *(struct nouveau_bo **)(pb + 1) : NULL;
23 }
24
25 int nouveau_screen_init(struct nouveau_screen *, struct nouveau_device *);
26 void nouveau_screen_fini(struct nouveau_screen *);
27
28 struct nouveau_miptree {
29 struct pipe_texture base;
30 struct nouveau_bo *bo;
31 };
32
33 static inline struct nouveau_miptree *
34 nouveau_miptree(struct pipe_texture *pt)
35 {
36 return (struct nouveau_miptree *)pt;
37 }
38
39 #endif