Commit e7e5da71 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Hold rpm wakeref for request + ggtt usage

Since the removal of the delayed rc6 enabling, we now setup and drop the
early rpm wakeref during modules initialisation before we start the live
selftests. As such, we are now detecting errors in the tests where we
were not holding the required wakeref for various actions. As rpm is not
the primary goal of the tests involved, take a coarse and convenient rpm
wakeref around the tests.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171123233712.21836-1-chris@chris-wilson.co.ukReviewed-by: default avatarMatthew Auld <matthew.william.auld@gmail.com>
parent b7d3aabf
...@@ -1749,6 +1749,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *dev_priv) ...@@ -1749,6 +1749,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *dev_priv)
return PTR_ERR(file); return PTR_ERR(file);
mutex_lock(&dev_priv->drm.struct_mutex); mutex_lock(&dev_priv->drm.struct_mutex);
intel_runtime_pm_get(dev_priv);
ctx = live_context(dev_priv, file); ctx = live_context(dev_priv, file);
if (IS_ERR(ctx)) { if (IS_ERR(ctx)) {
...@@ -1759,6 +1760,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *dev_priv) ...@@ -1759,6 +1760,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *dev_priv)
err = i915_subtests(tests, ctx); err = i915_subtests(tests, ctx);
out_unlock: out_unlock:
intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev_priv->drm.struct_mutex); mutex_unlock(&dev_priv->drm.struct_mutex);
mock_file_free(dev_priv, file); mock_file_free(dev_priv, file);
......
...@@ -355,6 +355,7 @@ static int igt_evict_contexts(void *arg) ...@@ -355,6 +355,7 @@ static int igt_evict_contexts(void *arg)
return 0; return 0;
mutex_lock(&i915->drm.struct_mutex); mutex_lock(&i915->drm.struct_mutex);
intel_runtime_pm_get(i915);
/* Reserve a block so that we know we have enough to fit a few rq */ /* Reserve a block so that we know we have enough to fit a few rq */
memset(&hole, 0, sizeof(hole)); memset(&hole, 0, sizeof(hole));
...@@ -463,6 +464,7 @@ static int igt_evict_contexts(void *arg) ...@@ -463,6 +464,7 @@ static int igt_evict_contexts(void *arg)
} }
if (drm_mm_node_allocated(&hole)) if (drm_mm_node_allocated(&hole))
drm_mm_remove_node(&hole); drm_mm_remove_node(&hole);
intel_runtime_pm_put(i915);
mutex_unlock(&i915->drm.struct_mutex); mutex_unlock(&i915->drm.struct_mutex);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment