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>main
parent
e341176d9f
commit
a04c8abb86
|
@ -2055,7 +2055,10 @@ int main(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count)
|
||||||
set_mode(&dev, pipe_args, count);
|
set_mode(&dev, pipe_args, count);
|
||||||
|
|
||||||
|
if (plane_count)
|
||||||
atomic_set_planes(&dev, plane_args, plane_count, false);
|
atomic_set_planes(&dev, plane_args, plane_count, false);
|
||||||
|
|
||||||
ret = drmModeAtomicCommit(dev.fd, dev.req, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
|
ret = drmModeAtomicCommit(dev.fd, dev.req, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
|
||||||
|
@ -2075,12 +2078,17 @@ int main(int argc, char **argv)
|
||||||
drmModeAtomicFree(dev.req);
|
drmModeAtomicFree(dev.req);
|
||||||
dev.req = drmModeAtomicAlloc();
|
dev.req = drmModeAtomicAlloc();
|
||||||
|
|
||||||
atomic_clear_mode(&dev, pipe_args, count);
|
if (plane_count)
|
||||||
atomic_clear_planes(&dev, plane_args, 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);
|
ret = drmModeAtomicCommit(dev.fd, dev.req, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
fprintf(stderr, "Atomic Commit failed\n");
|
fprintf(stderr, "Atomic Commit failed\n");
|
||||||
|
|
||||||
|
if (plane_count)
|
||||||
atomic_clear_FB(&dev, plane_args, plane_count);
|
atomic_clear_FB(&dev, plane_args, plane_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue