summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_gtt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-10-28 13:58:29 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-10-28 20:53:43 +0100
commitf8a7fde4561067a8ebc956b27afeb530ac97cb9d (patch)
treeac1978967ea8db445c219bfa9a95972a1b45a209 /drivers/gpu/drm/i915/i915_gem_gtt.c
parent2e36991a8aa2fb5b06eee7958cced0665ea6f35d (diff)
downloadblackbird-op-linux-f8a7fde4561067a8ebc956b27afeb530ac97cb9d.tar.gz
blackbird-op-linux-f8a7fde4561067a8ebc956b27afeb530ac97cb9d.zip
drm/i915: Defer active reference until required
We only need the active reference to keep the object alive after the handle has been deleted (so as to prevent a synchronous gem_close). Why then pay the price of a kref on every execbuf when we can insert that final active ref just in time for the handle deletion? Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161028125858.23563-6-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 947d5ad51fb7..a3a364478a89 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3734,11 +3734,16 @@ void __iomem *i915_vma_pin_iomap(struct i915_vma *vma)
void i915_vma_unpin_and_release(struct i915_vma **p_vma)
{
struct i915_vma *vma;
+ struct drm_i915_gem_object *obj;
vma = fetch_and_zero(p_vma);
if (!vma)
return;
+ obj = vma->obj;
+
i915_vma_unpin(vma);
- i915_vma_put(vma);
+ i915_vma_close(vma);
+
+ __i915_gem_object_release_unless_active(obj);
}
OpenPOWER on IntegriCloud