1 From 1ddfbb0af0c23a845e941f4e49c6a65358b1c58e Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 1 Dec 2022 13:37:20 +0100
4 Subject: [PATCH] drm/tests: Introduce a config option for the KUnit
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 Driver-specific tests will need access to the helpers without pulling
11 every DRM framework test. Let's create an intermediate Kconfig options
14 Suggested-by: MaĆra Canal <mcanal@igalia.com>
15 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
17 drivers/gpu/drm/Kconfig | 7 +++++++
18 drivers/gpu/drm/Makefile | 2 +-
19 drivers/gpu/drm/tests/Makefile | 4 +++-
20 3 files changed, 11 insertions(+), 2 deletions(-)
22 --- a/drivers/gpu/drm/Kconfig
23 +++ b/drivers/gpu/drm/Kconfig
24 @@ -64,6 +64,12 @@ config DRM_USE_DYNAMIC_DEBUG
25 bytes per callsite, the .data costs can be substantial, and
26 are therefore configurable.
28 +config DRM_KUNIT_TEST_HELPERS
30 + depends on DRM && KUNIT
32 + KUnit Helpers for KMS drivers.
35 tristate "KUnit tests for DRM" if !KUNIT_ALL_TESTS
36 depends on DRM && KUNIT
37 @@ -74,6 +80,7 @@ config DRM_KUNIT_TEST
40 select DRM_EXPORT_FOR_TESTS if m
41 + select DRM_KUNIT_TEST_HELPERS
42 default KUNIT_ALL_TESTS
44 This builds unit tests for DRM. This option is not useful for
45 --- a/drivers/gpu/drm/Makefile
46 +++ b/drivers/gpu/drm/Makefile
47 @@ -77,7 +77,7 @@ obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_
48 # Drivers and the rest
51 -obj-$(CONFIG_DRM_KUNIT_TEST) += tests/
54 obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
55 obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
56 --- a/drivers/gpu/drm/tests/Makefile
57 +++ b/drivers/gpu/drm/tests/Makefile
59 # SPDX-License-Identifier: GPL-2.0
61 +obj-$(CONFIG_DRM_KUNIT_TEST_HELPERS) += \
64 obj-$(CONFIG_DRM_KUNIT_TEST) += \
66 drm_cmdline_parser_test.o \
67 @@ -8,7 +11,6 @@ obj-$(CONFIG_DRM_KUNIT_TEST) += \
68 drm_format_helper_test.o \
70 drm_framebuffer_test.o \
71 - drm_kunit_helpers.o \
73 drm_plane_helper_test.o \