提交 b833bb61 编写于 作者: M Maarten Lankhorst 提交者: Daniel Vetter

drm/i915: use kref_put_mutex in i915_gem_request_unreference__unlocked

Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 9b4fd8f2
...@@ -2148,14 +2148,14 @@ i915_gem_request_unreference(struct drm_i915_gem_request *req) ...@@ -2148,14 +2148,14 @@ i915_gem_request_unreference(struct drm_i915_gem_request *req)
static inline void static inline void
i915_gem_request_unreference__unlocked(struct drm_i915_gem_request *req) i915_gem_request_unreference__unlocked(struct drm_i915_gem_request *req)
{ {
if (req && !atomic_add_unless(&req->ref.refcount, -1, 1)) { struct drm_device *dev;
struct drm_device *dev = req->ring->dev;
if (!req)
return;
mutex_lock(&dev->struct_mutex); dev = req->ring->dev;
if (likely(atomic_dec_and_test(&req->ref.refcount))) if (kref_put_mutex(&req->ref, i915_gem_request_free, &dev->struct_mutex))
i915_gem_request_free(&req->ref);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
}
} }
static inline void i915_gem_request_assign(struct drm_i915_gem_request **pdst, static inline void i915_gem_request_assign(struct drm_i915_gem_request **pdst,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册