Commit 9f20c9f4 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Thomas Zimmermann

accel: fix CONFIG_DRM dependencies

At the moment, accel drivers can be built-in even with CONFIG_DRM=m,
but this causes a link failure:

x86_64-linux-ld: drivers/accel/ivpu/ivpu_drv.o: in function `ivpu_dev_init':
ivpu_drv.c:(.text+0x1535): undefined reference to `drmm_kmalloc'
x86_64-linux-ld: ivpu_drv.c:(.text+0x1562): undefined reference to `drmm_kmalloc'
x86_64-linux-ld: drivers/accel/ivpu/ivpu_drv.o: in function `ivpu_remove':
ivpu_drv.c:(.text+0x1faa): undefined reference to `drm_dev_unregister'
x86_64-linux-ld: drivers/accel/ivpu/ivpu_drv.o: in function `ivpu_probe':
ivpu_drv.c:(.text+0x1fef): undefined reference to `__devm_drm_dev_alloc'

The problem is that DRM_ACCEL is a 'bool' symbol, so driver that
only depend on DRM_ACCEL but not also on DRM do not see the restriction
to =m configs.

To ensure that each accel driver has an implied dependency on CONFIG_DRM,
enclose the entire Kconfig file in an if/endif check.

Fixes: 8bf48897 ("drivers/accel: define kconfig and register a new major")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: default avatarJeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230127221504.2522909-1-arnd@kernel.org
(cherry picked from commit 3524c96a)
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
parent 3ad8173b
...@@ -6,9 +6,10 @@ ...@@ -6,9 +6,10 @@
# as, but not limited to, Machine-Learning and Deep-Learning acceleration # as, but not limited to, Machine-Learning and Deep-Learning acceleration
# devices # devices
# #
if DRM
menuconfig DRM_ACCEL menuconfig DRM_ACCEL
bool "Compute Acceleration Framework" bool "Compute Acceleration Framework"
depends on DRM
help help
Framework for device drivers of compute acceleration devices, such Framework for device drivers of compute acceleration devices, such
as, but not limited to, Machine-Learning and Deep-Learning as, but not limited to, Machine-Learning and Deep-Learning
...@@ -25,3 +26,5 @@ menuconfig DRM_ACCEL ...@@ -25,3 +26,5 @@ menuconfig DRM_ACCEL
source "drivers/accel/habanalabs/Kconfig" source "drivers/accel/habanalabs/Kconfig"
source "drivers/accel/ivpu/Kconfig" source "drivers/accel/ivpu/Kconfig"
endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment