public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ben Widawsky <benjamin.widawsky@intel.com>
To: Intel GFX <intel-gfx@lists.freedesktop.org>
Cc: Ben Widawsky <ben@bwidawsk.net>
Subject: [PATCH 7/7] drm/i915: Mark gen specific conditions 'likely'
Date: Fri,  4 Oct 2013 21:22:55 -0700	[thread overview]
Message-ID: <1380946975-14431-7-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1380946975-14431-1-git-send-email-benjamin.widawsky@intel.com>

Now that MMIO has been split up into gen specific functions it is
obvious when HAS_FPGA_DBG_UNCLAIMED, HAS_FORCE_WAKE are needed.

I'm a bit on the fence whether or not to even have the checks at all.
For now I am leaving them there because I think they are valuable for
debug, and early silicon bringup. In these cases, one could hardcode the
appropriate values, and not have forcewake, and fpga_dbg.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/intel_uncore.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index cd56212..30fbee0 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -307,7 +307,7 @@ void gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)
 
 /* We give fast paths for the really cool registers */
 #define NEEDS_FORCE_WAKE(dev_priv, reg) \
-	((HAS_FORCE_WAKE((dev_priv)->dev)) && \
+	((likely(HAS_FORCE_WAKE((dev_priv)->dev))) && \
 	 ((reg) < 0x40000) &&            \
 	 ((reg) != FORCEWAKE))
 
@@ -323,7 +323,7 @@ ilk_dummy_write(struct drm_i915_private *dev_priv)
 static void
 hsw_unclaimed_reg_clear(struct drm_i915_private *dev_priv, u32 reg)
 {
-	if (HAS_FPGA_DBG_UNCLAIMED(dev_priv->dev) &&
+	if (likely(HAS_FPGA_DBG_UNCLAIMED(dev_priv->dev)) &&
 	    (__raw_i915_read32(dev_priv, FPGA_DBG) & FPGA_DBG_RM_NOCLAIM)) {
 		DRM_ERROR("Unknown unclaimed register before writing to %x\n",
 			  reg);
@@ -334,7 +334,7 @@ hsw_unclaimed_reg_clear(struct drm_i915_private *dev_priv, u32 reg)
 static void
 hsw_unclaimed_reg_check(struct drm_i915_private *dev_priv, u32 reg)
 {
-	if (HAS_FPGA_DBG_UNCLAIMED(dev_priv->dev) &&
+	if (likely(HAS_FPGA_DBG_UNCLAIMED(dev_priv->dev)) &&
 	    (__raw_i915_read32(dev_priv, FPGA_DBG) & FPGA_DBG_RM_NOCLAIM)) {
 		DRM_ERROR("Unclaimed write to %x\n", reg);
 		__raw_i915_write32(dev_priv, FPGA_DBG, FPGA_DBG_RM_NOCLAIM);
-- 
1.8.4

  parent reply	other threads:[~2013-10-05  4:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-05  4:22 [PATCH 1/7] drm/i915: Prevent using uninitialized MMIO funcs Ben Widawsky
2013-10-05  4:22 ` [PATCH 2/7] drm/i915: Move edram detection early_sanitize Ben Widawsky
2013-10-05  4:22 ` [PATCH 3/7] drm/i915: Create MMIO virtual functions Ben Widawsky
2013-10-05  4:22 ` [PATCH 4/7] drm/i915: Extra common MMIO lines Ben Widawsky
2013-10-05  4:24   ` [PATCH 4/7] [v2] drm/i915: Extract " Ben Widawsky
2013-10-05  4:22 ` [PATCH 5/7] drm/i915: Create GEN specific read MMIO Ben Widawsky
2013-10-05  4:22 ` [PATCH 6/7] drm/i915: Create GEN specific write MMIO Ben Widawsky
2013-10-05  4:22 ` Ben Widawsky [this message]
2013-10-05 12:37   ` [PATCH 7/7] drm/i915: Mark gen specific conditions 'likely' Daniel Vetter
2013-10-06  0:57     ` [PATCH 7/7] drm/i915: Remove gen specific checks in MMIO Ben Widawsky
2013-10-08 13:38 ` [PATCH 1/7] drm/i915: Prevent using uninitialized MMIO funcs Damien Lespiau
2013-10-08 15:23   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380946975-14431-7-git-send-email-benjamin.widawsky@intel.com \
    --to=benjamin.widawsky@intel.com \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox