[Intel-gfx] [PATCH v2] drm/i915/selftests: Add a simple exerciser for suspend/hibernate

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 30 10:59:43 UTC 2018


Quoting Bartminski, Jakub (2018-08-30 11:47:21)
> On Thu, 2018-08-30 at 10:52 +0100, Chris Wilson wrote:
> 
> > +static int igt_gem_suspend(void *arg)
> [...]
> > +     if (i915_gem_suspend(i915)) {
> > +             pr_err("i915_gem_suspend failed\n");
> > +             err = -EINVAL;
> > +             goto out;
> > +     }
> > +
> > +     i915_gem_suspend_late(i915);
> 
> Shouldn't we also do i915_gem_suspend_gtt_mappings after
> i915_gem_suspend (usually it's in drm_suspend, which is called by both
> pm_suspend and pm_freeze)? It's later restored in i915_gem_resume.

Possibly, I didn't recall it as being that important. Still, the more
the merrier.
 
> > +static int igt_gem_hibernate(void *arg)
> 
> Most of this function is same as igt_gem_suspend and that is probably
> not going to change since both suspend and hibernation normally go
> through pm_prepare and pm_resume_early/resume, maybe some prepare and
> resume helpers for readability?

You were meant to jump and say, hmm, I'm going to add a few more cases
here with different GPU loads and will need to parameterise the
functions... I was ok with the duplication for now as I expect these to
serve as a base for more tests to come. It was more important for me to
give you a test case that blows up if you remove i915->gt.resume() :)
-Chris


More information about the Intel-gfx mailing list