Commit e2989f14 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Use reservation_object_lock()

Replace the calls to ww_mutex_lock(&resv->lock) with the helper
reservation_object_lock(resv) and similarly for unlock.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170221091723.6219-1-chris@chris-wilson.co.ukReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent 944a36d4
...@@ -122,9 +122,9 @@ i915_gem_batch_pool_get(struct i915_gem_batch_pool *pool, ...@@ -122,9 +122,9 @@ i915_gem_batch_pool_get(struct i915_gem_batch_pool *pool,
if (tmp->base.size >= size) { if (tmp->base.size >= size) {
/* Clear the set of shared fences early */ /* Clear the set of shared fences early */
ww_mutex_lock(&tmp->resv->lock, NULL); reservation_object_lock(tmp->resv, NULL);
reservation_object_add_excl_fence(tmp->resv, NULL); reservation_object_add_excl_fence(tmp->resv, NULL);
ww_mutex_unlock(&tmp->resv->lock); reservation_object_unlock(tmp->resv);
obj = tmp; obj = tmp;
break; break;
......
...@@ -1301,12 +1301,12 @@ static void eb_export_fence(struct drm_i915_gem_object *obj, ...@@ -1301,12 +1301,12 @@ static void eb_export_fence(struct drm_i915_gem_object *obj,
* handle an error right now. Worst case should be missed * handle an error right now. Worst case should be missed
* synchronisation leading to rendering corruption. * synchronisation leading to rendering corruption.
*/ */
ww_mutex_lock(&resv->lock, NULL); reservation_object_lock(resv, NULL);
if (flags & EXEC_OBJECT_WRITE) if (flags & EXEC_OBJECT_WRITE)
reservation_object_add_excl_fence(resv, &req->fence); reservation_object_add_excl_fence(resv, &req->fence);
else if (reservation_object_reserve_shared(resv) == 0) else if (reservation_object_reserve_shared(resv) == 0)
reservation_object_add_shared_fence(resv, &req->fence); reservation_object_add_shared_fence(resv, &req->fence);
ww_mutex_unlock(&resv->lock); reservation_object_unlock(resv);
} }
static void static void
......
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