From: Boris Brezillon <[email protected]>

When Tyr uses GEM_SHMEM_HELPER and GPUVM, these helpers must be enabled
or the build will fail with undefined symbol errors like:
  "ld.lld: error: undefined symbol: drm_gem_shmem_free"

Introduce DRM_TYR_STATIC_DEPS and have Tyr select the required
abstractions to ensure that they are enabled when Tyr is built.

Also add MMU and IOMMU dependencies that will be required to boot
the firmware.

Signed-off-by: Boris Brezillon <[email protected]>
Signed-off-by: Deborah Brouwer <[email protected]>
---
 drivers/gpu/drm/tyr/Kconfig | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tyr/Kconfig b/drivers/gpu/drm/tyr/Kconfig
index 4b55308fd2eb..c521fbd950ea 100644
--- a/drivers/gpu/drm/tyr/Kconfig
+++ b/drivers/gpu/drm/tyr/Kconfig
@@ -1,11 +1,23 @@
 # SPDX-License-Identifier: GPL-2.0 or MIT
 
+config DRM_TYR_STATIC_DEPS
+       bool
+       select DRM_GEM_SHMEM_HELPER
+       select DRM_GPUVM
+       help
+         Ensure required DRM infrastructure is built-in when enabling Tyr
+         even if Tyr is =m
+
 config DRM_TYR
        tristate "Tyr (Rust DRM support for ARM Mali CSF-based GPUs)"
        depends on DRM=y
        depends on RUST
        depends on ARM || ARM64 || COMPILE_TEST
        depends on !GENERIC_ATOMIC64  # for IOMMU_IO_PGTABLE_LPAE
+       depends on MMU
+       select DRM_TYR_STATIC_DEPS
+       select IOMMU_IO_PGTABLE_LPAE
+       depends on IOMMU_SUPPORT
        default n
        help
          Rust DRM driver for ARM Mali CSF-based GPUs.
@@ -15,5 +27,5 @@ config DRM_TYR
          Note that the Mali-G68 and Mali-G78, while Valhall architecture, will
          be supported with the panfrost driver as they are not CSF GPUs.
 
-         if M is selected, the module will be called tyr. This driver is work
+         If M is selected, the module will be called tyr. This driver is work
          in progress and may not be functional.
-- 
2.52.0

Reply via email to