[igt-dev] [PATCH i-g-t] tests/perf_pmu: Test RC6 during runtime suspend

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 7 13:47:31 UTC 2018


Quoting Tvrtko Ursulin (2018-02-07 13:34:05)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> Test to check that the RC6 counter works as expected during and after
> runtime suspend.
> 
> v2:
>  * Use correct sysfs root by using IGT helpers.
>  * Turn off display to allow runtime suspend. (Imre)
>  * Two subtest flavours.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>  tests/perf_pmu.c | 42 ++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 38 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
> index 60cff4eee152..3981264b1fa8 100644
> --- a/tests/perf_pmu.c
> +++ b/tests/perf_pmu.c
> @@ -40,6 +40,7 @@
>  #include "igt_core.h"
>  #include "igt_perf.h"
>  #include "igt_sysfs.h"
> +#include "igt_pm.h"
>  #include "sw_sync.h"
>  
>  IGT_TEST_DESCRIPTION("Test the i915 pmu perf interface");
> @@ -151,6 +152,8 @@ static unsigned int e2ring(int gem_fd, const struct intel_execution_engine2 *e)
>  #define TEST_BUSY (1)
>  #define FLAG_SYNC (2)
>  #define TEST_TRAILING_IDLE (4)
> +#define TEST_RUNTIME_PM (8)
> +#define FLAG_LONG (16)
>  
>  static void end_spin(int fd, igt_spin_t *spin, unsigned int flags)
>  {
> @@ -1245,19 +1248,44 @@ static bool wait_for_rc6(int fd)
>  }
>  
>  static void
> -test_rc6(int gem_fd)
> +test_rc6(int gem_fd, unsigned int flags)
>  {
>         int64_t duration_ns = 2e9;
>         uint64_t idle, busy, prev;
>         unsigned int slept;
>         int fd, fw;
>  
> +       gem_quiescent_gpu(gem_fd);
> +
>         fd = open_pmu(I915_PMU_RC6_RESIDENCY);
>  
> -       gem_quiescent_gpu(gem_fd);
> +       if (flags & TEST_RUNTIME_PM) {
> +               drmModeRes *res;
> +
> +               res = drmModeGetResources(gem_fd);
> +               igt_assert(res);
> +
> +               /* force all connectors off */
> +               kmstest_set_vt_graphics_mode();
> +               kmstest_unset_all_crtcs(gem_fd, res);

drmModeFreeResources(res) or something.

> +               igt_require(igt_setup_runtime_pm());
> +               igt_require(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));

This looks to be self-testing, so if it does work,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list