[Intel-gfx] [PATCH] drm/i915: Skip shrinking of fenced objects if Gfx is suspended

Praveen Paneri praveen.paneri at intel.com
Wed Dec 16 21:29:13 PST 2015

When the system is running low on memory, gem shrinker is invoked.
In this process objects will be unbinded from GTT.
For tiled objects, access to fence registers could be required while
unbinding them. That requires a resume of gfx device, if suspended,
in the shrinker path. This intermediate resume could cause power
To avoid this intermediate resume of gfx device, don't consider
tiled(fenced) objects for purge in the shrinker path.

Signed-off-by: Akash Goel <akash.goel at intel.com>
Signed-off-by: Praveen Paneri <praveen.paneri at intel.com>
 drivers/gpu/drm/i915/i915_gem_shrinker.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index f7df54a..443432a 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -129,6 +129,17 @@ i915_gem_shrink(struct drm_i915_private *dev_priv,
 			if ((flags & I915_SHRINK_ACTIVE) == 0 && obj->active)
+			/*
+			 * Skip the unbinding of objects, possessing a fence
+			 * register, if the device in the suspended state.
+			 * Otherwise device has to be resumed before an access
+			 * is made to the fence register on unbinding.
+			 */
+			if (HAS_RUNTIME_PM(dev_priv->dev) &&
+				dev_priv->pm.suspended &&
+				(obj->fence_reg != I915_FENCE_REG_NONE))
+				continue;
 			/* For the unbound phase, this should be a no-op! */

More information about the Intel-gfx mailing list