nouveau_mem.h 768 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __NOUVEAU_MEM_H__
  2. #define __NOUVEAU_MEM_H__
  3. #include <drm/ttm/ttm_bo_api.h>
  4. struct ttm_dma_tt;
  5. #include <nvif/mem.h>
  6. #include <nvif/vmm.h>
  7. static inline struct nouveau_mem *
  8. nouveau_mem(struct ttm_resource *reg)
  9. {
  10. return reg->mm_node;
  11. }
  12. struct nouveau_mem {
  13. struct nouveau_cli *cli;
  14. u8 kind;
  15. u8 comp;
  16. struct nvif_mem mem;
  17. struct nvif_vma vma[2];
  18. };
  19. int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
  20. struct ttm_resource *);
  21. void nouveau_mem_del(struct ttm_resource *);
  22. int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
  23. int nouveau_mem_host(struct ttm_resource *, struct ttm_dma_tt *);
  24. void nouveau_mem_fini(struct nouveau_mem *);
  25. int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *);
  26. #endif