diff options
author | Marius Vlad <marius.c.vlad@intel.com> | 2016-07-04 16:52:46 +0300 |
---|---|---|
committer | Marius Vlad <marius.c.vlad@intel.com> | 2016-07-04 17:15:57 +0300 |
commit | 7ead45c28c8870685bbfd219b967f035df85242b (patch) | |
tree | f1ee5d4b2f67d3b3c427c31fd6eeeed55034c299 | |
parent | c77b1fbdaaf790aa78cad24e2c823207de681b56 (diff) |
Added function kmstest_get_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>
Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
-rw-r--r-- | lib/igt_kms.c | 19 | ||||
-rw-r--r-- | lib/igt_kms.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 112bdf7d..be806467 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -2570,3 +2570,22 @@ void igt_reset_connectors(void) forced_connectors[i], "detect"); } + +/** + * kmstest_get_vbl_flag: + * + * Convert a pipe id into the flag representation + * expected in DRM while processing DRM_IOCTL_WAIT_VBLANK. + */ +uint32_t kmstest_get_vbl_flag(uint32_t pipe_id) +{ + if (pipe_id == 0) + return 0; + else if (pipe_id == 1) + return _DRM_VBLANK_SECONDARY; + else { + uint32_t pipe_flag = pipe_id << 1; + igt_assert(!(pipe_flag & ~DRM_VBLANK_HIGH_CRTC_MASK)); + return pipe_flag; + } +} diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 8a6c0476..829615d7 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -402,6 +402,8 @@ static inline bool igt_pipe_connector_valid(enum pipe pipe, void igt_enable_connectors(void); void igt_reset_connectors(void); +uint32_t kmstest_get_vbl_flag(uint32_t pipe_id); + #define EDID_LENGTH 128 const unsigned char* igt_kms_get_base_edid(void); const unsigned char* igt_kms_get_alt_edid(void); |