summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2017-01-31 11:43:35 -0500
committerRobert Foss <robert.foss@collabora.com>2017-02-02 13:51:44 -0500
commit187ccf06414480124b6fbaf702eda1b51e4a4e41 (patch)
treedc16d0ca89316e3e5b6de5207422747edf3576a9 /lib/igt_kms.c
parentf034362a2b2ee2fd64cacbfc85b926336c7525ba (diff)
tests/kms_atomic_transition: add out_fences tests
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r--lib/igt_kms.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index fbd08515..7227ebca 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -53,6 +53,7 @@
#include "intel_chipset.h"
#include "igt_debugfs.h"
#include "igt_sysfs.h"
+#include "sw_sync.h"
/**
* SECTION:igt_kms
@@ -2470,6 +2471,22 @@ static int igt_atomic_commit(igt_display_t *display, uint32_t flags, void *user_
}
ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
+ if (!ret) {
+
+ for_each_pipe(display, pipe) {
+ igt_pipe_t *pipe_obj = &display->pipes[pipe];
+
+ if (pipe_obj->out_fence_fd == -1)
+ continue;
+
+ igt_assert(pipe_obj->out_fence_fd >= 0);
+ ret = sync_fence_wait(pipe_obj->out_fence_fd, 1000);
+ igt_assert(ret == 0);
+ close(pipe_obj->out_fence_fd);
+ pipe_obj->out_fence_fd = -1;
+ }
+ }
+
drmModeAtomicFree(req);
return ret;