From patchwork Mon Aug 26 22:51:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2849854 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B18C79F2F4 for ; Mon, 26 Aug 2013 23:03:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC57F20362 for ; Mon, 26 Aug 2013 23:03:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C2EF12035E for ; Mon, 26 Aug 2013 23:03:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2828E7451 for ; Mon, 26 Aug 2013 16:03:06 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f50.google.com (mail-yh0-f50.google.com [209.85.213.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BEA1E66AE for ; Mon, 26 Aug 2013 15:51:53 -0700 (PDT) Received: by mail-yh0-f50.google.com with SMTP id f10so712808yha.9 for ; Mon, 26 Aug 2013 15:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=BjIVTbSu+r+2P5S6X5btEP5KvgyN8duT+tzjGfgCWRg=; b=DNqmhT4Yyrln7B6w3PPEujAZMMXniwK+4Zxu+peCIBRgsNyWGiJyjbW8J7030f0Ojm JoIkiXlpqWglikLuUInT6y7fgPpl7IjAtWY3p9+a54WgP/mCOznew0Dy4iVE/+E7iAoF E5vQKrETXkabzIMfIxU5qrCpiHjGiLKJLPAcWFhHlfYEMP3CE54ypYvV7WSMCeSK1Vm/ kTq7VUWnxJyQqtO13iM+Qiua/70a6DZ5C4PGFzbeki5AmfIRTr19HoWvKr9oGDkm2LOP DirVhlUDEBLu9Nw5f56KROj2K3MG7WePaHiZ4fQSoJVBbSYMz9DwkOWN7D+EqsJzUBl6 c48Q== X-Received: by 10.236.74.165 with SMTP id x25mr17153859yhd.43.1377557512732; Mon, 26 Aug 2013 15:51:52 -0700 (PDT) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPSA id w42sm20745880yhb.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 26 Aug 2013 15:51:52 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 26 Aug 2013 19:51:08 -0300 Message-Id: <1377557469-4078-17-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1377557469-4078-1-git-send-email-rodrigo.vivi@gmail.com> References: <1377557469-4078-1-git-send-email-rodrigo.vivi@gmail.com> MIME-Version: 1.0 Cc: =?UTF-8?q?St=C3=A9phane=20Marchesin?= , "Zhuang, Lena" Subject: [Intel-gfx] [PATCH 16/17] RFM drm/i915: Boost RPS frequency for CPU stalls X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Chris Wilson If we encounter a situation where the CPU blocks waiting for results from the GPU, give the GPU a kick to boost its the frequency. This should work to reduce user interface stalls and to quickly promote mesa to high frequencies - but the cost is that our requested frequency stalls high (as we do not idle for long enough before rc6 to start reducing frequencies, nor are we aggressive at down clocking an underused GPU). However, this should be mitigated by rc6 itself powering off the GPU when idle, and that energy use is dependent upon the workload of the GPU in addition to its frequency (e.g. the math or sampler functions only consume power when used). Still, this is likely to adversely affect light workloads. Stéphane raised the concern that this will punish good applications and reward bad applications - but due to the nature of how mesa performs its client throttling, I believe all mesa applications will be roughly equally affected. RFM - request for measurement! Signed-off-by: Chris Wilson Cc: Kenneth Graunke Cc: Stéphane Marchesin Cc: "Meng, Mengmeng" Cc: "Zhuang, Lena" --- drivers/gpu/drm/i915/i915_gem.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 7c92923..50a70ee 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1016,6 +1016,15 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno, if (WARN_ON(!ring->irq_get(ring))) return -ENODEV; + if (dev_priv->info->gen >= 6) { + mutex_lock(&dev_priv->rps.hw_lock); + if (dev_priv->info->is_valleyview) + valleyview_set_rps(dev_priv->dev, dev_priv->rps.max_delay); + else + gen6_set_rps(dev_priv->dev, dev_priv->rps.max_delay); + mutex_unlock(&dev_priv->rps.hw_lock); + } + /* Record current time in case interrupted by signal, or wedged * */ getrawmonotonic(&before);