From patchwork Wed Jan 28 12:43:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 5728141 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C4FEBF440 for ; Wed, 28 Jan 2015 12:43:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C67F20259 for ; Wed, 28 Jan 2015 12:43:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6E1052012D for ; Wed, 28 Jan 2015 12:43:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 609BA6E69F; Wed, 28 Jan 2015 04:43:33 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B9BA6E69F for ; Wed, 28 Jan 2015 04:43:32 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 28 Jan 2015 04:43:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,480,1418112000"; d="scan'208";a="657901105" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.102]) by fmsmga001.fm.intel.com with ESMTP; 28 Jan 2015 04:43:29 -0800 Received: by rosetta (Postfix, from userid 1000) id CB2E180051; Wed, 28 Jan 2015 14:43:28 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 28 Jan 2015 14:43:25 +0200 Message-Id: <1422449006-4028-2-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422449006-4028-1-git-send-email-mika.kuoppala@intel.com> References: <1422449006-4028-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 2/3] drm/i915: Do only one posting read on forcewake put sequence 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 commit 05a2fb157e44a53c79133805d30eaada43911941 Author: Mika Kuoppala Date: Mon Jan 19 16:20:43 2015 +0200 drm/i915: Consolidate forcewake code introduced domain handling where each domain has it's own posting read registers. This changed the forcewake sequence on 'put' side when there is multiple domains as there would be extra read between the domain puts. Any posting read should be enough to flush all the changes. Do a posting read only once, at the end of the sequence and for the first domain. Like it was before. Cc: Chris Wilson Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/intel_uncore.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index be2c7fc..ebd9068 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -123,42 +123,42 @@ fw_domain_posting_read(const struct intel_uncore_forcewake_domain *d) } static void -fw_domains_get(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domains) +fw_domains_posting_read(struct drm_i915_private *dev_priv) { struct intel_uncore_forcewake_domain *d; enum forcewake_domain_id id; - for_each_fw_domain_mask(d, fw_domains, dev_priv, id) { - fw_domain_wait_ack_clear(d); - fw_domain_get(d); + /* No need to do for all, just do for first found */ + for_each_fw_domain(d, dev_priv, id) { fw_domain_posting_read(d); - fw_domain_wait_ack(d); + break; } } static void -fw_domains_put(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domains) +fw_domains_get(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domains) { struct intel_uncore_forcewake_domain *d; enum forcewake_domain_id id; for_each_fw_domain_mask(d, fw_domains, dev_priv, id) { - fw_domain_put(d); + fw_domain_wait_ack_clear(d); + fw_domain_get(d); fw_domain_posting_read(d); + fw_domain_wait_ack(d); } } static void -fw_domains_posting_read(struct drm_i915_private *dev_priv) +fw_domains_put(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domains) { struct intel_uncore_forcewake_domain *d; enum forcewake_domain_id id; - /* No need to do for all, just do for first found */ - for_each_fw_domain(d, dev_priv, id) { - fw_domain_posting_read(d); - break; - } + for_each_fw_domain_mask(d, fw_domains, dev_priv, id) + fw_domain_put(d); + + fw_domains_posting_read(dev_priv); } static void