1 
2 #ifndef __NVC0_RESOURCE_H__
3 #define __NVC0_RESOURCE_H__
4 
5 #include "nv50/nv50_resource.h"
6 
7 #define NVC0_RESOURCE_FLAG_VIDEO (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 0)
8 
9 
10 #define NVC0_TILE_SHIFT_X(m) ((((m) >> 0) & 0xf) + 6)
11 #define NVC0_TILE_SHIFT_Y(m) ((((m) >> 4) & 0xf) + 3)
12 #define NVC0_TILE_SHIFT_Z(m) ((((m) >> 8) & 0xf) + 0)
13 
14 #define NVC0_TILE_SIZE_X(m) (64 << (((m) >> 0) & 0xf))
15 #define NVC0_TILE_SIZE_Y(m) ( 8 << (((m) >> 4) & 0xf))
16 #define NVC0_TILE_SIZE_Z(m) ( 1 << (((m) >> 8) & 0xf))
17 
18 /* it's ok to mask only in the end because max value is 3 * 5 */
19 
20 #define NVC0_TILE_SIZE_2D(m) ((64 * 8) << (((m) + ((m) >> 4)) & 0xf))
21 
22 #define NVC0_TILE_SIZE(m) ((64 * 8) << (((m) + ((m) >> 4) + ((m) >> 8)) & 0xf))
23 
24 
25 void
26 nvc0_init_resource_functions(struct pipe_context *pcontext);
27 
28 void
29 nvc0_screen_init_resource_functions(struct pipe_screen *pscreen);
30 
31 /* Internal functions:
32  */
33 struct pipe_resource *
34 nvc0_miptree_create(struct pipe_screen *pscreen,
35                     const struct pipe_resource *tmp);
36 
37 const struct u_resource_vtbl nvc0_miptree_vtbl;
38 
39 struct pipe_surface *
40 nvc0_miptree_surface_new(struct pipe_context *,
41                          struct pipe_resource *,
42                          const struct pipe_surface *templ);
43 
44 unsigned
45 nvc0_mt_zslice_offset(const struct nv50_miptree *, unsigned l, unsigned z);
46 
47 struct pipe_transfer *
48 nvc0_miptree_transfer_new(struct pipe_context *pcontext,
49                           struct pipe_resource *pt,
50                           unsigned level,
51                           unsigned usage,
52                           const struct pipe_box *box);
53 void
54 nvc0_miptree_transfer_del(struct pipe_context *pcontext,
55                           struct pipe_transfer *ptx);
56 void *
57 nvc0_miptree_transfer_map(struct pipe_context *pcontext,
58                           struct pipe_transfer *ptx);
59 void
60 nvc0_miptree_transfer_unmap(struct pipe_context *pcontext,
61                             struct pipe_transfer *ptx);
62 
63 #endif
64