[Intel-gfx] [PATCH i-g-t 2/3] lib: Extract helpers for determining scheduler capabilities

Chris Wilson chris at chris-wilson.co.uk
Wed Oct 11 09:25:50 UTC 2017


Quoting Michał Winiarski (2017-10-11 10:15:25)
> Couple of tests are using either determining scheduler capabilities or
> pretty printing. Let's move those to helpers in lib. We can also keep
> the value obtained from getparam static.
> 
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Katarzyna Dec <katarzyna.dec at intel.com>
> Cc: Petri Latvala <petri.latvala at intel.com>

Bah humbug.

> ---
>  lib/igt_aux.c             | 14 ++++++++++
>  lib/igt_aux.h             |  1 +
>  lib/ioctl_wrappers.c      | 65 +++++++++++++++++++++++++++++++++++++++++++++++
>  lib/ioctl_wrappers.h      |  8 ++++++

If we have a choice, not here.

lib/i915/gem_scheduler.c ?

>  tests/gem_exec_nop.c      | 34 +++----------------------
>  tests/gem_exec_schedule.c | 47 +++++-----------------------------
>  tests/gem_exec_whisper.c  | 22 ++--------------
>  tests/gem_sync.c          | 34 +++----------------------
>  8 files changed, 103 insertions(+), 122 deletions(-)

> @@ -699,7 +671,7 @@ igt_main
>                 device = drm_open_driver(DRIVER_INTEL);
>                 igt_require_gem(device);
>                 igt_show_submission_method(device);
> -               sched_caps = has_scheduler(device);
> +               igt_show_scheduler_capability(device);

Is it really generic? My suggestion would be
gem_scheduler_show_capability(), or
gem_show_scheduler_capability() if we stick to the gem_has_*() format.

>  
>                 handle = gem_create(device, 4096);
>                 gem_write(device, handle, 0, &bbe, sizeof(bbe));
> @@ -746,8 +718,8 @@ igt_main
>  
>         igt_subtest_group {
>                 igt_fixture {
> -                       igt_require(sched_caps & HAS_PRIORITY);
> -                       igt_require(sched_caps & HAS_PREEMPTION);
> +                       igt_require(gem_has_ctx_priority(device));
> +                       igt_require(gem_has_preemption(device));

gem_has_scheduler_preemption() ? Looking to keep some sort of verbose
oop-in-C, and room for future expansion.

(And we need to kill all of the gem == i915 at some point. And classes.)
-Chris


More information about the Intel-gfx mailing list