summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2016-06-20 10:24:08 -0400
committerRobert Foss <robert.foss@collabora.com>2017-02-02 13:51:44 -0500
commit513846b2850554f973525a5586f56ad467f85831 (patch)
treefefdfc22c4c0d0bb7fc8f8d827956dedfa3112d2 /lib
parent221848db977eb9b7f7f7ca8b62ec07c50630da46 (diff)
lib/igt_kms: Add support for the OUT_FENCE_PTR property
Add support for the OUT_FENCE_PTR property to enable setting out fences for atomic commits. 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')
-rw-r--r--lib/igt_kms.c23
-rw-r--r--lib/igt_kms.h6
2 files changed, 27 insertions, 2 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 9b60d74a..fbd08515 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -179,7 +179,8 @@ const char *igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
"DEGAMMA_LUT",
"GAMMA_LUT",
"MODE_ID",
- "ACTIVE"
+ "ACTIVE",
+ "OUT_FENCE_PTR"
};
const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
@@ -2385,6 +2386,14 @@ static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicRe
igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_ACTIVE, !!output);
}
+ pipe_obj->out_fence_fd = -1;
+ if (pipe_obj->out_fence_requested)
+ {
+ pipe_obj->out_fence_requested = false;
+ igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_OUT_FENCE_PTR,
+ (uint64_t)(uintptr_t) &pipe_obj->out_fence_fd);
+ }
+
/*
* TODO: Add all crtc level properties here
*/
@@ -2959,6 +2968,18 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
plane->rotation_changed = true;
}
+/**
+ * igt_pipe_request_out_fence:
+ * @pipe: pipe which out fence will be requested for
+ *
+ * Marks this pipe for requesting an out fence at the next atomic commit
+ * will contain the fd number of the out fence created by KMS.
+ */
+void igt_pipe_request_out_fence(igt_pipe_t *pipe)
+{
+ pipe->out_fence_requested = true;
+}
+
void
igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length)
{
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 8acad8ef..6754d00e 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -94,6 +94,7 @@ enum igt_atomic_crtc_properties {
IGT_CRTC_GAMMA_LUT,
IGT_CRTC_MODE_ID,
IGT_CRTC_ACTIVE,
+ IGT_CRTC_OUT_FENCE_PTR,
IGT_NUM_CRTC_PROPS
};
@@ -341,6 +342,9 @@ struct igt_pipe {
uint64_t mode_blob;
bool mode_changed;
+
+ int32_t out_fence_fd;
+ bool out_fence_requested;
};
typedef struct {
@@ -394,7 +398,7 @@ static inline bool igt_plane_supports_rotation(igt_plane_t *plane)
{
return plane->rotation_property != 0;
}
-
+void igt_pipe_request_out_fence(igt_pipe_t *pipe);
void igt_pipe_set_degamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);
void igt_pipe_set_ctm_matrix(igt_pipe_t *pipe, void *ptr, size_t length);
void igt_pipe_set_gamma_lut(igt_pipe_t *pipe, void *ptr, size_t length);