[igt-dev] [PATCH i-g-t 1/3] lib/debugfs: Fix wraparound handling for crc frame counter check
Chris Wilson
chris at chris-wilson.co.uk
Tue Nov 6 17:11:26 UTC 2018
Quoting Ville Syrjala (2018-11-06 16:19:41)
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Deal with frame counter wraparound correcrtly.
>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
> lib/igt_debugfs.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index a3aca8466658..70874416d128 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -975,6 +975,16 @@ void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> crc_sanity_checks(crc);
> }
>
> +static bool vbl_after_eq(uint32_t a, uint32_t b)
> +{
> + return (int32_t)(a - b) >= 0;
> +}
> +
> +static bool vbl_before_eq(uint32_t a, uint32_t b)
> +{
> + return vbl_after_eq(b, a);
> +}
These seem like widely useful functions.
igt_vblank_passed() ?
For now,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris
More information about the igt-dev
mailing list