Merge tag 'drm-fixes-2021-10-08' of git://anongit.freedesktop.org/drm/drm
[sfrench/cifs-2.6.git] / drivers / gpu / drm / nouveau / nouveau_mem.h
1 #ifndef __NOUVEAU_MEM_H__
2 #define __NOUVEAU_MEM_H__
3 #include <drm/ttm/ttm_bo_api.h>
4 struct ttm_tt;
5
6 #include <nvif/mem.h>
7 #include <nvif/vmm.h>
8
9 struct nouveau_mem {
10         struct ttm_resource base;
11         struct nouveau_cli *cli;
12         u8 kind;
13         u8 comp;
14         struct nvif_mem mem;
15         struct nvif_vma vma[2];
16 };
17
18 static inline struct nouveau_mem *
19 nouveau_mem(struct ttm_resource *reg)
20 {
21         return container_of(reg, struct nouveau_mem, base);
22 }
23
24 int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
25                     struct ttm_resource **);
26 void nouveau_mem_del(struct ttm_resource *);
27 int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
28 int nouveau_mem_host(struct ttm_resource *, struct ttm_tt *);
29 void nouveau_mem_fini(struct nouveau_mem *);
30 int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *);
31 #endif