From patchwork Thu Dec 19 13:54:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3381061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 401B9C0D4B for ; Thu, 19 Dec 2013 13:55:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BB2B20675 for ; Thu, 19 Dec 2013 13:55:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CD8BE20684 for ; Thu, 19 Dec 2013 13:55:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBD39437A1; Thu, 19 Dec 2013 05:55:35 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qe0-f50.google.com (mail-qe0-f50.google.com [209.85.128.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B174437AC for ; Thu, 19 Dec 2013 05:55:31 -0800 (PST) Received: by mail-qe0-f50.google.com with SMTP id 1so956821qec.37 for ; Thu, 19 Dec 2013 05:55:31 -0800 (PST) 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; bh=kqtjggGv/dvcv4e/YQT+KlpKVqD3QJ5kx15U7eYUB2o=; b=ObcHwvottl3i2a2nn/Pd1a0dhPQAXWf//syas4vi84UiMBe7OTTa8kiMMf6kLhvwo4 zNUNm6w+o/9ozqeiLD6j7fhErKD9WJnLeQjGFMgxMT9aePb1TmXS4b6Z1DFQILzoMbu4 CN6IKgljRwx9+AfNs+LfF2sYFXOz0+se4deje2jUCqesCsg+Hk/FHruTCxRGfJkuxIaQ UPx3NGu//s3ZRAGxsIrKe5XrkJThIi31XFmKykhwJA1WGGy1N4f2ktE6wfeRS7Y9IKUu 2l4YiR3reL8TJxXnPndSTDmUwN+bpgbGZTv1SojfJufEj+k4bZr7l0yExStsWpFhi5tQ 5Dtw== X-Received: by 10.224.67.200 with SMTP id s8mr2932366qai.75.1387461331055; Thu, 19 Dec 2013 05:55:31 -0800 (PST) Received: from localhost.localdomain ([177.40.41.2]) by mx.google.com with ESMTPSA id e2sm633990qas.21.2013.12.19.05.55.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2013 05:55:30 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 19 Dec 2013 11:54:53 -0200 Message-Id: <1387461309-2756-4-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1387461309-2756-1-git-send-email-przanoni@gmail.com> References: <1387461309-2756-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 03/19] drm/i915: add forcewake functions that don't touch runtime PM 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: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 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: Paulo Zanoni To solve a chicken-and-egg problem. Currently when we get/put forcewake we also get/put runtime PM and this works fine because the runtime PM code doesn't need forcewake. But we're going to merge PC8 and runtime PM into a single feature, and the PC8 code (the LCPLL code) does need the forcewake, so that specific piece of code needs to call the _no_rpm version so it doesn't try to get runtime PM in the code that gets runtime PM. For now the new functions are unused, we'll use them on the patch that merges PC8 with runtime PM. Signed-off-by: Paulo Zanoni Reviewed-by: Imre Deak --- drivers/gpu/drm/i915/i915_drv.h | 4 ++++ drivers/gpu/drm/i915/intel_uncore.c | 30 ++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index cc8afff..7f8ec08 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2533,6 +2533,10 @@ extern void intel_display_print_error_state(struct drm_i915_error_state_buf *e, */ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv, int fw_engine); void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine); +void gen6_gt_force_wake_get_no_rpm(struct drm_i915_private *dev_priv, + int fw_engine); +void gen6_gt_force_wake_put_no_rpm(struct drm_i915_private *dev_priv, + int fw_engine); int sandybridge_pcode_read(struct drm_i915_private *dev_priv, u8 mbox, u32 *val); int sandybridge_pcode_write(struct drm_i915_private *dev_priv, u8 mbox, u32 val); diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index 646fecf..6118d2c 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -368,15 +368,11 @@ void intel_uncore_sanitize(struct drm_device *dev) * be called at the beginning of the sequence followed by a call to * gen6_gt_force_wake_put() at the end of the sequence. */ -void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv, int fw_engine) +void gen6_gt_force_wake_get_no_rpm(struct drm_i915_private *dev_priv, + int fw_engine) { unsigned long irqflags; - if (!dev_priv->uncore.funcs.force_wake_get) - return; - - intel_runtime_pm_get(dev_priv); - /* Redirect to VLV specific routine */ if (IS_VALLEYVIEW(dev_priv->dev)) return vlv_force_wake_get(dev_priv, fw_engine); @@ -387,16 +383,23 @@ void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv, int fw_engine) spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); } +void gen6_gt_force_wake_get(struct drm_i915_private *dev_priv, int fw_engine) +{ + if (!dev_priv->uncore.funcs.force_wake_get) + return; + + intel_runtime_pm_get(dev_priv); + gen6_gt_force_wake_get_no_rpm(dev_priv, fw_engine); +} + /* * see gen6_gt_force_wake_get() */ -void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine) +void gen6_gt_force_wake_put_no_rpm(struct drm_i915_private *dev_priv, + int fw_engine) { unsigned long irqflags; - if (!dev_priv->uncore.funcs.force_wake_put) - return; - /* Redirect to VLV specific routine */ if (IS_VALLEYVIEW(dev_priv->dev)) return vlv_force_wake_put(dev_priv, fw_engine); @@ -410,7 +413,14 @@ void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine) 1); } spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); +} + +void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv, int fw_engine) +{ + if (!dev_priv->uncore.funcs.force_wake_put) + return; + gen6_gt_force_wake_put_no_rpm(dev_priv, fw_engine); intel_runtime_pm_put(dev_priv); }