Skip to contentSkip to conversation

drm/amdgpu: fix building without CONFIG_HMM_MIRROR

PATCH Applied Arnd Bergmann 2 participants 2 messages Jul 8, 2019

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

PATCH 1/1 drm/amdgpu: fix building without CONFIG_HMM_MIRROR

'struct hmm_mirror' is not defined without the Kconfig option set, so we cannot include it within another struct:

In file included from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:72:
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_mn.h:69:20: error: field has incomplete type 'struct hmm_mirror'

        struct hmm_mirror       mirror;
                                ^
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_mn.h:69:9: note: forward declaration of 'struct hmm_mirror'
        struct hmm_mirror       mirror;

Add the #ifdef around it that is also used for all functions operating on it.

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 281fd9fef662..b8ed68943625 100644
@@ -65,8 +65,10 @@ struct amdgpu_mn {
 	struct rw_semaphore	lock;
 	struct rb_root_cached	objects;
 
+#ifdef CONFIG_HMM_MIRROR
 	/* HMM mirror */
 	struct hmm_mirror	mirror;
+#endif
 };
 
 #if defined(CONFIG_HMM_MIRROR)
Signature · 6 lines
2.20.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw
Quoted 11 lines · Arnd Bergmann

'struct hmm_mirror' is not defined without the Kconfig option set, so we cannot include it within another struct:

In file included from drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu.h:72:
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_mn.h:69:20: error: field has incomplete type 'struct hmm_mirror'

        struct hmm_mirror       mirror;
                                ^
drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_mn.h:69:9: note: forward declaration of 'struct hmm_mirror'
        struct hmm_mirror       mirror;
Quoted 5 lines

Add the #ifdef around it that is also used for all functions operating on it.

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

Applied. thanks!

Alex

Quoted 22 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 281fd9fef662..b8ed68943625 100644
@@ -65,8 +65,10 @@ struct amdgpu_mn {
        struct rw_semaphore     lock;
        struct rb_root_cached   objects;
 
+#ifdef CONFIG_HMM_MIRROR
        /* HMM mirror */
        struct hmm_mirror       mirror;
+#endif
 };
 
 #if defined(CONFIG_HMM_MIRROR)
--

2.20.0

Quoted 4 lines

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

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