diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-09-11 10:02:43 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-09-11 13:39:42 +0100 |
commit | 4dd2fbbfb532d0981b0ecd218c0597ac0047ca55 (patch) | |
tree | f37e913dbc6ad76ee6230a9f1fa5d7eb12e420ed /drivers/gpu/drm/i915/gem/i915_gem_object.c | |
parent | 0606259e3b3a1220a0f04a92a1654a3f674f47ee (diff) |
drm/i915: Make i915_vma.flags atomic_t for mutex reduction
In preparation for reducing struct_mutex stranglehold around the vm,
make the vma.flags atomic so that we can acquire a pin on the vma
atomically before deciding if we need to take the mutex.
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/20190911090243.16786-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gem/i915_gem_object.c')
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_object.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c index d7855dc5a5c5..0ef60dae23a7 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c @@ -163,7 +163,7 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915, list_for_each_entry_safe(vma, vn, &obj->vma.list, obj_link) { GEM_BUG_ON(i915_vma_is_active(vma)); - vma->flags &= ~I915_VMA_PIN_MASK; + atomic_and(~I915_VMA_PIN_MASK, &vma->flags); i915_vma_destroy(vma); } GEM_BUG_ON(!list_empty(&obj->vma.list)); |