modetest: move basic args check before open()
Don't bother opening the device node, if the args combination is invalid Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Tested-by: Ezequiel Garcia <ezequiel@collabora.com>main
parent
24c0c44c8d
commit
69f25d6a29
|
@ -2013,6 +2013,11 @@ int main(int argc, char **argv)
|
|||
if (!args)
|
||||
encoders = connectors = crtcs = planes = framebuffers = 1;
|
||||
|
||||
if (test_vsync && !count) {
|
||||
fprintf(stderr, "page flipping requires at least one -s option.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
dev.fd = util_open(device, module);
|
||||
if (dev.fd < 0)
|
||||
return -1;
|
||||
|
@ -2026,11 +2031,6 @@ int main(int argc, char **argv)
|
|||
|
||||
dev.use_atomic = use_atomic;
|
||||
|
||||
if (test_vsync && !count) {
|
||||
fprintf(stderr, "page flipping requires at least one -s option.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
dev.resources = get_resources(&dev);
|
||||
if (!dev.resources) {
|
||||
drmClose(dev.fd);
|
||||
|
|
Loading…
Reference in New Issue