aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 c69f1fa38cc..62ba9c121a1 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