aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-09-20 18:13:10 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2009-09-22 20:10:37 -0400
commit2d7ef395b310e17c86fa6190f21ea1f2eccae5d1 (patch)
treea1886204a9266fb87dbcc584eb02b0c947d5f08d /drivers
parent963b483691314ed174ceb883f2b9f13b3ef7fb33 (diff)
drm/i915: Immediately discard any backing storage for uneeded objects
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index c69f1fa38cc8..62ba9c121a14 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4110,6 +4110,11 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
4110 obj_priv->madv = args->madv; 4110 obj_priv->madv = args->madv;
4111 args->retained = obj_priv->gtt_space != NULL; 4111 args->retained = obj_priv->gtt_space != NULL;
4112 4112
4113 /* if the object is no longer bound, discard its backing storage */
4114 if (i915_gem_object_is_purgeable(obj_priv) &&
4115 obj_priv->gtt_space == NULL)
4116 i915_gem_object_truncate(obj);
4117
4113 drm_gem_object_unreference(obj); 4118 drm_gem_object_unreference(obj);
4114 mutex_unlock(&dev->struct_mutex); 4119 mutex_unlock(&dev->struct_mutex);
4115 4120