1 #ifndef __NOUVEAU_SVM_H__
2 #define __NOUVEAU_SVM_H__
10 #if IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM)
11 void nouveau_svm_init(struct nouveau_drm *);
12 void nouveau_svm_fini(struct nouveau_drm *);
13 void nouveau_svm_suspend(struct nouveau_drm *);
14 void nouveau_svm_resume(struct nouveau_drm *);
16 int nouveau_svmm_init(struct drm_device *, void *, struct drm_file *);
17 void nouveau_svmm_fini(struct nouveau_svmm **);
18 int nouveau_svmm_join(struct nouveau_svmm *, u64 inst);
19 void nouveau_svmm_part(struct nouveau_svmm *, u64 inst);
20 int nouveau_svmm_bind(struct drm_device *, void *, struct drm_file *);
22 u64 *nouveau_pfns_alloc(unsigned long npages);
23 void nouveau_pfns_free(u64 *pfns);
24 void nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm,
25 unsigned long addr, u64 *pfns, unsigned long npages);
26 #else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */
27 static inline void nouveau_svm_init(struct nouveau_drm *drm) {}
28 static inline void nouveau_svm_fini(struct nouveau_drm *drm) {}
29 static inline void nouveau_svm_suspend(struct nouveau_drm *drm) {}
30 static inline void nouveau_svm_resume(struct nouveau_drm *drm) {}
32 static inline int nouveau_svmm_init(struct drm_device *device, void *p,
33 struct drm_file *file)
38 static inline void nouveau_svmm_fini(struct nouveau_svmm **svmmp) {}
40 static inline int nouveau_svmm_join(struct nouveau_svmm *svmm, u64 inst)
45 static inline void nouveau_svmm_part(struct nouveau_svmm *svmm, u64 inst) {}
47 static inline int nouveau_svmm_bind(struct drm_device *device, void *p,
48 struct drm_file *file)
52 #endif /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */