From 187ccf06414480124b6fbaf702eda1b51e4a4e41 Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Tue, 31 Jan 2017 11:43:35 -0500 Subject: tests/kms_atomic_transition: add out_fences tests Signed-off-by: Gustavo Padovan Signed-off-by: Robert Foss Reviewed-by: Brian Starkey --- lib/igt_kms.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/igt_kms.c') 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; -- cgit v1.2.3