2 #ifndef __NVC0_RESOURCE_H__
3 #define __NVC0_RESOURCE_H__
5 #include "nv50/nv50_resource.h"
8 #define NVC0_TILE_SHIFT_X(m) ((((m) >> 0) & 0xf) + 6)
9 #define NVC0_TILE_SHIFT_Y(m) ((((m) >> 4) & 0xf) + 3)
10 #define NVC0_TILE_SHIFT_Z(m) ((((m) >> 8) & 0xf) + 0)
12 #define NVC0_TILE_SIZE_X(m) (64 << (((m) >> 0) & 0xf))
13 #define NVC0_TILE_SIZE_Y(m) ( 8 << (((m) >> 4) & 0xf))
14 #define NVC0_TILE_SIZE_Z(m) ( 1 << (((m) >> 8) & 0xf))
16 /* it's ok to mask only in the end because max value is 3 * 5 */
18 #define NVC0_TILE_SIZE_2D(m) ((64 * 8) << (((m) + ((m) >> 4)) & 0xf))
20 #define NVC0_TILE_SIZE(m) ((64 * 8) << (((m) + ((m) >> 4) + ((m) >> 8)) & 0xf))
24 nvc0_init_resource_functions(struct pipe_context
*pcontext
);
27 nvc0_screen_init_resource_functions(struct pipe_screen
*pscreen
);
29 /* Internal functions:
31 struct pipe_resource
*
32 nvc0_miptree_create(struct pipe_screen
*pscreen
,
33 const struct pipe_resource
*tmp
);
35 const struct u_resource_vtbl nvc0_miptree_vtbl
;
38 nvc0_miptree_surface_new(struct pipe_context
*,
39 struct pipe_resource
*,
40 const struct pipe_surface
*templ
);
43 nvc0_mt_zslice_offset(const struct nv50_miptree
*, unsigned l
, unsigned z
);
45 struct pipe_transfer
*
46 nvc0_miptree_transfer_new(struct pipe_context
*pcontext
,
47 struct pipe_resource
*pt
,
50 const struct pipe_box
*box
);
52 nvc0_miptree_transfer_del(struct pipe_context
*pcontext
,
53 struct pipe_transfer
*ptx
);
55 nvc0_miptree_transfer_map(struct pipe_context
*pcontext
,
56 struct pipe_transfer
*ptx
);
58 nvc0_miptree_transfer_unmap(struct pipe_context
*pcontext
,
59 struct pipe_transfer
*ptx
);