[PATCH 1/4] drm/amd/display: Refactor AMD display KUnit tests configs

Joao Paulo Pereira da Silva jppaulo11 at usp.br
Sat Apr 20 18:48:16 UTC 2024


Configs in AMD display KUnit tests can be clarified. Remove unnecessary
configs, rename configs to follow a pattern, and update config Help
blocks.

Signed-off-by: Joao Paulo Pereira da Silva <jppaulo11 at usp.br>
---
 drivers/gpu/drm/amd/display/Kconfig           | 31 ++++++-------------
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 +-
 .../dc/dml/dcn20/display_mode_vba_20.c        |  2 +-
 .../dc/dml/dcn20/display_rq_dlg_calc_20.c     |  2 +-
 .../drm/amd/display/test/kunit/.kunitconfig   |  7 ++---
 .../gpu/drm/amd/display/test/kunit/Makefile   |  4 +--
 6 files changed, 17 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
index 11b0e54262f3..b2760adb3da9 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -51,25 +51,25 @@ config DRM_AMD_SECURE_DISPLAY
 	  This option enables the calculation of crc of specific region via
 	  debugfs. Cooperate with specific DMCU FW.
 
-config DCE_KUNIT_TEST
-	bool "Run all KUnit tests for DCE" if !KUNIT_ALL_TESTS
+config DRM_AMD_DC_KUNIT_TEST
+	bool "Enable KUnit tests for the root of DC" if !KUNIT_ALL_TESTS
 	depends on DRM_AMD_DC && KUNIT
 	default KUNIT_ALL_TESTS
 	help
-		Enables unit tests for the Display Controller Engine. Only useful for kernel
-		devs running KUnit.
+		Enables unit tests for files in the root of the Display Core directory.
+		Only useful for kernel devs running KUnit.
 
 		For more information on KUnit and unit tests in general please refer to
 		the KUnit documentation in Documentation/dev-tools/kunit/.
 
 		If unsure, say N.
 
-config DML_KUNIT_TEST
+config DRM_AMD_DC_DML_KUNIT_TEST
 	bool "Run all KUnit tests for DML" if !KUNIT_ALL_TESTS
 	depends on DRM_AMD_DC_FP && KUNIT
 	default KUNIT_ALL_TESTS
 	help
-		Enables unit tests for the Display Controller Engine. Only useful for kernel
+		Enables unit tests for the Display Controller Next. Only useful for kernel
 		devs running KUnit.
 
 		For more information on KUnit and unit tests in general please refer to
@@ -77,26 +77,13 @@ config DML_KUNIT_TEST
 
 		If unsure, say N.
 
-config AMD_DC_BASICS_KUNIT_TEST
+config DRM_AMD_DC_BASICS_KUNIT_TEST
 	bool "Enable KUnit tests for the 'basics' sub-component of DAL" if !KUNIT_ALL_TESTS
 	depends on DRM_AMD_DC && KUNIT
 	default KUNIT_ALL_TESTS
 	help
-		Enables unit tests for the Display Core. Only useful for kernel
-		devs running KUnit.
-
-		For more information on KUnit and unit tests in general please refer to
-		the KUnit documentation in Documentation/dev-tools/kunit/.
-
-		If unsure, say N.
-
-config AMD_DC_KUNIT_TEST
-	bool "Enable KUnit tests for the 'utils' sub-component of DAL" if !KUNIT_ALL_TESTS
-	depends on DRM_AMD_DC && KUNIT
-	default KUNIT_ALL_TESTS
-	help
-		Enables unit tests for the basics folder of Display Core. Only useful for
-		kernel devs running KUnit.
+		Enables unit tests for the basics folder of the Display Core. Only useful
+		for kernel devs running KUnit.
 
 		For more information on KUnit and unit tests in general please refer to
 		the KUnit documentation in Documentation/dev-tools/kunit/.
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 7aafdfeac60e..7efd4768b0d7 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -1439,6 +1439,6 @@ bool dc_wake_and_execute_gpint(const struct dc_context *ctx, enum dmub_gpint_com
 	return result;
 }
 
