Commit 4087f873 authored by Stuart Summers's avatar Stuart Summers Committed by Chris Wilson

drm/i915: Use variable for debugfs device status

Use a local variable to find SSEU runtime information
in various debugfs functions.

v2: Remove extra line breaks per feedback from Chris
Signed-off-by: default avatarStuart Summers <stuart.summers@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190823160307.180813-2-stuart.summers@intel.com
parent 5d869230
...@@ -3849,8 +3849,7 @@ static void gen9_sseu_device_status(struct drm_i915_private *dev_priv, ...@@ -3849,8 +3849,7 @@ static void gen9_sseu_device_status(struct drm_i915_private *dev_priv,
sseu->slice_mask |= BIT(s); sseu->slice_mask |= BIT(s);
if (IS_GEN9_BC(dev_priv)) if (IS_GEN9_BC(dev_priv))
sseu->subslice_mask[s] = sseu->subslice_mask[s] = info->sseu.subslice_mask[s];
RUNTIME_INFO(dev_priv)->sseu.subslice_mask[s];
for (ss = 0; ss < info->sseu.max_subslices; ss++) { for (ss = 0; ss < info->sseu.max_subslices; ss++) {
unsigned int eu_cnt; unsigned int eu_cnt;
...@@ -3877,25 +3876,22 @@ static void gen9_sseu_device_status(struct drm_i915_private *dev_priv, ...@@ -3877,25 +3876,22 @@ static void gen9_sseu_device_status(struct drm_i915_private *dev_priv,
static void broadwell_sseu_device_status(struct drm_i915_private *dev_priv, static void broadwell_sseu_device_status(struct drm_i915_private *dev_priv,
struct sseu_dev_info *sseu) struct sseu_dev_info *sseu)
{ {
const struct intel_runtime_info *info = RUNTIME_INFO(dev_priv);
u32 slice_info = I915_READ(GEN8_GT_SLICE_INFO); u32 slice_info = I915_READ(GEN8_GT_SLICE_INFO);
int s; int s;
sseu->slice_mask = slice_info & GEN8_LSLICESTAT_MASK; sseu->slice_mask = slice_info & GEN8_LSLICESTAT_MASK;
if (sseu->slice_mask) { if (sseu->slice_mask) {
sseu->eu_per_subslice = sseu->eu_per_subslice = info->sseu.eu_per_subslice;
RUNTIME_INFO(dev_priv)->sseu.eu_per_subslice; for (s = 0; s < fls(sseu->slice_mask); s++)
for (s = 0; s < fls(sseu->slice_mask); s++) { sseu->subslice_mask[s] = info->sseu.subslice_mask[s];
sseu->subslice_mask[s] =
RUNTIME_INFO(dev_priv)->sseu.subslice_mask[s];
}
sseu->eu_total = sseu->eu_per_subslice * sseu->eu_total = sseu->eu_per_subslice *
intel_sseu_subslice_total(sseu); intel_sseu_subslice_total(sseu);
/* subtract fused off EU(s) from enabled slice(s) */ /* subtract fused off EU(s) from enabled slice(s) */
for (s = 0; s < fls(sseu->slice_mask); s++) { for (s = 0; s < fls(sseu->slice_mask); s++) {
u8 subslice_7eu = u8 subslice_7eu = info->sseu.subslice_7eu[s];
RUNTIME_INFO(dev_priv)->sseu.subslice_7eu[s];
sseu->eu_total -= hweight8(subslice_7eu); sseu->eu_total -= hweight8(subslice_7eu);
} }
...@@ -3942,6 +3938,7 @@ static void i915_print_sseu_info(struct seq_file *m, bool is_available_info, ...@@ -3942,6 +3938,7 @@ static void i915_print_sseu_info(struct seq_file *m, bool is_available_info,
static int i915_sseu_status(struct seq_file *m, void *unused) static int i915_sseu_status(struct seq_file *m, void *unused)
{ {
struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_i915_private *dev_priv = node_to_i915(m->private);
const struct intel_runtime_info *info = RUNTIME_INFO(dev_priv);
struct sseu_dev_info sseu; struct sseu_dev_info sseu;
intel_wakeref_t wakeref; intel_wakeref_t wakeref;
...@@ -3949,14 +3946,13 @@ static int i915_sseu_status(struct seq_file *m, void *unused) ...@@ -3949,14 +3946,13 @@ static int i915_sseu_status(struct seq_file *m, void *unused)
return -ENODEV; return -ENODEV;
seq_puts(m, "SSEU Device Info\n"); seq_puts(m, "SSEU Device Info\n");
i915_print_sseu_info(m, true, &RUNTIME_INFO(dev_priv)->sseu); i915_print_sseu_info(m, true, &info->sseu);
seq_puts(m, "SSEU Device Status\n"); seq_puts(m, "SSEU Device Status\n");
memset(&sseu, 0, sizeof(sseu)); memset(&sseu, 0, sizeof(sseu));
sseu.max_slices = RUNTIME_INFO(dev_priv)->sseu.max_slices; sseu.max_slices = info->sseu.max_slices;
sseu.max_subslices = RUNTIME_INFO(dev_priv)->sseu.max_subslices; sseu.max_subslices = info->sseu.max_subslices;
sseu.max_eus_per_subslice = sseu.max_eus_per_subslice = info->sseu.max_eus_per_subslice;
RUNTIME_INFO(dev_priv)->sseu.max_eus_per_subslice;
with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref) { with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref) {
if (IS_CHERRYVIEW(dev_priv)) if (IS_CHERRYVIEW(dev_priv))
......
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