Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Move EXPORT_SYMBOL_FOR_TESTS_ONLY under a separate Kconfig

Currently, we only export symbols for drm-selftests which are either
compiled as modules or into the main drm builtin. However, if we want to
export symbols from drm.ko for the drivers' selftests, we require a
means of controlling that export separately. So we add a new Kconfig to
determine whether or not the EXPORT_SYMBOL_FOR_TESTS_ONLY() takes
effect.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191107180601.30815-1-chris@chris-wilson.co.uk

+5 -1
+4
drivers/gpu/drm/Kconfig
··· 54 54 55 55 If in doubt, say "N". 56 56 57 + config DRM_EXPORT_FOR_TESTS 58 + bool 59 + 57 60 config DRM_DEBUG_SELFTEST 58 61 tristate "kselftests for DRM" 59 62 depends on DRM ··· 64 61 select PRIME_NUMBERS 65 62 select DRM_LIB_RANDOM 66 63 select DRM_KMS_HELPER 64 + select DRM_EXPORT_FOR_TESTS if m 67 65 default n 68 66 help 69 67 This option provides kernel modules that can be used to run
+1 -1
include/drm/drm_util.h
··· 41 41 * Use EXPORT_SYMBOL_FOR_TESTS_ONLY() for functions that shall 42 42 * only be visible for drmselftests. 43 43 */ 44 - #if defined(CONFIG_DRM_DEBUG_SELFTEST_MODULE) 44 + #if defined(CONFIG_DRM_EXPORT_FOR_TESTS) 45 45 #define EXPORT_SYMBOL_FOR_TESTS_ONLY(x) EXPORT_SYMBOL(x) 46 46 #else 47 47 #define EXPORT_SYMBOL_FOR_TESTS_ONLY(x)