xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_svm.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: nouveau_svm.h,v 1.2 2021/12/18 23:45:32 riastradh Exp $	*/
2 
3 #ifndef __NOUVEAU_SVM_H__
4 #define __NOUVEAU_SVM_H__
5 #include <nvif/os.h>
6 struct drm_device;
7 struct drm_file;
8 struct nouveau_drm;
9 
10 struct nouveau_svmm;
11 
12 #if IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM)
13 void nouveau_svm_init(struct nouveau_drm *);
14 void nouveau_svm_fini(struct nouveau_drm *);
15 void nouveau_svm_suspend(struct nouveau_drm *);
16 void nouveau_svm_resume(struct nouveau_drm *);
17 
18 int nouveau_svmm_init(struct drm_device *, void *, struct drm_file *);
19 void nouveau_svmm_fini(struct nouveau_svmm **);
20 int nouveau_svmm_join(struct nouveau_svmm *, u64 inst);
21 void nouveau_svmm_part(struct nouveau_svmm *, u64 inst);
22 int nouveau_svmm_bind(struct drm_device *, void *, struct drm_file *);
23 #else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */
nouveau_svm_init(struct nouveau_drm * drm)24 static inline void nouveau_svm_init(struct nouveau_drm *drm) {}
nouveau_svm_fini(struct nouveau_drm * drm)25 static inline void nouveau_svm_fini(struct nouveau_drm *drm) {}
nouveau_svm_suspend(struct nouveau_drm * drm)26 static inline void nouveau_svm_suspend(struct nouveau_drm *drm) {}
nouveau_svm_resume(struct nouveau_drm * drm)27 static inline void nouveau_svm_resume(struct nouveau_drm *drm) {}
28 
nouveau_svmm_init(struct drm_device * device,void * p,struct drm_file * file)29 static inline int nouveau_svmm_init(struct drm_device *device, void *p,
30 				    struct drm_file *file)
31 {
32 	return -ENOSYS;
33 }
34 
nouveau_svmm_fini(struct nouveau_svmm ** svmmp)35 static inline void nouveau_svmm_fini(struct nouveau_svmm **svmmp) {}
36 
nouveau_svmm_join(struct nouveau_svmm * svmm,u64 inst)37 static inline int nouveau_svmm_join(struct nouveau_svmm *svmm, u64 inst)
38 {
39 	return 0;
40 }
41 
nouveau_svmm_part(struct nouveau_svmm * svmm,u64 inst)42 static inline void nouveau_svmm_part(struct nouveau_svmm *svmm, u64 inst) {}
43 
nouveau_svmm_bind(struct drm_device * device,void * p,struct drm_file * file)44 static inline int nouveau_svmm_bind(struct drm_device *device, void *p,
45 				    struct drm_file *file)
46 {
47 	return -ENOSYS;
48 }
49 #endif /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */
50 #endif
51