linux/drivers/accel/Kconfig
Arnd Bergmann 9f20c9f4b1 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: 8bf4889762 ("drivers/accel: define kconfig and register a new major")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230127221504.2522909-1-arnd@kernel.org
(cherry picked from commit 3524c96a12)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2023-02-01 11:18:46 +01:00

31 lines
1.0 KiB
Plaintext

# SPDX-License-Identifier: GPL-2.0-only
#
# Compute Acceleration device configuration
#
# This framework provides support for compute acceleration devices, such
# as, but not limited to, Machine-Learning and Deep-Learning acceleration
# devices
#
if DRM
menuconfig DRM_ACCEL
bool "Compute Acceleration Framework"
help
Framework for device drivers of compute acceleration devices, such
as, but not limited to, Machine-Learning and Deep-Learning
acceleration devices.
If you say Y here, you need to select the module that's right for
your acceleration device from the list below.
This framework is integrated with the DRM subsystem as compute
accelerators and GPUs share a lot in common and can use almost the
same infrastructure code.
Having said that, acceleration devices will have a different
major number than GPUs, and will be exposed to user-space using
different device files, called accel/accel* (in /dev, sysfs
and debugfs).
source "drivers/accel/habanalabs/Kconfig"
source "drivers/accel/ivpu/Kconfig"
endif