2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-21 03:54:03 +08:00

drm/i915: use kref_put_mutex in i915_gem_request_unreference__unlocked

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Maarten Lankhorst 2015-04-07 11:32:02 +02:00 committed by Daniel Vetter
parent 9b4fd8f250
commit b833bb61fd

View File

@ -2148,14 +2148,14 @@ i915_gem_request_unreference(struct drm_i915_gem_request *req)
static inline void
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 = req->ring->dev;
struct drm_device *dev;
mutex_lock(&dev->struct_mutex);
if (likely(atomic_dec_and_test(&req->ref.refcount)))
i915_gem_request_free(&req->ref);
if (!req)
return;
dev = req->ring->dev;
if (kref_put_mutex(&req->ref, i915_gem_request_free, &dev->struct_mutex))
mutex_unlock(&dev->struct_mutex);
}
}
static inline void i915_gem_request_assign(struct drm_i915_gem_request **pdst,