diff options
author | Emil Velikov <emil.velikov@collabora.com> | 2020-04-15 10:37:24 +0100 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2020-05-19 21:09:35 +0100 |
commit | a04c8abb86362e39a5a74caddf923356dec8d61f (patch) | |
tree | aafb8c1c1d9a9187a0052da7e473a4f90b7aeb15 | |
parent | e341176d9f6c33f47e6887411644abca7f68be81 (diff) | |
download | external_libdrm-a04c8abb86362e39a5a74caddf923356dec8d61f.tar.gz external_libdrm-a04c8abb86362e39a5a74caddf923356dec8d61f.tar.bz2 external_libdrm-a04c8abb86362e39a5a74caddf923356dec8d61f.zip |
modetest: reorder atomic path alike the non-atomic
Makes the code a tiny bit more symmetrical.
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 | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 7ab73a07f..95eab98c2 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -2055,8 +2055,11 @@ int main(int argc, char **argv) return 1; } - set_mode(&dev, pipe_args, count); - atomic_set_planes(&dev, plane_args, plane_count, false); + if (count) + set_mode(&dev, pipe_args, count); + + if (plane_count) + atomic_set_planes(&dev, plane_args, plane_count, false); ret = drmModeAtomicCommit(dev.fd, dev.req, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL); if (ret) { @@ -2075,13 +2078,18 @@ int main(int argc, char **argv) drmModeAtomicFree(dev.req); dev.req = drmModeAtomicAlloc(); - atomic_clear_mode(&dev, pipe_args, count); - atomic_clear_planes(&dev, plane_args, plane_count); + if (plane_count) + atomic_clear_planes(&dev, plane_args, plane_count); + + if (count) + atomic_clear_mode(&dev, pipe_args, count); + ret = drmModeAtomicCommit(dev.fd, dev.req, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL); if (ret) fprintf(stderr, "Atomic Commit failed\n"); - atomic_clear_FB(&dev, plane_args, plane_count); + if (plane_count) + atomic_clear_FB(&dev, plane_args, plane_count); } drmModeAtomicFree(dev.req); |