[Intel-gfx] [PATCH v2 20/22] drm/i915/selftests: fallback to using the gpu to trash stolen

Chris Wilson chris at chris-wilson.co.uk
Thu Oct 3 20:02:19 UTC 2019


Quoting Matthew Auld (2019-10-03 20:24:42)
> @@ -148,6 +190,21 @@ static int igt_gem_suspend(void *arg)
>         if (err)
>                 goto out;
>  
> +       /*
> +        * If we lack the mappable aperture we can't really access stolen from
> +        * the cpu, but we can always trash it from the gpu, we just need to do
> +        * so early, before we start suspending stuff. We shouldn't see any
> +        * hangs doing this so early, since things like ring state won't be
> +        * allocated in stolen if we can't access it from the cpu. Although if
> +        * that's the case maybe there is not much point in bothering with this
> +        * anyway...
> +        */
> +       if (!HAS_MAPPABLE_APERTURE(i915)) {
> +               err = trash_stolen_gpu(ctx);
> +               if (err)
> +                       goto out;
> +       }

The goal here is that later on we will need to migrate anything in lmem
to swap over suspend/hibernation and restore it on resume. The challenge
is then to corrupt state such that we can detect forgotten objects. (So
there will be usually a bug or two where we redesign the test to cover
more corner cases.) I'm not yet convinced trashing before suspend does
what I want it to do. I think we may need to do a minimal resume cycle
in the middle of the full suspend/resume test that bypasses the GEM
layer to do the trashing. :|
-Chris


More information about the Intel-gfx mailing list