Commit e5176727 authored by Alexandru Gheorghe's avatar Alexandru Gheorghe

drm/selftest: Refactor test-drm_plane_helper

The idea is to split test implementations in different compilation
units, but have one single place where we define the list of tests,
in this case(drm_modeset_selftests.h).
Signed-off-by: default avatarAlexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181019105752.17741-9-alexandru-cosmin.gheorghe@arm.com
parent 9c71a668
...@@ -7,9 +7,18 @@ ...@@ -7,9 +7,18 @@
#include "test-drm_modeset_common.h" #include "test-drm_modeset_common.h"
#define TESTS "drm_modeset_selftests.h"
#include "drm_selftest.h"
#include "drm_selftest.c"
static int __init test_drm_modeset_init(void) static int __init test_drm_modeset_init(void)
{ {
return test_drm_plane_helper(); int err;
err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL);
return err > 0 ? 0 : err;
} }
static void __exit test_drm_modeset_exit(void) static void __exit test_drm_modeset_exit(void)
......
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
#define FAIL_ON(x) FAIL((x), "%s", "FAIL_ON(" __stringify(x) ")\n") #define FAIL_ON(x) FAIL((x), "%s", "FAIL_ON(" __stringify(x) ")\n")
int test_drm_plane_helper(void); int igt_check_plane_state(void *ignored);
#endif #endif
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
#include "test-drm_modeset_common.h" #include "test-drm_modeset_common.h"
#define TESTS "drm_plane_helper_selftests.h"
#include "drm_selftest.h"
static void set_src(struct drm_plane_state *plane_state, static void set_src(struct drm_plane_state *plane_state,
unsigned src_x, unsigned src_y, unsigned src_x, unsigned src_y,
unsigned src_w, unsigned src_h) unsigned src_w, unsigned src_h)
...@@ -76,7 +73,7 @@ static bool check_crtc_eq(struct drm_plane_state *plane_state, ...@@ -76,7 +73,7 @@ static bool check_crtc_eq(struct drm_plane_state *plane_state,
return true; return true;
} }
static int igt_check_plane_state(void *ignored) int igt_check_plane_state(void *ignored)
{ {
int ret; int ret;
...@@ -220,17 +217,3 @@ static int igt_check_plane_state(void *ignored) ...@@ -220,17 +217,3 @@ static int igt_check_plane_state(void *ignored)
return 0; return 0;
} }
#include "drm_selftest.c"
/**
* test_drm_plane_helper - Run drm plane helper selftests.
*/
int test_drm_plane_helper(void)
{
int err;
err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL);
return err > 0 ? 0 : err;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment