Merge branch 'mesa_7_5_branch' into mesa_7_6_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
10 static inline struct nouveau_screen *
11 nouveau_screen(struct pipe_screen *pscreen)
12 {
13 return (struct nouveau_screen *)pscreen;
14 }
15
16 static inline struct nouveau_bo *
17 nouveau_bo(struct pipe_buffer *pb)
18 {
19 return pb ? *(struct nouveau_bo **)(pb + 1) : NULL;
20 }
21
22 int nouveau_screen_init(struct nouveau_screen *, struct nouveau_device *);
23 void nouveau_screen_fini(struct nouveau_screen *);
24
25 struct nouveau_miptree {
26 struct pipe_texture base;
27 struct nouveau_bo *bo;
28 };
29
30 static inline struct nouveau_miptree *
31 nouveau_miptree(struct pipe_texture *pt)
32 {
33 return (struct nouveau_miptree *)pt;
34 }
35
36 #endif