From deead1d39368ac11a66f0d9def39f75d1db7e78b Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Tue, 24 Jul 2018 15:59:25 +0200 Subject: lib/igt_debugfs: Add igt_pipe_crc_get_current() to get a crc. A pair of igt_pipe_crc_drain() and igt_pipe_crc_get_single() has a bug in which you're not sure whether the new CRC is captured because the vblank irq may race against the CRC irq and delivered to userspace too soon. When receiving a vblank event, igt_pipe_crc_drain() will then drain all crc's, but not the new (stale) crc, which is then delivered and immediately returned by igt_pipe_crc_get_single(). Signed-off-by: Maarten Lankhorst Reviewed-by: Daniel Vetter --- lib/igt_debugfs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/igt_debugfs.h') diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h index 8d25abfe..db634a82 100644 --- a/lib/igt_debugfs.h +++ b/lib/igt_debugfs.h @@ -132,6 +132,8 @@ int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, igt_crc_t **out_crcs); void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc); bool igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc); +void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc); + void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc); void igt_hpd_storm_set_threshold(int fd, unsigned int threshold); -- cgit v1.2.3