-#if IS_ENABLED(CONFIG_AMD_DC_KUNIT_TEST)
+#if IS_ENABLED(CONFIG_DRM_AMD_DC_KUNIT_TEST)
 #include "../test/kunit/dc/dc_dmub_srv_test.c"
 #endif
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
index aea6e29fd6e5..5c5be75c08e0 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
@@ -5117,6 +5117,6 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 	}
 }
 
-#if IS_ENABLED(CONFIG_DML_KUNIT_TEST)
+#if IS_ENABLED(CONFIG_DRM_AMD_DC_DML_KUNIT_TEST)
 #include "../../test/kunit/dc/dml/dcn20/display_mode_vba_20_test.c"
 #endif
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
index 45f75a7f84c7..aab34156e9ae 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.c
@@ -1684,6 +1684,6 @@ static void calculate_ttu_cursor(struct display_mode_lib *mode_lib,
 	}
 }
 
-#if IS_ENABLED(CONFIG_DML_KUNIT_TEST)
+#if IS_ENABLED(CONFIG_DRM_AMD_DC_DML_KUNIT_TEST)
 #include "../../../test/kunit/dc/dml/dcn20/display_rq_dlg_calc_20_test.c"
 #endif
diff --git a/drivers/gpu/drm/amd/display/test/kunit/.kunitconfig b/drivers/gpu/drm/amd/display/test/kunit/.kunitconfig
index 4c5861ad58bd..1dede9da74d3 100644
--- a/drivers/gpu/drm/amd/display/test/kunit/.kunitconfig
+++ b/drivers/gpu/drm/amd/display/test/kunit/.kunitconfig
@@ -3,7 +3,6 @@ CONFIG_PCI=y
 CONFIG_DRM=y
 CONFIG_DRM_AMDGPU=y
 CONFIG_DRM_AMD_DC=y
-CONFIG_AMD_DC_BASICS_KUNIT_TEST=y
-CONFIG_AMD_DC_KUNIT_TEST=y
-CONFIG_DCE_KUNIT_TEST=y
-CONFIG_DML_KUNIT_TEST=y
+CONFIG_DRM_AMD_DC_BASICS_KUNIT_TEST=y
+CONFIG_DRM_AMD_DC_KUNIT_TEST=y
+CONFIG_DRM_AMD_DC_DML_KUNIT_TEST=y
diff --git a/drivers/gpu/drm/amd/display/test/kunit/Makefile b/drivers/gpu/drm/amd/display/test/kunit/Makefile
index a6ad449f9885..4eb08477d6dc 100644
--- a/drivers/gpu/drm/amd/display/test/kunit/Makefile
+++ b/drivers/gpu/drm/amd/display/test/kunit/Makefile
@@ -3,11 +3,11 @@
 # Makefile for the KUnit Tests for DC
 #
 
-ifdef CONFIG_AMD_DC_BASICS_KUNIT_TEST
+ifdef CONFIG_DRM_AMD_DC_BASICS_KUNIT_TEST
 	DC_TESTS += dc/basics/fixpt31_32_test.o
 endif
 
-ifdef CONFIG_DML_KUNIT_TEST
+ifdef CONFIG_DRM_AMD_DC_DML_KUNIT_TEST
 	CFLAGS_$(AMDDALPATH)/test/kunit/dc/dml/display_mode_vba_test.o := $(dml_ccflags)
 	CFLAGS_$(AMDDALPATH)/test/kunit/dc/dml/dcn20/dcn20_fpu_test.o := $(dml_ccflags)
 	DC_TESTS += dc/dml/display_mode_vba_test.o dc/dml/dcn20/dcn20_fpu_test.o
-- 
2.44.0



More information about the amd-gfx mailing list