2 #ifndef __NV50_RESOURCE_H__
3 #define __NV50_RESOURCE_H__
5 #include "util/u_transfer.h"
6 #include "util/u_double_list.h"
8 #include "nouveau/nouveau_winsys.h"
9 #include "nouveau/nouveau_buffer.h"
13 nv50_init_resource_functions(struct pipe_context
*pcontext
);
16 nv50_screen_init_resource_functions(struct pipe_screen
*pscreen
);
18 #define NV50_TILE_DIM_SHIFT(m, d) (((m) >> (d * 4)) & 0xf)
20 #define NV50_TILE_PITCH(m) (64 << 0)
21 #define NV50_TILE_HEIGHT(m) ( 4 << NV50_TILE_DIM_SHIFT(m, 0))
22 #define NV50_TILE_DEPTH(m) ( 1 << NV50_TILE_DIM_SHIFT(m, 1))
24 #define NV50_TILE_SIZE_2D(m) ((64 * 4) << \
25 NV50_TILE_DIM_SHIFT(m, 0))
27 #define NV50_TILE_SIZE(m) (NV50_TILE_SIZE_2D(m) << NV50_TILE_DIM_SHIFT(m, 1))
29 struct nv50_miptree_level
{
35 #define NV50_MAX_TEXTURE_LEVELS 16
38 struct nv04_resource base
;
39 struct nv50_miptree_level level
[NV50_MAX_TEXTURE_LEVELS
];
41 uint32_t layer_stride
;
42 boolean layout_3d
; /* TRUE if layer count varies with mip level */
45 static INLINE
struct nv50_miptree
*
46 nv50_miptree(struct pipe_resource
*pt
)
48 return (struct nv50_miptree
*)pt
;
51 /* Internal functions:
53 struct pipe_resource
*
54 nv50_miptree_create(struct pipe_screen
*pscreen
,
55 const struct pipe_resource
*tmp
);
57 struct pipe_resource
*
58 nv50_miptree_from_handle(struct pipe_screen
*pscreen
,
59 const struct pipe_resource
*template,
60 struct winsys_handle
*whandle
);
63 nv50_miptree_surface_new(struct pipe_context
*,
64 struct pipe_resource
*,
65 const struct pipe_surface
*templ
);
68 nv50_miptree_surface_del(struct pipe_context
*, struct pipe_surface
*);