aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-05-28 10:29:56 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-05-28 12:45:29 +0100
commitc017cf6b1a5c7a218f7171bb8061132d9a23a918 (patch)
treed737d3da7177c8e68bf3b68e8b5372ce1b5bd97e /drivers/gpu/drm/i915/gt/selftest_hangcheck.c
parentdrm/i915: Rename intel_context.active to .inflight (diff)
downloadwireguard-linux-c017cf6b1a5c7a218f7171bb8061132d9a23a918.tar.xz
wireguard-linux-c017cf6b1a5c7a218f7171bb8061132d9a23a918.zip
drm/i915: Drop the deferred active reference
An old optimisation to reduce the number of atomics per batch sadly relies on struct_mutex for coordination. In order to remove struct_mutex from serialising object/context closing, always taking and releasing an active reference on first use / last use greatly simplifies the locking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190528092956.14910-15-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/selftest_hangcheck.c')
-rw-r--r--drivers/gpu/drm/i915/gt/selftest_hangcheck.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
index c3fa10fd9383..3be67e561c26 100644
--- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
+++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
@@ -120,15 +120,8 @@ static int move_to_active(struct i915_vma *vma,
i915_vma_lock(vma);
err = i915_vma_move_to_active(vma, rq, flags);
i915_vma_unlock(vma);
- if (err)
- return err;
-
- if (!i915_gem_object_has_active_reference(vma->obj)) {
- i915_gem_object_get(vma->obj);
- i915_gem_object_set_active_reference(vma->obj);
- }
- return 0;
+ return err;
}
static struct i915_request *