Commit cb7ee690 authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio Committed by Chris Wilson

drm/i915: make find_fw_domain work on intel_uncore

Remove unneeded usage of dev_priv from 1 extra function.
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190319183543.13679-6-daniele.ceraolospurio@intel.com
parent f7de5027
...@@ -835,13 +835,13 @@ static int fw_range_cmp(u32 offset, const struct intel_forcewake_range *entry) ...@@ -835,13 +835,13 @@ static int fw_range_cmp(u32 offset, const struct intel_forcewake_range *entry)
}) })
static enum forcewake_domains static enum forcewake_domains
find_fw_domain(struct drm_i915_private *dev_priv, u32 offset) find_fw_domain(struct intel_uncore *uncore, u32 offset)
{ {
const struct intel_forcewake_range *entry; const struct intel_forcewake_range *entry;
entry = BSEARCH(offset, entry = BSEARCH(offset,
dev_priv->uncore.fw_domains_table, uncore->fw_domains_table,
dev_priv->uncore.fw_domains_table_entries, uncore->fw_domains_table_entries,
fw_range_cmp); fw_range_cmp);
if (!entry) if (!entry)
...@@ -853,11 +853,11 @@ find_fw_domain(struct drm_i915_private *dev_priv, u32 offset) ...@@ -853,11 +853,11 @@ find_fw_domain(struct drm_i915_private *dev_priv, u32 offset)
* translate it here to the list of available domains. * translate it here to the list of available domains.
*/ */
if (entry->domains == FORCEWAKE_ALL) if (entry->domains == FORCEWAKE_ALL)
return dev_priv->uncore.fw_domains; return uncore->fw_domains;
WARN(entry->domains & ~dev_priv->uncore.fw_domains, WARN(entry->domains & ~uncore->fw_domains,
"Uninitialized forcewake domain(s) 0x%x accessed at 0x%x\n", "Uninitialized forcewake domain(s) 0x%x accessed at 0x%x\n",
entry->domains & ~dev_priv->uncore.fw_domains, offset); entry->domains & ~uncore->fw_domains, offset);
return entry->domains; return entry->domains;
} }
...@@ -885,7 +885,7 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { ...@@ -885,7 +885,7 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = {
({ \ ({ \
enum forcewake_domains __fwd = 0; \ enum forcewake_domains __fwd = 0; \
if (NEEDS_FORCE_WAKE((offset))) \ if (NEEDS_FORCE_WAKE((offset))) \
__fwd = find_fw_domain(dev_priv, offset); \ __fwd = find_fw_domain(&dev_priv->uncore, offset); \
__fwd; \ __fwd; \
}) })
...@@ -893,7 +893,7 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { ...@@ -893,7 +893,7 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = {
({ \ ({ \
enum forcewake_domains __fwd = 0; \ enum forcewake_domains __fwd = 0; \
if (GEN11_NEEDS_FORCE_WAKE((offset))) \ if (GEN11_NEEDS_FORCE_WAKE((offset))) \
__fwd = find_fw_domain(dev_priv, offset); \ __fwd = find_fw_domain(&dev_priv->uncore, offset); \
__fwd; \ __fwd; \
}) })
...@@ -979,7 +979,7 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { ...@@ -979,7 +979,7 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = {
({ \ ({ \
enum forcewake_domains __fwd = 0; \ enum forcewake_domains __fwd = 0; \
if (NEEDS_FORCE_WAKE((offset)) && !is_gen8_shadowed(offset)) \ if (NEEDS_FORCE_WAKE((offset)) && !is_gen8_shadowed(offset)) \
__fwd = find_fw_domain(dev_priv, offset); \ __fwd = find_fw_domain(&dev_priv->uncore, offset); \
__fwd; \ __fwd; \
}) })
...@@ -987,7 +987,7 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { ...@@ -987,7 +987,7 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = {
({ \ ({ \
enum forcewake_domains __fwd = 0; \ enum forcewake_domains __fwd = 0; \
if (GEN11_NEEDS_FORCE_WAKE((offset)) && !is_gen11_shadowed(offset)) \ if (GEN11_NEEDS_FORCE_WAKE((offset)) && !is_gen11_shadowed(offset)) \
__fwd = find_fw_domain(dev_priv, offset); \ __fwd = find_fw_domain(&dev_priv->uncore, offset); \
__fwd; \ __fwd; \
}) })
......
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