From 0732cc59abc06151b8756a6890f13885cde7403b Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 22 May 2012 12:01:36 +0200 Subject: tests: use drm_open_any more And fix it up to not leak open fds, which kills all the master only stuff. --- tests/flip_test.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'tests/flip_test.c') diff --git a/tests/flip_test.c b/tests/flip_test.c index 283d19d0..9aef688c 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -494,29 +494,11 @@ static int run_test(void) int main(int argc, char **argv) { - const char *modules[] = { "i915" }; - unsigned int i; - int ret = 0; - - for (i = 0; i < ARRAY_SIZE(modules); i++) { - drm_fd = drmOpen(modules[i], NULL); - if (drm_fd < 0) { - printf("failed to load %s driver.\n", modules[i]); - goto out; - } else - break; - } - - if (i == ARRAY_SIZE(modules)) { - fprintf(stderr, "failed to load any modules, aborting.\n"); - ret = -1; - goto out_close; - } + drm_fd = drm_open_any(); run_test(); -out_close: - drmClose(drm_fd); -out: - return ret; + close(drm_fd); + + return 0; } -- cgit v1.2.3