1 #ifndef __NOUVEAU_SVM_H__
2 #define __NOUVEAU_SVM_H__
4 #include <linux/mmu_notifier.h>
10 struct mmu_notifier notifier;
11 struct nouveau_vmm *vmm;
20 #if IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM)
21 void nouveau_svm_init(struct nouveau_drm *);
22 void nouveau_svm_fini(struct nouveau_drm *);
23 void nouveau_svm_suspend(struct nouveau_drm *);
24 void nouveau_svm_resume(struct nouveau_drm *);
26 int nouveau_svmm_init(struct drm_device *, void *, struct drm_file *);
27 void nouveau_svmm_fini(struct nouveau_svmm **);
28 int nouveau_svmm_join(struct nouveau_svmm *, u64 inst);
29 void nouveau_svmm_part(struct nouveau_svmm *, u64 inst);
30 int nouveau_svmm_bind(struct drm_device *, void *, struct drm_file *);
32 void nouveau_svmm_invalidate(struct nouveau_svmm *svmm, u64 start, u64 limit);
33 u64 *nouveau_pfns_alloc(unsigned long npages);
34 void nouveau_pfns_free(u64 *pfns);
35 void nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm,
36 unsigned long addr, u64 *pfns, unsigned long npages);
37 #else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */
38 static inline void nouveau_svm_init(struct nouveau_drm *drm) {}
39 static inline void nouveau_svm_fini(struct nouveau_drm *drm) {}
40 static inline void nouveau_svm_suspend(struct nouveau_drm *drm) {}
41 static inline void nouveau_svm_resume(struct nouveau_drm *drm) {}
43 static inline int nouveau_svmm_init(struct drm_device *device, void *p,
44 struct drm_file *file)
49 static inline void nouveau_svmm_fini(struct nouveau_svmm **svmmp) {}
51 static inline int nouveau_svmm_join(struct nouveau_svmm *svmm, u64 inst)
56 static inline void nouveau_svmm_part(struct nouveau_svmm *svmm, u64 inst) {}
58 static inline int nouveau_svmm_bind(struct drm_device *device, void *p,
59 struct drm_file *file)
63 #endif /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */