nouveau_mem.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __NOUVEAU_MEM_H__
  2. #define __NOUVEAU_MEM_H__
  3. #include <drm/ttm/ttm_bo_api.h>
  4. struct ttm_tt;
  5. #include <nvif/mem.h>
  6. #include <nvif/vmm.h>
  7. struct nouveau_mem {
  8. struct ttm_resource base;
  9. struct nouveau_cli *cli;
  10. u8 kind;
  11. u8 comp;
  12. struct nvif_mem mem;
  13. struct nvif_vma vma[2];
  14. };
  15. static inline struct nouveau_mem *
  16. nouveau_mem(struct ttm_resource *reg)
  17. {
  18. return container_of(reg, struct nouveau_mem, base);
  19. }
  20. int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
  21. struct ttm_resource **);
  22. void nouveau_mem_del(struct ttm_resource_manager *man,
  23. struct ttm_resource *);
  24. bool nouveau_mem_intersects(struct ttm_resource *res,
  25. const struct ttm_place *place,
  26. size_t size);
  27. bool nouveau_mem_compatible(struct ttm_resource *res,
  28. const struct ttm_place *place,
  29. size_t size);
  30. int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
  31. int nouveau_mem_host(struct ttm_resource *, struct ttm_tt *);
  32. void nouveau_mem_fini(struct nouveau_mem *);
  33. int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *);
  34. #endif