1 #ifndef __NOUVEAU_SCREEN_H__
2 #define __NOUVEAU_SCREEN_H__
4 struct nouveau_screen
{
5 struct pipe_screen base
;
6 struct nouveau_device
*device
;
7 struct nouveau_channel
*channel
;
9 int (*pre_pipebuffer_map_callback
) (struct pipe_screen
*pscreen
,
10 struct pipe_buffer
*pb
, unsigned usage
);
13 static inline struct nouveau_screen
*
14 nouveau_screen(struct pipe_screen
*pscreen
)
16 return (struct nouveau_screen
*)pscreen
;
19 static inline struct nouveau_bo
*
20 nouveau_bo(struct pipe_buffer
*pb
)
22 return pb
? *(struct nouveau_bo
**)(pb
+ 1) : NULL
;
25 int nouveau_screen_init(struct nouveau_screen
*, struct nouveau_device
*);
26 void nouveau_screen_fini(struct nouveau_screen
*);
28 struct nouveau_miptree
{
29 struct pipe_texture base
;
30 struct nouveau_bo
*bo
;
33 static inline struct nouveau_miptree
*
34 nouveau_miptree(struct pipe_texture
*pt
)
36 return (struct nouveau_miptree
*)pt
;