summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-03-13 15:58:26 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-03-13 21:34:53 +0000
commit2c64f11f38f44d21419dc15adc7162bd83f65664 (patch)
tree1b85c86a8c5c2a5f710b198f9960868014f56b4d /lib
parent893e4ae2ff05368570d8d3c0fd803655322bcd9e (diff)
igt/kms_pipe_crc_basic: Tighten timings for CRC readback
The number of vblanks that pass whilst we read back the CRCs is depended upon CPU scheduling -- we may take longer than expected and end up reading more CRCs. Align the start of the loop to a vblank. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100132 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kms.c10
-rw-r--r--lib/igt_kms.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 8751c97f..e12ed723 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3020,8 +3020,7 @@ void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background)
pipe->background_changed = true;
}
-
-void igt_wait_for_vblank(int drm_fd, enum pipe pipe)
+void igt_wait_for_vblank_count(int drm_fd, enum pipe pipe, int count)
{
drmVBlank wait_vbl;
uint32_t pipe_id_flag;
@@ -3031,11 +3030,16 @@ void igt_wait_for_vblank(int drm_fd, enum pipe pipe)
wait_vbl.request.type = DRM_VBLANK_RELATIVE;
wait_vbl.request.type |= pipe_id_flag;
- wait_vbl.request.sequence = 1;
+ wait_vbl.request.sequence = count;
igt_assert(drmWaitVBlank(drm_fd, &wait_vbl) == 0);
}
+void igt_wait_for_vblank(int drm_fd, enum pipe pipe)
+{
+ igt_wait_for_vblank_count(drm_fd, pipe, 1);
+}
+
/**
* igt_enable_connectors:
*
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 6754d00e..f29dfe01 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -415,6 +415,7 @@ void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
uint32_t w, uint32_t h);
void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
+void igt_wait_for_vblank_count(int drm_fd, enum pipe pipe, int count);
static inline bool igt_output_is_connected(igt_output_t *output)
{