From patchwork Thu Dec 17 05:29:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Paneri X-Patchwork-Id: 7869411 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 48EA09F349 for ; Thu, 17 Dec 2015 05:20:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74C31203E9 for ; Thu, 17 Dec 2015 05:20:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 914AE2022D for ; Thu, 17 Dec 2015 05:20:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DD286E957; Wed, 16 Dec 2015 21:20:12 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id 2777F6E957 for ; Wed, 16 Dec 2015 21:20:11 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 16 Dec 2015 21:20:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,439,1444719600"; d="scan'208";a="873235626" Received: from intel-desktop.iind.intel.com ([10.223.82.148]) by orsmga002.jf.intel.com with ESMTP; 16 Dec 2015 21:20:07 -0800 From: Praveen Paneri To: intel-gfx@lists.freedesktop.org Date: Thu, 17 Dec 2015 10:59:13 +0530 Message-Id: <1450330153-15910-1-git-send-email-praveen.paneri@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Akash Goel , Praveen Paneri Subject: [Intel-gfx] [PATCH] drm/i915: Skip shrinking of fenced objects if Gfx is suspended X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 leakage. 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 Signed-off-by: Praveen Paneri --- 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) continue; + /* + * 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; + drm_gem_object_reference(&obj->base); /* For the unbound phase, this should be a no-op! */