hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h
....@@ -24,33 +24,20 @@
2424 #ifndef __AMDGPU_MN_H__
2525 #define __AMDGPU_MN_H__
2626
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>
3132
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)
4234 int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr);
4335 void amdgpu_mn_unregister(struct amdgpu_bo *bo);
4436 #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
-}
5237 static inline int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr)
5338 {
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");
5441 return -ENODEV;
5542 }
5643 static inline void amdgpu_mn_unregister(struct amdgpu_bo *bo) {}