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 /lib/igt_kms.c | |
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>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r-- | lib/igt_kms.c | 19 |
1 files changed, 19 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; + } +} |