public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Robert Foss <robert.foss@collabora.com>
To: intel-gfx@lists.freedesktop.org,
	Gustavo Padovan <gustavo.padovan@collabora.com>,
	Brian Starkey <brian.starkey@arm.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: [PATCH i-g-t v4 06/11] lib/igt_kms: Add support for the OUT_FENCE_PTR property
Date: Tue, 31 Jan 2017 20:25:15 -0500	[thread overview]
Message-ID: <20170201012520.27352-7-robert.foss@collabora.com> (raw)
In-Reply-To: <20170201012520.27352-1-robert.foss@collabora.com>

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

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>
---
 lib/igt_kms.c | 23 ++++++++++++++++++++++-
 lib/igt_kms.h |  6 +++++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 9b60d74a..7bf3fa3a 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 pointer to which background color to be set
+ *
+ * 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);
-- 
2.11.0.453.g787f75f05

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-02-01  1:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01  1:25 [PATCH i-g-t v4 00/11] tests/kms_atomic_transition add fence testing Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 01/11] tests/kms_atomic_transition: use igt timeout instead of blocking Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 02/11] lib/igt_kms: move igt_kms_get_alt_edid() to the right place Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 03/11] lib/igt_kms: export properties names Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 04/11] tests/kms_atomic: use global atomic properties definitions Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 05/11] lib/igt_kms: Add support for the IN_FENCE_FD property Robert Foss
2017-02-01 10:39   ` Brian Starkey
2017-02-01 16:32     ` Robert Foss
2017-02-01  1:25 ` Robert Foss [this message]
2017-02-01 10:40   ` [PATCH i-g-t v4 06/11] lib/igt_kms: Add support for the OUT_FENCE_PTR property Brian Starkey
2017-02-01 16:35     ` Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 07/11] tests/kms_atomic: stress possible fence settings Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 08/11] tests/kms_atomic_transition: add fencing parameter to run_transition_tests Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 09/11] tests/kms_atomic_transition: add out_fences tests Robert Foss
2017-02-01 10:40   ` Brian Starkey
2017-02-01 16:42     ` Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 10/11] tests/kms_atomic_transition: add in_fences tests Robert Foss
2017-02-01 10:41   ` Brian Starkey
2017-02-01 17:17     ` Robert Foss
2017-02-01  1:25 ` [PATCH i-g-t v4 11/11] lib/igt_kms: Added igt_pipe_get_last_out_fence() Robert Foss
2017-02-01 10:41   ` Brian Starkey
2017-02-01 10:44 ` [PATCH i-g-t v4 00/11] tests/kms_atomic_transition add fence testing Brian Starkey
2017-02-01 18:11   ` Robert Foss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170201012520.27352-7-robert.foss@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=brian.starkey@arm.com \
    --cc=daniel@ffwll.ch \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=gustavo.padovan@collabora.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tomeu.vizoso@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox