diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_active.c')
| -rw-r--r-- | drivers/gpu/drm/i915/i915_active.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_active.c b/drivers/gpu/drm/i915/i915_active.c index 3d2e7cf55e52..da58e5d084f4 100644 --- a/drivers/gpu/drm/i915/i915_active.c +++ b/drivers/gpu/drm/i915/i915_active.c @@ -390,13 +390,19 @@ out: return err; } -void i915_active_set_exclusive(struct i915_active *ref, struct dma_fence *f) +struct dma_fence * +i915_active_set_exclusive(struct i915_active *ref, struct dma_fence *f) { + struct dma_fence *prev; + /* We expect the caller to manage the exclusive timeline ordering */ GEM_BUG_ON(i915_active_is_idle(ref)); - if (!__i915_active_fence_set(&ref->excl, f)) + prev = __i915_active_fence_set(&ref->excl, f); + if (!prev) atomic_inc(&ref->count); + + return prev; } bool i915_active_acquire_if_busy(struct i915_active *ref) |
