mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 15:43:59 +08:00
drm/i915: Immediately discard any backing storage for uneeded objects
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
963b483691
commit
2d7ef395b3
@ -4110,6 +4110,11 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data,
|
||||
obj_priv->madv = args->madv;
|
||||
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);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user