[igt-dev] [PATCH i-g-t v13 2/2] tests/gem_ctx_sseu: Dynamic (sub)slice programming tests

Chris Wilson chris at chris-wilson.co.uk
Fri Sep 14 16:17:47 UTC 2018


Quoting Tvrtko Ursulin (2018-09-14 17:04:38)
> +static igt_spin_t *
> +__post_set(int fd, unsigned int flags, uint32_t ctx, igt_spin_t *spin,
> +          unsigned int expected)
> +{
> +       bool busy_reset = (flags & TEST_BUSY) &&
> +                         (flags & (TEST_RESET | TEST_HANG));
> +
> +       if (flags & TEST_RESET)
> +               igt_force_gpu_reset(fd);
> +       else if (flags & TEST_HANG)
> +               gem_sync(fd, spin->handle);

Hmm, in both cases this is before we submit the read/post-sseu batch.

I was thinking more for the hang you would simply opt to not terminate
the spinner.

Being utterly pedantic, we may want to check per-engine resets and
device level.

> +       if (spin && !busy_reset) {
> +               igt_assert_eq(read_slice_count_busy(fd, ctx, 0, spin),
> +                             expected);
> +       } else {
> +               igt_assert_eq(read_slice_count(fd, ctx, 0), expected);
> +       }
> +
> +       igt_assert_eq(read_slice_count(fd, 0, 0), __slice_count__);
> +
> +       if (spin)
> +               igt_spin_batch_free(fd, spin);
> +
> +       if (flags & TEST_IDLE)
> +               igt_drop_caches_set(fd, DROP_RETIRE | DROP_IDLE | DROP_ACTIVE);
> +
> +       if (flags & TEST_SUSPEND) {
> +               igt_set_autoresume_delay(5);

Brave. Opting for a faster wakeup than default...

> +               igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
> +                                             SUSPEND_TEST_NONE);
> +       }
> +
> +       igt_assert_eq(read_slice_count(fd, ctx, 0), expected);
> +       igt_assert_eq(read_slice_count(fd, 0, 0), __slice_count__);
> +
> +       return NULL;
> +}

Overall, nothing else strikes me as being absent.

Oh, one more thing; do we are what state we leave the system in on
module unload? So long as the GPU reset clears it we should be ok.
-Chris


More information about the igt-dev mailing list