[PATCH 2/4] drm/amd/display/test: Fix kunit test that is not running
Joao Paulo Pereira da Silva
jppaulo11 at usp.br
Sat Apr 20 18:48:17 UTC 2024
The KUnit test file test/kunit/dc/dml/calcs/bw_fixed_test.c does not have the
correct path relative to the file being tested, dc/basics/bw_fixed.c.
Also, it is neither compiling nor running.
Therefore, change the test file path and import it conditionally in the file
dc/basics/bw_fixed.c to make it runnable.
Signed-off-by: Joao Paulo Pereira da Silva <jppaulo11 at usp.br>
---
drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c | 3 +++
.../test/kunit/dc/{dml/calcs => basics}/bw_fixed_test.c | 0
2 files changed, 3 insertions(+)
rename drivers/gpu/drm/amd/display/test/kunit/dc/{dml/calcs => basics}/bw_fixed_test.c (100%)
diff --git a/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c b/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c
index c8cb89e0d4d0..f18945fc84b9 100644
--- a/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c
+++ b/drivers/gpu/drm/amd/display/dc/basics/bw_fixed.c
@@ -186,3 +186,6 @@ struct bw_fixed bw_mul(const struct bw_fixed arg1, const struct bw_fixed arg2)
return res;
}
+#if IS_ENABLED(CONFIG_DRM_AMD_DC_BASICS_KUNIT_TEST)
+#include "../../test/kunit/dc/basics/bw_fixed_test.c"
+#endif
diff --git a/drivers/gpu/drm/amd/display/test/kunit/dc/dml/calcs/bw_fixed_test.c b/drivers/gpu/drm/amd/display/test/kunit/dc/basics/bw_fixed_test.c
similarity index 100%
rename from drivers/gpu/drm/amd/display/test/kunit/dc/dml/calcs/bw_fixed_test.c
rename to drivers/gpu/drm/amd/display/test/kunit/dc/basics/bw_fixed_test.c
--
2.44.0
More information about the amd-gfx
mailing list