From patchwork Fri May 5 11:43:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 9713419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E59E60362 for ; Fri, 5 May 2017 11:43:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6072028676 for ; Fri, 5 May 2017 11:43:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53A312867A; Fri, 5 May 2017 11:43:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CCD1C28676 for ; Fri, 5 May 2017 11:43:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BE2F6E660; Fri, 5 May 2017 11:43:31 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA7FD6E660 for ; Fri, 5 May 2017 11:43:29 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id 6so426398wrb.1 for ; Fri, 05 May 2017 04:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=eH+nKDt5oIxHRZ0FXE/Za+T5pMlzx7acmidNVNpFcGY=; b=bYAmvehQl7VromKdHqpxgxEYdb2GM5gQ6Ty3NNupFbkP6VnVoC64JofPvRemNXbisn Ua5eZskBJs3a6DnO2aXiTzqFGWnqWnzrsyIH1xL6mSCDb1iZKLYaKtoZSZke5sAxL87N +/8v4ws1kYQZzbXwTNhDX/xMIcHv85Bni+dpzslFTbBjjWnyE+2QE+z2/vYvmEx0CKaO iGJUGAGyK6baQ49EfCs+9B0mP/iteqKOFlpQJoZqAuGzsKUqG0UMjE3RTgOSzyC+Z3PP XZ5vBkfh3Y/bYW9DGnHOT/K2vpeZSfdmlmQSoIP7Oltdbc9Asv/QvR46vz34m5/M3NJi iojA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eH+nKDt5oIxHRZ0FXE/Za+T5pMlzx7acmidNVNpFcGY=; b=QzrEauufB9ohdtqWA0RAUDyT5dVBI246GFPaK21CMLsbqJMEkLtNBaCdwNKHIJGDwm 7mVxsjGc964NudjOTFO/a4pO3tQ75MlJEIBlttee91jefXxBXkO6wZkvNoJjYAXEl87c 65AMd39ovNi6b5XOYRQCD2QOeVKmyAB7LUdiEgDfNNxaIkzbW7w6K0T4Gu+Gdioil9jY l+zRXg+M1WmS+pdLfNGc3LdhoC+v58prbBCfs72JwUemI1BybzQkaLtKlujopPIdRfip ib59KZGrCWi8f/MuHC1/l4X28hPlo4O4OSUbQbTotNoybfZiiNxKb6waDlkp2DcgFwSh z1Mg== X-Gm-Message-State: AN3rC/5Na5qcE6urvx4/bTKYKT7EYELuMdeVEO2MccPuQbZ/ZW1GU/W0 LoqYRjoeb4lQlg== X-Received: by 10.223.163.222 with SMTP id m30mr35088302wrb.24.1493984608362; Fri, 05 May 2017 04:43:28 -0700 (PDT) Received: from t460p.intel ([94.15.199.60]) by smtp.gmail.com with ESMTPSA id t2sm1953045wme.16.2017.05.05.04.43.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 May 2017 04:43:27 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Fri, 5 May 2017 12:43:21 +0100 Message-Id: <20170505114321.20348-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.9.3 Subject: [Intel-gfx] [PATCH] drm/i915: Restore GT performance in headless mode with DMC loaded 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-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin It seems that the DMC likes to transition between the DC states a lot when there are no connected displays (no active power domains) during simple command submission. This frantic activity on DC states has a terrible impact on the performance of the overall chip with huge latencies observed in the interrupt handlers and elsewhere. Simple tests like igt/gem_latency -n 0 are slowed down by a factor of eight. Work around it by grabbing a modeset display power domain whilst there is any GT activity. This seems to be effective in making the DMC keep its paws off the chip. On the other hand this may have a negative impact on the overall power budget of the chip and so could still affect performance. This version limits the workaround got SKL GT3 and GT4 parts but this is just due the absence of testing on other platforms. It is possible we will have to apply it wider. Signed-off-by: Tvrtko Ursulin Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100572 Testcase: igt/gem_exec_nop/headless Cc: Imre Deak Acked-by: Chris Wilson --- drivers/gpu/drm/i915/i915_drv.h | 5 +++++ drivers/gpu/drm/i915/i915_gem.c | 4 ++++ drivers/gpu/drm/i915/i915_gem_request.c | 3 +++ 3 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 320c16df1c9c..4d58e2e28c2f 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2990,6 +2990,11 @@ intel_info(const struct drm_i915_private *dev_priv) #define HAS_DECOUPLED_MMIO(dev_priv) (INTEL_INFO(dev_priv)->has_decoupled_mmio) +#define NEEDS_CSR_GT_PERF_WA(dev_priv) \ + HAS_CSR(dev_priv) && \ + (IS_SKL_GT3(dev_priv) || IS_SKL_GT4(dev_priv)) && \ + (dev_priv)->csr.dmc_payload + #include "i915_trace.h" static inline bool intel_scanout_needs_vtd_wa(struct drm_i915_private *dev_priv) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b2727905ef2b..c52d863f409c 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3200,7 +3200,11 @@ i915_gem_idle_work_handler(struct work_struct *work) if (INTEL_GEN(dev_priv) >= 6) gen6_rps_idle(dev_priv); + intel_runtime_pm_put(dev_priv); + + if (NEEDS_CSR_GT_PERF_WA(dev_priv)) + intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET); out_unlock: mutex_unlock(&dev->struct_mutex); diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c index 10361c7e3b37..10a3b51f6362 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.c +++ b/drivers/gpu/drm/i915/i915_gem_request.c @@ -873,6 +873,9 @@ static void i915_gem_mark_busy(const struct intel_engine_cs *engine) GEM_BUG_ON(!dev_priv->gt.active_requests); + if (NEEDS_CSR_GT_PERF_WA(dev_priv)) + intel_display_power_get(dev_priv, POWER_DOMAIN_MODESET); + intel_runtime_pm_get_noresume(dev_priv); dev_priv->gt.awake = true;