2 #ifndef __NVC0_RESOURCE_H__
3 #define __NVC0_RESOURCE_H__
5 #include "nv50/nv50_resource.h"
7 #define NVC0_RESOURCE_FLAG_VIDEO (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 0)
9 #define NVC0_TILE_MODE_X(m) (((m) >> 0) & 0xf)
10 #define NVC0_TILE_MODE_Y(m) (((m) >> 4) & 0xf)
11 #define NVC0_TILE_MODE_Z(m) (((m) >> 8) & 0xf)
13 #define NVC0_TILE_SHIFT_X(m) (NVC0_TILE_MODE_X(m) + 6)
14 #define NVC0_TILE_SHIFT_Y(m) (NVC0_TILE_MODE_Y(m) + 3)
15 #define NVC0_TILE_SHIFT_Z(m) (NVC0_TILE_MODE_Z(m) + 0)
17 #define NVC0_TILE_SIZE_X(m) (64 << NVC0_TILE_MODE_X(m))
18 #define NVC0_TILE_SIZE_Y(m) ( 8 << NVC0_TILE_MODE_Y(m))
19 #define NVC0_TILE_SIZE_Z(m) ( 1 << NVC0_TILE_MODE_Z(m))
21 /* it's ok to mask only in the end because max value is 3 * 5 */
23 #define NVC0_TILE_SIZE_2D(m) ((64 * 8) << (((m) + ((m) >> 4)) & 0xf))
25 #define NVC0_TILE_SIZE(m) ((64 * 8) << (((m) + ((m) >> 4) + ((m) >> 8)) & 0xf))
29 nvc0_init_resource_functions(struct pipe_context
*pcontext
);
32 nvc0_screen_init_resource_functions(struct pipe_screen
*pscreen
);
34 /* Internal functions:
36 struct pipe_resource
*
37 nvc0_miptree_create(struct pipe_screen
*pscreen
,
38 const struct pipe_resource
*tmp
);
40 const struct u_resource_vtbl nvc0_miptree_vtbl
;
43 nvc0_miptree_surface_new(struct pipe_context
*,
44 struct pipe_resource
*,
45 const struct pipe_surface
*templ
);
48 nvc0_mt_zslice_offset(const struct nv50_miptree
*, unsigned l
, unsigned z
);
51 nvc0_miptree_transfer_map(struct pipe_context
*pctx
,
52 struct pipe_resource
*res
,
55 const struct pipe_box
*box
,
56 struct pipe_transfer
**ptransfer
);
58 nvc0_miptree_transfer_unmap(struct pipe_context
*pcontext
,
59 struct pipe_transfer
*ptx
);