提交 2d7ef395 编写于 作者: C Chris Wilson

drm/i915: Immediately discard any backing storage for uneeded objects

Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
上级 963b4836
...@@ -4110,6 +4110,11 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data, ...@@ -4110,6 +4110,11 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
obj_priv->madv = args->madv; obj_priv->madv = args->madv;
args->retained = obj_priv->gtt_space != NULL; args->retained = obj_priv->gtt_space != NULL;
/* if the object is no longer bound, discard its backing storage */
if (i915_gem_object_is_purgeable(obj_priv) &&
obj_priv->gtt_space == NULL)
i915_gem_object_truncate(obj);
drm_gem_object_unreference(obj); drm_gem_object_unreference(obj);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册