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;
10 * Create a new texture object, using the given template info, but on top of
13 * It is assumed that the buffer data is layed out according to the expected
14 * by the hardware. NULL will be returned if any inconsistency is found.
16 struct pipe_texture * (*texture_blanket)(struct pipe_screen *,
17 const struct pipe_texture *templat,
18 const unsigned *stride,
19 struct pipe_buffer *buffer);
21 int (*pre_pipebuffer_map_callback) (struct pipe_screen *pscreen,
22 struct pipe_buffer *pb, unsigned usage);
25 static inline struct nouveau_screen *
26 nouveau_screen(struct pipe_screen *pscreen)
28 return (struct nouveau_screen *)pscreen;
31 static inline struct nouveau_bo *
32 nouveau_bo(struct pipe_buffer *pb)
34 return pb ? *(struct nouveau_bo **)(pb + 1) : NULL;
37 int nouveau_screen_init(struct nouveau_screen *, struct nouveau_device *);
38 void nouveau_screen_fini(struct nouveau_screen *);
40 struct nouveau_miptree {
41 struct pipe_texture base;
42 struct nouveau_bo *bo;
45 static inline struct nouveau_miptree *
46 nouveau_miptree(struct pipe_texture *pt)
48 return (struct nouveau_miptree *)pt;