Skip to contentSkip to conversation

drm/amdgpu: Fix build errors with HMM disabled

PATCH In review Kuehling, Felix 1 participant 2 messages Jul 8, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix build errors with HMM disabled

Only define struct amdgpu_mn if HMM_MIRROR is enabled. Add back a forward declaration for the case that it isn't.

Fixes 6f1c3e61d2d8 ("drm/amdgpu: Prepare for hmm_range_register API change")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h +5 -1
index 281fd9fef662..33ca6214db90 100644
@@ -35,6 +35,8 @@ enum amdgpu_mn_type {
 	AMDGPU_MN_TYPE_HSA,
 };
 
+#if defined(CONFIG_HMM_MIRROR)
+
 /**
  * struct amdgpu_mn
  *
@@ -69,7 +71,6 @@ struct amdgpu_mn {
 	struct hmm_mirror	mirror;
 };
 
-#if defined(CONFIG_HMM_MIRROR)
 void amdgpu_mn_lock(struct amdgpu_mn *mn);
 void amdgpu_mn_unlock(struct amdgpu_mn *mn);
 struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev,
@@ -78,6 +79,9 @@ int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr);
 void amdgpu_mn_unregister(struct amdgpu_bo *bo);
 void amdgpu_hmm_init_range(struct hmm_range *range);
 #else
+
+struct amdgpu_mn;
+
 static inline void amdgpu_mn_lock(struct amdgpu_mn *mn) {}
 static inline void amdgpu_mn_unlock(struct amdgpu_mn *mn) {}
 static inline struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev,
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190708160441.1087-1-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Looks like Arnd Bergmann already fixed it with a different patch. That's fine with me too. Feel free to ignore this.

Quoted 31 lines · Felix

Only define struct amdgpu_mn if HMM_MIRROR is enabled. Add back a forward declaration for the case that it isn't.

Fixes 6f1c3e61d2d8 ("drm/amdgpu: Prepare for hmm_range_register API change")
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h +2 -1
index 281fd9fef662..33ca6214db90 100644
@@ -35,6 +35,8 @@ enum amdgpu_mn_type {
  	AMDGPU_MN_TYPE_HSA,
  };
 
+#if defined(CONFIG_HMM_MIRROR)
+
  /**
   * struct amdgpu_mn
   *
@@ -69,7 +71,6 @@ struct amdgpu_mn {
  	struct hmm_mirror	mirror;
  };
 
-#if defined(CONFIG_HMM_MIRROR)
  void amdgpu_mn_lock(struct amdgpu_mn *mn);
  void amdgpu_mn_unlock(struct amdgpu_mn *mn);
  struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev,

drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr); · line 87

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h +3 -0
@@ -78,6 +79,9 @@ int amdgpu_mn_register(struct amdgpu_bo *bo, unsigned long addr);
  void amdgpu_mn_unregister(struct amdgpu_bo *bo);
  void amdgpu_hmm_init_range(struct hmm_range *range);
  #else
+
+struct amdgpu_mn;
+
  static inline void amdgpu_mn_lock(struct amdgpu_mn *mn) {}
  static inline void amdgpu_mn_unlock(struct amdgpu_mn *mn) {}
  static inline struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev,

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx