0001 #ifndef __NOUVEAU_MEM_H__
0002 #define __NOUVEAU_MEM_H__
0003 #include <drm/ttm/ttm_bo_api.h>
0004 struct ttm_tt;
0005
0006 #include <nvif/mem.h>
0007 #include <nvif/vmm.h>
0008
0009 struct nouveau_mem {
0010 struct ttm_resource base;
0011 struct nouveau_cli *cli;
0012 u8 kind;
0013 u8 comp;
0014 struct nvif_mem mem;
0015 struct nvif_vma vma[2];
0016 };
0017
0018 static inline struct nouveau_mem *
0019 nouveau_mem(struct ttm_resource *reg)
0020 {
0021 return container_of(reg, struct nouveau_mem, base);
0022 }
0023
0024 int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
0025 struct ttm_resource **);
0026 void nouveau_mem_del(struct ttm_resource_manager *man,
0027 struct ttm_resource *);
0028 int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
0029 int nouveau_mem_host(struct ttm_resource *, struct ttm_tt *);
0030 void nouveau_mem_fini(struct nouveau_mem *);
0031 int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *);
0032 #endif