diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2020-04-10 20:17:07 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2020-05-19 21:03:27 +0100 |
commit | 69f25d6a29b3939e8f14fcc871ba9820e9465562 (patch) | |
tree | 35b7a59dce132d3ab3136eb6c91f3e7817f29587 | |
parent | 24c0c44c8d2bad5d65990e86b66fd01f779fa7fe (diff) | |
download | external_libdrm-69f25d6a29b3939e8f14fcc871ba9820e9465562.tar.gz external_libdrm-69f25d6a29b3939e8f14fcc871ba9820e9465562.tar.bz2 external_libdrm-69f25d6a29b3939e8f14fcc871ba9820e9465562.zip |
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>
-rw-r--r-- | tests/modetest/modetest.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index baea38583..84cce0d7e 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -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); |