public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: robert.foss@collabora.com
To: marius.c.vlad@intel.com, daniel.vetter@ffwll.ch,
	tomeu.vizoso@collabora.com, daniel.stone@collabora.com
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t v4 5/5] lib/igt_kms: Added pipe_id_to_vbl_flag() to igt_kms.
Date: Tue, 26 Apr 2016 11:54:22 -0400	[thread overview]
Message-ID: <1461686062-24630-6-git-send-email-robert.foss@collabora.com> (raw)
In-Reply-To: <1461686062-24630-1-git-send-email-robert.foss@collabora.com>

From: Robert Foss <robert.foss@collabora.com>

Added function pipe_id_to_vbl_flag() to igt_kms.
This function formats a pipe_id into the format
expected by DRM while processing DRM_IOCTL_WAIT_VBLANK.

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

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 99b6279..48b95e6 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2557,3 +2557,19 @@ void igt_reset_connectors(void)
 		close(fd);
 	}
 }
+
+/**
+ * pipe_id_to_vbl_flag:
+ *
+ * Convert a pipe if into the flag representation
+ * expected in DRM while processing DRM_IOCTL_WAIT_VBLANK.
+ */
+uint32_t pipe_id_to_vbl_flag(uint32_t pipe_id)
+{
+	if (pipe_id == 0)
+		return 0;
+	else if (pipe_id == 1)
+		return 1 | _DRM_VBLANK_SECONDARY;
+	else
+		return pipe_id << 1;
+}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index d9a4e11..f74edaf 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -400,6 +400,7 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
 
 void igt_enable_connectors(void);
 void igt_reset_connectors(void);
+uint32_t pipe_id_to_vbl_flag(uint32_t pipe_id);
 
 #define EDID_LENGTH 128
 const unsigned char* igt_kms_get_base_edid(void);
-- 
2.5.0

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

  parent reply	other threads:[~2016-04-26 15:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 15:54 [PATCH i-g-t v4 0/5] kms_flip_event_leak and kms_vblank fixes for VC4 robert.foss
2016-04-26 15:54 ` [PATCH i-g-t v4 1/5] lib/igt_kms: Add support for up to 10 planes robert.foss
2016-04-26 15:54 ` [PATCH i-g-t v4 2/5] lib/igt_kms: Fix plane counting in igt_display_init robert.foss
2016-04-26 15:54 ` [PATCH i-g-t v4 3/5] lib/igt_kms: Switch to verbose assert robert.foss
2016-04-26 15:54 ` [PATCH i-g-t v4 4/5] kms_vblank: Switch from using crtc0 statically to explicitly setting mode robert.foss
2016-05-09 15:38   ` Marius Vlad
2016-05-09 20:31     ` Robert Foss
     [not found]       ` <5730F578.8000909@collabora.com>
2016-05-10 17:03         ` Marius Vlad
2016-05-10 17:19           ` Ville Syrjälä
2016-05-10 17:36             ` Chris Wilson
2016-05-10 17:58             ` Ville Syrjälä
2016-04-26 15:54 ` robert.foss [this message]
2016-05-10  7:44   ` [PATCH i-g-t v4 5/5] lib/igt_kms: Added pipe_id_to_vbl_flag() to igt_kms Daniel Vetter
2016-05-11 13:45     ` Robert Foss
2016-05-11 15:31       ` Robert Foss
2016-05-10 17:54   ` Ville Syrjälä
2016-05-11 13:49     ` 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=1461686062-24630-6-git-send-email-robert.foss@collabora.com \
    --to=robert.foss@collabora.com \
    --cc=daniel.stone@collabora.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=marius.c.vlad@intel.com \
    --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