drm/i915: Shrink objects prior to hibernation
In an attempt to keep the hibernation image as same as possible, let's try and discard any unwanted pages and our own page arrays. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160909190218.16831-1-chris@chris-wilson.co.uk
This commit is contained in:
Родитель
851ba2d697
Коммит
7aab2d534e
|
@ -4589,6 +4589,11 @@ void i915_gem_load_cleanup(struct drm_device *dev)
|
||||||
int i915_gem_freeze_late(struct drm_i915_private *dev_priv)
|
int i915_gem_freeze_late(struct drm_i915_private *dev_priv)
|
||||||
{
|
{
|
||||||
struct drm_i915_gem_object *obj;
|
struct drm_i915_gem_object *obj;
|
||||||
|
struct list_head *phases[] = {
|
||||||
|
&dev_priv->mm.unbound_list,
|
||||||
|
&dev_priv->mm.bound_list,
|
||||||
|
NULL
|
||||||
|
}, **p;
|
||||||
|
|
||||||
/* Called just before we write the hibernation image.
|
/* Called just before we write the hibernation image.
|
||||||
*
|
*
|
||||||
|
@ -4599,16 +4604,18 @@ int i915_gem_freeze_late(struct drm_i915_private *dev_priv)
|
||||||
*
|
*
|
||||||
* To make sure the hibernation image contains the latest state,
|
* To make sure the hibernation image contains the latest state,
|
||||||
* we update that state just before writing out the image.
|
* we update that state just before writing out the image.
|
||||||
|
*
|
||||||
|
* To try and reduce the hibernation image, we manually shrink
|
||||||
|
* the objects as well.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
list_for_each_entry(obj, &dev_priv->mm.unbound_list, global_list) {
|
i915_gem_shrink_all(dev_priv);
|
||||||
obj->base.read_domains = I915_GEM_DOMAIN_CPU;
|
|
||||||
obj->base.write_domain = I915_GEM_DOMAIN_CPU;
|
|
||||||
}
|
|
||||||
|
|
||||||
list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
|
for (p = phases; *p; p++) {
|
||||||
obj->base.read_domains = I915_GEM_DOMAIN_CPU;
|
list_for_each_entry(obj, *p, global_list) {
|
||||||
obj->base.write_domain = I915_GEM_DOMAIN_CPU;
|
obj->base.read_domains = I915_GEM_DOMAIN_CPU;
|
||||||
|
obj->base.write_domain = I915_GEM_DOMAIN_CPU;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче