1 1.1 riastrad /* $NetBSD: nouveau_mem.h,v 1.2 2021/12/18 23:45:32 riastradh Exp $ */ 2 1.1 riastrad 3 1.1 riastrad #ifndef __NOUVEAU_MEM_H__ 4 1.1 riastrad #define __NOUVEAU_MEM_H__ 5 1.1 riastrad #include <drm/ttm/ttm_bo_api.h> 6 1.1 riastrad struct ttm_dma_tt; 7 1.1 riastrad 8 1.1 riastrad #include <nvif/mem.h> 9 1.1 riastrad #include <nvif/vmm.h> 10 1.1 riastrad 11 1.1 riastrad static inline struct nouveau_mem * 12 1.1 riastrad nouveau_mem(struct ttm_mem_reg *reg) 13 1.1 riastrad { 14 1.1 riastrad return reg->mm_node; 15 1.1 riastrad } 16 1.1 riastrad 17 1.1 riastrad struct nouveau_mem { 18 1.1 riastrad struct nouveau_cli *cli; 19 1.1 riastrad u8 kind; 20 1.1 riastrad u8 comp; 21 1.1 riastrad struct nvif_mem mem; 22 1.1 riastrad struct nvif_vma vma[2]; 23 1.1 riastrad }; 24 1.1 riastrad 25 1.1 riastrad int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp, 26 1.1 riastrad struct ttm_mem_reg *); 27 1.1 riastrad void nouveau_mem_del(struct ttm_mem_reg *); 28 1.1 riastrad int nouveau_mem_vram(struct ttm_mem_reg *, bool contig, u8 page); 29 1.1 riastrad int nouveau_mem_host(struct ttm_mem_reg *, struct ttm_dma_tt *); 30 1.1 riastrad void nouveau_mem_fini(struct nouveau_mem *); 31 1.1 riastrad int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *); 32 1.1 riastrad #endif 33