Commit c521b0c8 authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915: Do not inline forcewake taking in mmio accessors

Once we know we need to take new forcewakes, that being
a slow operation, it does not make sense to inline that
code into every mmio accessor.

Move it to a separate function and save some code.

v2: Be explicit with noinline and remove stale comment.
    (Chris Wilson)
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 003342a5
...@@ -861,11 +861,21 @@ __gen2_read(64) ...@@ -861,11 +861,21 @@ __gen2_read(64)
trace_i915_reg_rw(false, reg, val, sizeof(val), trace); \ trace_i915_reg_rw(false, reg, val, sizeof(val), trace); \
return val return val
static inline void __force_wake_auto(struct drm_i915_private *dev_priv, static noinline void ___force_wake_auto(struct drm_i915_private *dev_priv,
enum forcewake_domains fw_domains) enum forcewake_domains fw_domains)
{ {
struct intel_uncore_forcewake_domain *domain; struct intel_uncore_forcewake_domain *domain;
for_each_fw_domain_masked(domain, fw_domains, dev_priv)
fw_domain_arm_timer(domain);
dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
dev_priv->uncore.fw_domains_active |= fw_domains;
}
static inline void __force_wake_auto(struct drm_i915_private *dev_priv,
enum forcewake_domains fw_domains)
{
if (WARN_ON(!fw_domains)) if (WARN_ON(!fw_domains))
return; return;
...@@ -873,14 +883,8 @@ static inline void __force_wake_auto(struct drm_i915_private *dev_priv, ...@@ -873,14 +883,8 @@ static inline void __force_wake_auto(struct drm_i915_private *dev_priv,
fw_domains &= dev_priv->uncore.fw_domains; fw_domains &= dev_priv->uncore.fw_domains;
fw_domains &= ~dev_priv->uncore.fw_domains_active; fw_domains &= ~dev_priv->uncore.fw_domains_active;
if (fw_domains) { if (fw_domains)
/* Ideally GCC would be constant-fold and eliminate this loop */ ___force_wake_auto(dev_priv, fw_domains);
for_each_fw_domain_masked(domain, fw_domains, dev_priv)
fw_domain_arm_timer(domain);
dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
dev_priv->uncore.fw_domains_active |= fw_domains;
}
} }
#define __gen6_read(x) \ #define __gen6_read(x) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment