Commit 2af40298 authored by Chris Wilson's avatar Chris Wilson

drm/i915/selftests: Drop vestigal struct_mutex guards

We no longer need struct_mutex to serialise request emission, so remove
it from the gt selftests.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-20-chris@chris-wilson.co.uk
parent 3d88f76d
......@@ -1639,7 +1639,6 @@ int i915_gem_huge_page_mock_selftests(void)
mkwrite_device_info(dev_priv)->ppgtt_type = INTEL_PPGTT_FULL;
mkwrite_device_info(dev_priv)->ppgtt_size = 48;
mutex_lock(&dev_priv->drm.struct_mutex);
ppgtt = i915_ppgtt_create(dev_priv);
if (IS_ERR(ppgtt)) {
err = PTR_ERR(ppgtt);
......@@ -1665,9 +1664,7 @@ int i915_gem_huge_page_mock_selftests(void)
i915_vm_put(&ppgtt->vm);
out_unlock:
mutex_unlock(&dev_priv->drm.struct_mutex);
drm_dev_put(&dev_priv->drm);
return err;
}
......@@ -1684,7 +1681,6 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915)
struct drm_file *file;
struct i915_gem_context *ctx;
struct i915_address_space *vm;
intel_wakeref_t wakeref;
int err;
if (!HAS_PPGTT(i915)) {
......@@ -1699,13 +1695,10 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915)
if (IS_ERR(file))
return PTR_ERR(file);
mutex_lock(&i915->drm.struct_mutex);
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
ctx = live_context(i915, file);
if (IS_ERR(ctx)) {
err = PTR_ERR(ctx);
goto out_unlock;
goto out_file;
}
mutex_lock(&ctx->mutex);
......@@ -1716,11 +1709,7 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915)
err = i915_subtests(tests, ctx);
out_unlock:
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
mutex_unlock(&i915->drm.struct_mutex);
out_file:
mock_file_free(i915, file);
return err;
}
......@@ -307,9 +307,7 @@ static int live_parallel_switch(void *arg)
struct igt_live_test t;
int n;
mutex_lock(&i915->drm.struct_mutex);
err = igt_live_test_begin(&t, i915, __func__, "");
mutex_unlock(&i915->drm.struct_mutex);
if (err)
break;
......@@ -341,10 +339,8 @@ static int live_parallel_switch(void *arg)
data[n].tsk = NULL;
}
mutex_lock(&i915->drm.struct_mutex);
if (igt_live_test_end(&t))
err = -EIO;
mutex_unlock(&i915->drm.struct_mutex);
}
out:
......
......@@ -669,9 +669,7 @@ static int igt_mmap_offset_exhaustion(void *arg)
goto out;
}
mutex_lock(&i915->drm.struct_mutex);
err = make_obj_busy(obj);
mutex_unlock(&i915->drm.struct_mutex);
if (err) {
pr_err("[loop %d] Failed to busy the object\n", loop);
goto err_obj;
......
......@@ -25,9 +25,7 @@ static int mock_phys_object(void *arg)
goto out;
}
mutex_lock(&i915->drm.struct_mutex);
err = i915_gem_object_attach_phys(obj, PAGE_SIZE);
mutex_unlock(&i915->drm.struct_mutex);
if (err) {
pr_err("i915_gem_object_attach_phys failed, err=%d\n", err);
goto out_obj;
......
This diff is collapsed.
......@@ -708,9 +708,7 @@ static int live_dirty_whitelist(void *arg)
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
mutex_unlock(&i915->drm.struct_mutex);
file = mock_file(i915);
mutex_lock(&i915->drm.struct_mutex);
if (IS_ERR(file)) {
err = PTR_ERR(file);
goto out_rpm;
......@@ -732,9 +730,7 @@ static int live_dirty_whitelist(void *arg)
}
out_file:
mutex_unlock(&i915->drm.struct_mutex);
mock_file_free(i915, file);
mutex_lock(&i915->drm.struct_mutex);
out_rpm:
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
return err;
......@@ -1274,14 +1270,9 @@ int intel_workarounds_live_selftests(struct drm_i915_private *i915)
SUBTEST(live_gpu_reset_workarounds),
SUBTEST(live_engine_reset_workarounds),
};
int err;
if (intel_gt_is_wedged(&i915->gt))
return 0;
mutex_lock(&i915->drm.struct_mutex);
err = i915_subtests(tests, i915);
mutex_unlock(&i915->drm.struct_mutex);
return err;
return i915_subtests(tests, i915);
}
......@@ -116,7 +116,6 @@ static int igt_guc_clients(void *args)
int err = 0;
GEM_BUG_ON(!HAS_GT_UC(dev_priv));
mutex_lock(&dev_priv->drm.struct_mutex);
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
guc = &dev_priv->gt.uc.guc;
......@@ -190,7 +189,6 @@ static int igt_guc_clients(void *args)
guc_clients_enable(guc);
unlock:
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
mutex_unlock(&dev_priv->drm.struct_mutex);
return err;
}
......@@ -208,7 +206,6 @@ static int igt_guc_doorbells(void *arg)
u16 db_id;
GEM_BUG_ON(!HAS_GT_UC(dev_priv));
mutex_lock(&dev_priv->drm.struct_mutex);
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
guc = &dev_priv->gt.uc.guc;
......@@ -299,7 +296,6 @@ static int igt_guc_doorbells(void *arg)
}
unlock:
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
mutex_unlock(&dev_priv->drm.struct_mutex);
return err;
}
......
......@@ -1797,7 +1797,6 @@ static int igt_cs_tlb(void *arg)
if (IS_ERR(file))
return PTR_ERR(file);
mutex_lock(&i915->drm.struct_mutex);
ctx = live_context(i915, file);
if (IS_ERR(ctx)) {
err = PTR_ERR(ctx);
......@@ -2020,7 +2019,6 @@ static int igt_cs_tlb(void *arg)
out_vm:
i915_vm_put(vm);
out_unlock:
mutex_unlock(&i915->drm.struct_mutex);
mock_file_free(i915, file);
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