summaryrefslogtreecommitdiff
path: root/tests/kms_flip_tiling.c
diff options
context:
space:
mode:
authorMika Kahola <mika.kahola@intel.com>2018-05-23 14:47:37 +0300
committerMika Kahola <mika.kahola@intel.com>2018-05-24 10:14:09 +0300
commit4d0920216bfbfe96a95c62eb6b04190c72aedeab (patch)
tree808b074a438404561c3c4b2cdde899e6129065df /tests/kms_flip_tiling.c
parent71c7a5740913d2618f44bca252669efe8a84f4c9 (diff)
tests: Move wait_for_pageflip as library function
Two tests uses the very same wait_for_pageflip() routine. These tests are 'kms_rotation_crc' and 'kms_flip_tiling'. In order to decrease code repetition, let's move this function as part of kms function collection in igt_kms. No functional changes. Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_flip_tiling.c')
-rw-r--r--tests/kms_flip_tiling.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/tests/kms_flip_tiling.c b/tests/kms_flip_tiling.c
index 5aae29a8..beeb111b 100644
--- a/tests/kms_flip_tiling.c
+++ b/tests/kms_flip_tiling.c
@@ -30,7 +30,6 @@
#include <stdio.h>
#include <string.h>
-
IGT_TEST_DESCRIPTION("Test page flips and tiling scenarios");
typedef struct {
@@ -62,23 +61,6 @@ static void pipe_crc_free(void)
}
}
-static void wait_for_pageflip(int fd)
-{
- drmEventContext evctx = { .version = 2 };
- struct timeval timeout = { .tv_sec = 0, .tv_usec = 50000 };
- fd_set fds;
- int ret;
-
- /* Wait for pageflip completion, then consume event on fd */
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
- do {
- ret = select(fd + 1, &fds, NULL, NULL, &timeout);
- } while (ret < 0 && errno == EINTR);
- igt_assert_eq(ret, 1);
- igt_assert(drmHandleEvent(fd, &evctx) == 0);
-}
-
static void
test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t tiling[2])
{
@@ -139,7 +121,7 @@ test_flip_tiling(data_t *data, enum pipe pipe, igt_output_t *output, uint64_t ti
*/
igt_require(ret == 0);
- wait_for_pageflip(data->drm_fd);
+ kmstest_wait_for_pageflip(data->drm_fd);
/* Get a crc and compare with the reference. */
igt_pipe_crc_collect_crc(pipe_crc, &crc);