Skip to contentSkip to conversation

media: platform: amd: add DRM_AMDGPU dependency

PATCH In review Arnd Bergmann 2 participants 2 messages May 15

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

PATCH 1/1 media: platform: amd: add DRM_AMDGPU dependency

From: Arnd Bergmann <[email protected]>

With DRM_AMDGPU=m and DRM_AMD_ISP=y, it is possible to configura VIDEO_AMD_ISP4_CAPTURE as built-in, but that fails to link:

aarch64-linux-ld: drivers/media/platform/amd/isp4/isp4_interface.o: in function `isp4if_gpu_mem_alloc.isra.0':
isp4_interface.c:(.text+0x1d0): undefined reference to `isp_kernel_buffer_alloc'
aarch64-linux-ld: drivers/media/platform/amd/isp4/isp4_interface.o: in function `isp4if_dealloc_fw_gpumem':
isp4_interface.c:(.text+0x26c): undefined reference to `isp_kernel_buffer_free'

Add a dependency on the tristate DRM_AMDGPU symbol in addition to the boolean DRM_AMD_ISP=y, so this can only be built-in if the ISP driver is also linked into the kernel itself.

Fixes 9a54c285630c ("media: platform: amd: Introduce amd isp4 capture driver")
---
 drivers/media/platform/amd/isp4/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/amd/isp4/Kconfig +3 -1
index 55dd2dc453a2..9d1927af1cb8 100644
@@ -2,7 +2,9 @@
 
 config VIDEO_AMD_ISP4_CAPTURE
 	tristate "AMD ISP4 and camera driver"
-	depends on DRM_AMD_ISP && VIDEO_DEV && HAS_DMA
+	depends on DRM_AMDGPU && DRM_AMD_ISP
+	depends on HAS_DMA
+	depends on VIDEO_DEV
 	select VIDEOBUF2_CORE
 	select VIDEOBUF2_MEMOPS
 	select VIDEOBUF2_V4L2
Signature · 1 line
2.39.5
maintainer Reviewed-by Tested-by on v1 1/1
#1 lore raw

Hi Arnd,

Thanks for the fix.

Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

With DRM_AMDGPU=m and DRM_AMD_ISP=y, it is possible to configura VIDEO_AMD_ISP4_CAPTURE as built-in, but that fails to link:

aarch64-linux-ld: drivers/media/platform/amd/isp4/isp4_interface.o: in function `isp4if_gpu_mem_alloc.isra.0':
isp4_interface.c:(.text+0x1d0): undefined reference to `isp_kernel_buffer_alloc'
aarch64-linux-ld: drivers/media/platform/amd/isp4/isp4_interface.o: in function `isp4if_dealloc_fw_gpumem':
isp4_interface.c:(.text+0x26c): undefined reference to `isp_kernel_buffer_free'

I verified this. Reproducing the link failure on the unpatched tree also requires CONFIG_MEDIA_SUPPORT=y and CONFIG_VIDEO_DEV=y; otherwise Kconfig downgrades CONFIG_VIDEO_AMD_ISP4_CAPTURE to m.

Quoted 15 lines

Add a dependency on the tristate DRM_AMDGPU symbol in addition to the boolean DRM_AMD_ISP=y, so this can only be built-in if the ISP driver is also linked into the kernel itself.

Fixes 9a54c285630c ("media: platform: amd: Introduce amd isp4 capture driver")
---
 drivers/media/platform/amd/isp4/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/amd/isp4/Kconfig +0 -0
index 55dd2dc453a2..9d1927af1cb8 100644

drivers/media/platform/amd/isp4/Kconfig line 10

Quoted 10 lines
drivers/media/platform/amd/isp4/Kconfig +3 -1
@@ -2,7 +2,9 @@
 
 config VIDEO_AMD_ISP4_CAPTURE
 	tristate "AMD ISP4 and camera driver"
-	depends on DRM_AMD_ISP && VIDEO_DEV && HAS_DMA
+	depends on DRM_AMDGPU && DRM_AMD_ISP
+	depends on HAS_DMA
+	depends on VIDEO_DEV
 	select VIDEOBUF2_CORE
 	select VIDEOBUF2_MEMOPS
 	select VIDEOBUF2_V4L2

With this patch applied, olddefconfig correctly changes CONFIG_VIDEO_AMD_ISP4_CAPTURE to m when CONFIG_DRM_AMDGPU=m, avoiding the link failure.