Skip to content

Commit d1d9598

Browse files
arndblucasdemarchi
authored andcommitted
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: 5095d13 ("drm/xe/kunit: Define helper functions to allocate fake xe device") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240226124736.1272949-1-arnd@kernel.org Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> (cherry picked from commit 0e6fec6) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent c6d6a82 commit d1d9598

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

drivers/gpu/drm/xe/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config DRM_XE
1010
select DRM_BUDDY
1111
select DRM_EXEC
1212
select DRM_KMS_HELPER
13+
select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n
1314
select DRM_PANEL
1415
select DRM_SUBALLOC_HELPER
1516
select DRM_DISPLAY_DP_HELPER

drivers/gpu/drm/xe/Kconfig.debug

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST
7676
depends on DRM_XE && KUNIT && DEBUG_FS
7777
default KUNIT_ALL_TESTS
7878
select DRM_EXPORT_FOR_TESTS if m
79-
select DRM_KUNIT_TEST_HELPERS
8079
help
8180
Choose this option to allow the driver to perform selftests under
8281
the kunit framework

drivers/gpu/drm/xe/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \
158158
xe_lmtt_2l.o \
159159
xe_lmtt_ml.o
160160

161-
xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \
162-
tests/xe_kunit_helpers.o
161+
# include helpers for tests even when XE is built-in
162+
ifdef CONFIG_DRM_XE_KUNIT_TEST
163+
xe-y += tests/xe_kunit_helpers.o
164+
endif
163165

164166
# i915 Display compat #defines and #includes
165167
subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \

0 commit comments

Comments
 (0)