aboutsummaryrefslogtreecommitdiffstats
path: root/drmtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drmtest.c')
-rw-r--r--drmtest.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drmtest.c b/drmtest.c
index 09c76a7..89556be 100644
--- a/drmtest.c
+++ b/drmtest.c
@@ -222,16 +222,24 @@ int main(int argc, char **argv)
}
exit(1);
}
- } else {
+ }
+
+ drm_init_dev(card, output, modename, false);
+
+ if (!fmt) {
for (i = 0; i < fmtcnt; i++) {
if (!drm_probe_format(fd, &fmts[i]))
continue;
fmt = &fmts[i];
break;
}
+ if (!fmt) {
+ drm_fini_dev();
+ fprintf(stderr, "Huh? No working drm format found.\n");
+ exit(1);
+ }
}
- drm_init_dev(card, output, modename, false);
drm_init_dumb_fb();
drm_draw_dumb_fb();
drm_show_fb();