]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/i915: Fix selecting CONFIG_DRM_KUNIT_TEST in debug builds
authorImre Deak <imre.deak@intel.com>
Thu, 24 Jul 2025 09:02:37 +0000 (12:02 +0300)
committerImre Deak <imre.deak@intel.com>
Fri, 25 Jul 2025 08:41:55 +0000 (11:41 +0300)
commit16d2a92e7ec8c7828069f86a0aa7974acafb7e57
tree994145ac16305c3513446e519fb8202f16d7e245
parentcdb16039515a5ac4d2c923f7a651cf19a803a3fe
drm/i915: Fix selecting CONFIG_DRM_KUNIT_TEST in debug builds

Selecting an option which depends on other options only works if the
dependencies are guaranteed to be selected (as these dependencies will
not be automatically selected). CONFIG_DRM_KUNIT_TEST depends on DRM,
MMU and KUNIT the first two of which are guaranteed to be selected for
i915, but the last one is not. Hence, selecting CONFIG_DRM_KUNIT_TEST in
i915 debug builds may result in CONFIG_DRM_KUNIT_TEST being selected
without the CONFIG_KUNIT dependency being selected. This causes at least
the following compile error:

drivers/gpu/drm/tests/drm_bridge_test.c: In function ‘drm_test_bridge_alloc_init’:
drivers/gpu/drm/tests/drm_bridge_test.c:449:21: error: implicit declaration of function ‘kunit_device_register’; did you mean ‘root_device_register’? [-Werror=implicit-function-declaration]
  449 |         priv->dev = kunit_device_register(test, "drm-bridge-dev");

Fix the above by selecting CONFIG_DRM_KUNIT_TEST only if CONFIG_KUNIT is
also selected.

Fixes: 17133255a322 ("drm/i915: replace DRM_DEBUG_SELFTEST with DRM_KUNIT_TEST")
Cc: Ruben Wauters <rubenru09@aol.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250724090237.92040-1-imre.deak@intel.com
drivers/gpu/drm/i915/Kconfig.debug