[igt-dev] [Intel-gfx] [PATCH i-g-t] Skip VBlank tests in modules without VBlank

Chris Wilson chris at chris-wilson.co.uk
Tue Aug 21 10:16:09 UTC 2018


Quoting Rodrigo Siqueira (2018-08-21 00:54:45)
> The kms_flip test does not support drivers without VBlank which exclude
> some virtual drivers. This patch adds a function that checks if a module
> has a VBlank or not; if a module has VBlank than kms_flip will execute
> all the VBlank tests, otherwise, VBlank tests will be skipped.
> 
> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo at gmail.com>
> ---
>  lib/igt_aux.c    | 14 ++++++++++++++
>  lib/igt_aux.h    |  2 ++
>  tests/kms_flip.c | 26 ++++++++++++++++++++++++--
>  3 files changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index 1250d5c5..da5be4bb 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -564,6 +564,20 @@ bool igt_aub_dump_enabled(void)
>         return dump_aub;
>  }
>  
> +bool igt_there_is_vblank(int drm_fd)

I would suggest breaking out in the kms namespace,

bool kms_has_vblank(int fd);

> +{
> +       drmVBlank dummy_vbl;
> +       int ret;
> +

Either memset() the rest or use a named initializer.

> +       dummy_vbl.request.type = DRM_VBLANK_ABSOLUTE;
> +       ret = drmWaitVBlank(drm_fd, &dummy_vbl);

return drmWaitVblank() == 0;
-Chris


More information about the igt-dev mailing list