modetest: set atomic cap, _only_ when needed

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Ezequiel Garcia <ezequiel@collabora.com>
main
Emil Velikov 2020-04-10 18:31:18 +01:00 committed by Emil Velikov
parent 69f25d6a29
commit 900ed60848
1 changed files with 7 additions and 5 deletions

View File

@ -2022,11 +2022,13 @@ int main(int argc, char **argv)
if (dev.fd < 0)
return -1;
ret = drmSetClientCap(dev.fd, DRM_CLIENT_CAP_ATOMIC, 1);
if (ret && use_atomic) {
fprintf(stderr, "no atomic modesetting support: %s\n", strerror(errno));
drmClose(dev.fd);
return -1;
if (use_atomic) {
ret = drmSetClientCap(dev.fd, DRM_CLIENT_CAP_ATOMIC, 1);
if (ret) {
fprintf(stderr, "no atomic modesetting support: %s\n", strerror(errno));
drmClose(dev.fd);
return -1;
}
}
dev.use_atomic = use_atomic;