Commit 0e6fec6d authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Lucas De Marchi

drm/xe/kunit: fix link failure with built-in xe

When the driver is built-in but the tests are in loadable modules,
the helpers don't actually get put into the driver:

ERROR: modpost: "xe_kunit_helper_alloc_xe_device" [drivers/gpu/drm/xe/tests/xe_test.ko] undefined!

Change the Makefile to ensure they are always part of the driver
even when the rest of the kunit tests are in loadable modules.

Fixes: 5095d13d ("drm/xe/kunit: Define helper functions to allocate fake xe device")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240226124736.1272949-1-arnd@kernel.orgSigned-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 158900ad
...@@ -10,6 +10,7 @@ config DRM_XE ...@@ -10,6 +10,7 @@ config DRM_XE
select DRM_BUDDY select DRM_BUDDY
select DRM_EXEC select DRM_EXEC
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n
select DRM_PANEL select DRM_PANEL
select DRM_SUBALLOC_HELPER select DRM_SUBALLOC_HELPER
select DRM_DISPLAY_DP_HELPER select DRM_DISPLAY_DP_HELPER
......
...@@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST ...@@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST
depends on DRM_XE && KUNIT && DEBUG_FS depends on DRM_XE && KUNIT && DEBUG_FS
default KUNIT_ALL_TESTS default KUNIT_ALL_TESTS
select DRM_EXPORT_FOR_TESTS if m select DRM_EXPORT_FOR_TESTS if m
select DRM_KUNIT_TEST_HELPERS
help help
Choose this option to allow the driver to perform selftests under Choose this option to allow the driver to perform selftests under
the kunit framework the kunit framework
......
...@@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \ ...@@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \
xe_lmtt_2l.o \ xe_lmtt_2l.o \
xe_lmtt_ml.o xe_lmtt_ml.o
xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \ # include helpers for tests even when XE is built-in
tests/xe_kunit_helpers.o ifdef CONFIG_DRM_XE_KUNIT_TEST
xe-y += tests/xe_kunit_helpers.o
endif
# i915 Display compat #defines and #includes # i915 Display compat #defines and #includes
subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
......
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