.. | .. |
---|
24 | 24 | #ifndef __AMDGPU_MN_H__ |
---|
25 | 25 | #define __AMDGPU_MN_H__ |
---|
26 | 26 | |
---|
27 | | -/* |
---|
28 | | - * MMU Notifier |
---|
29 | | - */ |
---|
30 | | -struct amdgpu_mn; |
---|
| 27 | +#include <linux/types.h> |
---|
| 28 | +#include <linux/hmm.h> |
---|
| 29 | +#include <linux/rwsem.h> |
---|
| 30 | +#include <linux/workqueue.h> |
---|
| 31 | +#include <linux/interval_tree.h> |
---|
31 | 32 | |
---|
32 | | -enum amdgpu_mn_type { |
---|
33 | | - AMDGPU_MN_TYPE_GFX, |
---|
34 | | - AMDGPU_MN_TYPE_HSA, |
---|
35 | | -}; |
---|
36 | | - |
---|
37 | | -#if defined(CONFIG_MMU_NOTIFIER) |
---|
38 | | -void amdgpu_mn_lock(struct amdgpu_mn *mn); |
---|
39 | | -void amdgpu_mn_unlock(struct amdgpu_mn *mn); |
---|
40 | | -struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev, |
---|
41 | | - enum amdgpu_mn_type type); |
---|
| 33 | +#if defined(CONFIG_HMM_MIRROR) |
---|
42 | 34 | int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr); |
---|
43 | 35 | void amdgpu_mn_unregister(struct amdgpu_bo *bo); |
---|
44 | 36 | #else |
---|
45 | | -static inline void amdgpu_mn_lock(struct amdgpu_mn *mn) {} |
---|
46 | | -static inline void amdgpu_mn_unlock(struct amdgpu_mn *mn) {} |
---|
47 | | -static inline struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev, |
---|
48 | | - enum amdgpu_mn_type type) |
---|
49 | | -{ |
---|
50 | | - return NULL; |
---|
51 | | -} |
---|
52 | 37 | static inline int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr) |
---|
53 | 38 | { |
---|
| 39 | + DRM_WARN_ONCE("HMM_MIRROR kernel config option is not enabled, " |
---|
| 40 | + "add CONFIG_ZONE_DEVICE=y in config file to fix this\n"); |
---|
54 | 41 | return -ENODEV; |
---|
55 | 42 | } |
---|
56 | 43 | static inline void amdgpu_mn_unregister(struct amdgpu_bo *bo) {} |
---|