summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-01-12 22:35:28 +0100
committerJakob Bornecrantz <jakob@vmware.com>2010-01-12 22:35:28 +0100
commit06a2d6567e5aadc2e109942f71afae76a8398969 (patch)
tree358e05290b979a39193448f297b3798cfbdc15bd
parentd920fa9d0b54873d53f03a006d0fe3df11136b74 (diff)
tests: Update kmstest a bit
-rw-r--r--tests/kmstest/main.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/kmstest/main.c b/tests/kmstest/main.c
index a9023990..bd41b065 100644
--- a/tests/kmstest/main.c
+++ b/tests/kmstest/main.c
@@ -32,7 +32,7 @@
#include "libkms.h"
#define CHECK_RET_RETURN(ret, str) \
- if (ret) { \
+ if (ret < 0) { \
printf("%s: %s (%s)\n", __func__, str, strerror(-ret)); \
return ret; \
}
@@ -56,13 +56,21 @@ int test_bo(struct kms_driver *kms)
return 0;
}
+char *drivers[] = {
+ "i915",
+ "radeon",
+ "vmwgfx",
+ NULL
+};
+
int main(int argc, char** argv)
{
struct kms_driver *kms;
- int ret, fd;
+ int ret, fd, i;
- fd = drmOpen("i915", NULL);
- CHECK_RET_RETURN(ret, "Could not open device");
+ for (i = 0, fd = -1; fd < 0 && drivers[i]; i++)
+ fd = drmOpen(drivers[i], NULL);
+ CHECK_RET_RETURN(fd, "Could not open device");
ret = kms_create(fd, &kms);
CHECK_RET_RETURN(ret, "Failed to create kms driver");