[Intel-gfx] [PATCH i-g-t v4 11/11] lib/igt_kms: Added igt_pipe_get_last_out_fence()

Robert Foss robert.foss at collabora.com
Wed Feb 1 01:25:20 UTC 2017


Added the igt_pipe_get_last_out_fence() helper function
that wraps accesses to pipe->fence_out.

Signed-off-by: Robert Foss <robert.foss at collabora.com>
---
 lib/igt_kms.c | 8 ++++++++
 lib/igt_kms.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index a1eaf411..b99b0398 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1938,6 +1938,14 @@ static igt_output_t *igt_pipe_get_output(igt_pipe_t *pipe)
 	return NULL;
 }
 
+int igt_pipe_get_last_out_fence(igt_pipe_t *pipe)
+{
+	int fd = (int) pipe->out_fence_fd;
+	pipe->out_fence_fd = -1;
+
+	return fd;
+}
+
 bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
 			   uint32_t *prop_id, uint64_t *value,
 			   drmModePropertyPtr *prop)
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 6754d00e..8fb327d9 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -390,6 +390,7 @@ igt_plane_t *igt_output_get_plane_type(igt_output_t *output, int plane_type);
 igt_output_t *igt_output_from_connector(igt_display_t *display,
     drmModeConnector *connector);
 igt_plane_t *igt_pipe_get_plane_type(igt_pipe_t *pipe, int plane_type);
+int igt_pipe_get_last_out_fence(igt_pipe_t *pipe);
 bool igt_pipe_get_property(igt_pipe_t *pipe, const char *name,
 			   uint32_t *prop_id, uint64_t *value,
 			   drmModePropertyPtr *prop);
-- 
2.11.0.453.g787f75f05



More information about the Intel-gfx mailing list