summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_gtt.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-08-04 07:52:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-08-04 08:09:33 +0100
commitb1f788c6acb2f34622dd5f4c3d5210c6e3945e78 (patch)
treea03c247cf86bee1df25f3271b504ad4b036264f5 /drivers/gpu/drm/i915/i915_gem_gtt.h
parentb0decaf75bd902a11c932005c88924947ac00b8c (diff)
downloadop-kernel-dev-b1f788c6acb2f34622dd5f4c3d5210c6e3945e78.zip
op-kernel-dev-b1f788c6acb2f34622dd5f4c3d5210c6e3945e78.tar.gz
drm/i915: Release vma when the handle is closed
In order to prevent a leak of the vma on shared objects, we need to hook into the object_close callback to destroy the vma on the object for this file. However, if we destroyed that vma immediately we may cause unexpected application stalls as we try to unbind a busy vma - hence we defer the unbind to when we retire the vma. v2: Keep vma allocated until closed. This is useful for a later optimisation, but it is required now in order to handle potential recursion of i915_vma_unbind() by retiring itself. v3: Comments are important. Testcase: igt/gem_ppggtt/flink-and-close-vma-leak Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470293567-10811-26-git-send-email-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.h')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
index bfd3c11..deb9dbc 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -189,6 +189,7 @@ struct i915_vma {
#define LOCAL_BIND (1<<1)
unsigned int bound : 4;
bool is_ggtt : 1;
+ bool closed : 1;
/**
* Support different GGTT views into the same object.
OpenPOWER on IntegriCloud