Skip to contentSkip to conversation

drm/amdgpu: Fix build without CONFIG_HMM_MIRROR

PATCH In review YueHaibing 2 participants 2 messages Jul 9, 2019

Subsystems (2)
lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix build without CONFIG_HMM_MIRROR

If CONFIG_HMM_MIRROR is not set, building may fails:

In file included from drivers/gpu/drm/amd/amdgpu/amdgpu.h:72:0,
from drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:40:
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h:69:20: error: field mirror has incomplete type
struct hmm_mirror mirror;

Fixes 7590f6d211ec ("drm/amdgpu: Prepare for hmm_range_register API change")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h +2 -0
index 281fd9f..b14f175 100644
@@ -65,8 +65,10 @@ struct amdgpu_mn {
 	struct rw_semaphore	lock;
 	struct rb_root_cached	objects;
 
+#if defined(CONFIG_HMM_MIRROR)
 	/* HMM mirror */
 	struct hmm_mirror	mirror;
+#endif
 };
 
 #if defined(CONFIG_HMM_MIRROR)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 10 lines · YueHaibing

If CONFIG_HMM_MIRROR is not set, building may fails:

In file included from drivers/gpu/drm/amd/amdgpu/amdgpu.h:72:0,
from drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:40:
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h:69:20: error: field mirror has incomplete type
struct hmm_mirror mirror;

Fixes 7590f6d211ec ("drm/amdgpu: Prepare for hmm_range_register API change")

I already applied a similar patch from Arnd.

Thanks,

Alex

Quoted 23 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h +2 -1
index 281fd9f..b14f175 100644
@@ -65,8 +65,10 @@ struct amdgpu_mn {
        struct rw_semaphore     lock;
        struct rb_root_cached   objects;
 
+#if defined(CONFIG_HMM_MIRROR)
        /* HMM mirror */
        struct hmm_mirror       mirror;
+#endif
 };
 
 #if defined(CONFIG_HMM_MIRROR)
--

2.7.4

Quoted 4 lines

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

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