20930ebc5e21d10f157833eff2edf4523f3c37bc
[linux-2.6-block.git] / drivers / gpu / drm / nouveau / nouveau_mem.h
1 #ifndef __NOUVEAU_MEM_H__
2 #define __NOUVEAU_MEM_H__
3 #include <subdev/fb.h>
4
5 #include <drm/ttm/ttm_bo_api.h>
6 struct ttm_dma_tt;
7
8 static inline struct nouveau_mem *
9 nouveau_mem(struct ttm_mem_reg *reg)
10 {
11         return reg->mm_node;
12 }
13
14 struct nouveau_mem {
15         struct nouveau_cli *cli;
16         u8 kind;
17         u8 comp;
18         struct {
19                 u8 page;
20         } mem;
21         struct nvkm_vma vma[2];
22
23         struct nvkm_mem __mem;
24         struct nvkm_mem *_mem;
25         struct nvkm_vma bar_vma;
26
27         struct nvkm_memory memory;
28 };
29
30 enum nvif_vmm_get {
31         PTES,
32         LAZY,
33 };
34
35 int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
36                     struct ttm_mem_reg *);
37 void nouveau_mem_del(struct ttm_mem_reg *);
38 int nouveau_mem_vram(struct ttm_mem_reg *, bool contig, u8 page);
39 int nouveau_mem_host(struct ttm_mem_reg *, struct ttm_dma_tt *);
40 void nouveau_mem_fini(struct nouveau_mem *);
41 int nouveau_mem_map(struct nouveau_mem *, struct nvkm_vmm *, struct nvkm_vma *);
42 #endif