diff options
author | Mika Kahola <mika.kahola@intel.com> | 2017-01-16 13:53:40 +0200 |
---|---|---|
committer | Mika Kahola <mika.kahola@intel.com> | 2017-01-19 16:04:45 +0200 |
commit | 8d14370a3954a2691398f40e3a20aa0adcc8cd14 (patch) | |
tree | b2d9fdbd20e77c424eb4edc66d1979aa7f095bad /tests/kms_plane_multiple.c | |
parent | 834bea0d808402c3e143a44942c4206e7f9f0bb7 (diff) |
tests/kms_plane_multiple: Cleanup in favor of library functions
Cleaunup by replacing get_vblank() function with library function
kmstest_get_vblank().
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'tests/kms_plane_multiple.c')
-rw-r--r-- | tests/kms_plane_multiple.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c index dcea910b..2b43f0c5 100644 --- a/tests/kms_plane_multiple.c +++ b/tests/kms_plane_multiple.c @@ -67,28 +67,6 @@ struct { .seed = 1, }; -static inline uint32_t pipe_select(int pipe) -{ - if (pipe > 1) - return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; - else if (pipe > 0) - return DRM_VBLANK_SECONDARY; - else - return 0; -} - -static unsigned int get_vblank(int fd, int pipe, unsigned int flags) -{ - union drm_wait_vblank vbl; - - memset(&vbl, 0, sizeof(vbl)); - vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe) | flags; - if (drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, &vbl)) - return 0; - - return vbl.reply.sequence; -} - /* * Common code across all tests, acting on data_t */ @@ -263,7 +241,8 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, while (i < iterations || loop_forever) { prepare_planes(data, pipe, &blue, tiling, max_planes, output); - vblank_start = get_vblank(data->display.drm_fd, pipe, DRM_VBLANK_NEXTONMISS); + vblank_start = kmstest_get_vblank(data->display.drm_fd, pipe, + DRM_VBLANK_NEXTONMISS); igt_display_commit_atomic(&data->display, DRM_MODE_PAGE_FLIP_EVENT, @@ -274,7 +253,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, ret = read(data->display.drm_fd, buf, sizeof(buf)); igt_assert(ret >= 0); - vblank_stop = get_vblank(data->display.drm_fd, pipe, 0); + vblank_stop = kmstest_get_vblank(data->display.drm_fd, pipe, 0); igt_assert_eq(e->type, DRM_EVENT_FLIP_COMPLETE); igt_reset_timeout(); |