[igt-dev] [PATCH i-g-t 1/4] tests/debugfs: use igt_display_require

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 4 15:03:22 UTC 2018


Quoting Daniel Vetter (2018-10-04 14:21:25)
> Need to extract into a test subgroup to make sure we only skip the
> tests that need display support.
> 
> Cc: Antonio Argenziano <antonio.argenziano at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  tests/debugfs_test.c | 37 ++++++++++++++++++++++++-------------
>  1 file changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
> index 2e87e4420b15..eb32932ed686 100644
> --- a/tests/debugfs_test.c
> +++ b/tests/debugfs_test.c
> @@ -87,23 +87,14 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent)
>         closedir(dir);
>  }
>  
> -igt_main
> +static void kms_tests(int fd, int debugfs)
>  {
> -       int fd = -1, debugfs;
>         igt_display_t display;
>         struct igt_fb fb[IGT_MAX_PIPES];
>         enum pipe pipe;
>  
> -       igt_skip_on_simulation();
> -
> -       igt_fixture {
> -               fd = drm_open_driver_master(DRIVER_INTEL);
> -               igt_require_gem(fd);
> -               debugfs = igt_debugfs_dir(fd);
> -
> -               kmstest_set_vt_graphics_mode();
> -               igt_display_init(&display, fd);
> -       }
> +       igt_fixture
> +               igt_display_require(&display, fd);
>  
>         igt_subtest("read_all_entries") {
>                 /* try to light all pipes */
> @@ -152,6 +143,27 @@ igt_main
>                 read_and_discard_sysfs_entries(debugfs, 0);
>         }
>  
> +       igt_fixture
> +               igt_display_fini(&display);
> +}
> +
> +igt_main
> +{
> +       int fd = -1, debugfs;
> +
> +       igt_skip_on_simulation();
> +
> +       igt_fixture {
> +               fd = drm_open_driver_master(DRIVER_INTEL);
> +               igt_require_gem(fd);
> +               debugfs = igt_debugfs_dir(fd);
> +
> +               kmstest_set_vt_graphics_mode();
> +       }
> +
> +       igt_subtest_group
> +               kms_tests(fd, debugfs);

Not quite. read_all_entries is the original *non-KMS* test.
-Chris


More information about the igt-dev mailing list