summaryrefslogtreecommitdiff
path: root/tests/modefb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/modefb')
-rw-r--r--tests/modefb/demo.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/modefb/demo.c b/tests/modefb/demo.c
index 7fa3b93f..b6d1f65b 100644
--- a/tests/modefb/demo.c
+++ b/tests/modefb/demo.c
@@ -26,7 +26,12 @@ int main(int argc, char **argv)
char name[100];
int i,d;
int fd;
- int drmfd = drmOpenControl(0);
+ int drmfd = drmOpen("i915", NULL);
+
+ if (drmfd < 0) {
+ printf("drmOpenControl failed\n");
+ return 1;
+ }
/* try four devices */
for (d = 0; d < 4; d++) {
@@ -38,11 +43,6 @@ int main(int argc, char **argv)
return 1;
}
- if (drmfd < 0) {
- printf("drmOpenControl failed\n");
- return 1;
- }
-
memset(&var, 0, sizeof(struct fb_var_screeninfo));
memset(&fix, 0, sizeof(struct fb_fix_screeninfo));
@@ -79,6 +79,8 @@ int main(int argc, char **argv)
printf("cursor (may show up on wrong CRTC - fixme)\n");
cursor(fd, drmfd);
+
+ close(fd);
}
return 0;
}