drm/nouveau/kms/nv50-: use NVIDIA's headers for wndw csc_clr()
[linux-2.6-microblaze.git] / drivers / gpu / drm / nouveau / nouveau_svm.h
1 #ifndef __NOUVEAU_SVM_H__
2 #define __NOUVEAU_SVM_H__
3 #include <nvif/os.h>
4 struct drm_device;
5 struct drm_file;
6 struct nouveau_drm;
7
8 struct nouveau_svmm;
9
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 *);
15
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 *);
21
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) {}
31
32 static inline int nouveau_svmm_init(struct drm_device *device, void *p,
33                                     struct drm_file *file)
34 {
35         return -ENOSYS;
36 }
37
38 static inline void nouveau_svmm_fini(struct nouveau_svmm **svmmp) {}
39
40 static inline int nouveau_svmm_join(struct nouveau_svmm *svmm, u64 inst)
41 {
42         return 0;
43 }
44
45 static inline void nouveau_svmm_part(struct nouveau_svmm *svmm, u64 inst) {}
46
47 static inline int nouveau_svmm_bind(struct drm_device *device, void *p,
48                                     struct drm_file *file)
49 {
50         return -ENOSYS;
51 }
52 #endif /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */
53 #endif