aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c121
1 files changed, 93 insertions, 28 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 164fa8286fb9..94b3984dbea0 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -139,10 +139,11 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
139 obj->madv == I915_MADV_DONTNEED ? " purgeable" : ""); 139 obj->madv == I915_MADV_DONTNEED ? " purgeable" : "");
140 if (obj->base.name) 140 if (obj->base.name)
141 seq_printf(m, " (name: %d)", obj->base.name); 141 seq_printf(m, " (name: %d)", obj->base.name);
142 list_for_each_entry(vma, &obj->vma_list, vma_link) 142 list_for_each_entry(vma, &obj->vma_list, vma_link) {
143 if (vma->pin_count > 0) 143 if (vma->pin_count > 0)
144 pin_count++; 144 pin_count++;
145 seq_printf(m, " (pinned x %d)", pin_count); 145 }
146 seq_printf(m, " (pinned x %d)", pin_count);
146 if (obj->pin_display) 147 if (obj->pin_display)
147 seq_printf(m, " (display)"); 148 seq_printf(m, " (display)");
148 if (obj->fence_reg != I915_FENCE_REG_NONE) 149 if (obj->fence_reg != I915_FENCE_REG_NONE)
@@ -580,7 +581,7 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data)
580 seq_printf(m, "Flip queued on frame %d, (was ready on frame %d), now %d\n", 581 seq_printf(m, "Flip queued on frame %d, (was ready on frame %d), now %d\n",
581 work->flip_queued_vblank, 582 work->flip_queued_vblank,
582 work->flip_ready_vblank, 583 work->flip_ready_vblank,
583 drm_vblank_count(dev, crtc->pipe)); 584 drm_crtc_vblank_count(&crtc->base));
584 if (work->enable_stall_check) 585 if (work->enable_stall_check)
585 seq_puts(m, "Stall check enabled, "); 586 seq_puts(m, "Stall check enabled, ");
586 else 587 else
@@ -2185,7 +2186,7 @@ static void gen6_ppgtt_info(struct seq_file *m, struct drm_device *dev)
2185 struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt; 2186 struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt;
2186 2187
2187 seq_puts(m, "aliasing PPGTT:\n"); 2188 seq_puts(m, "aliasing PPGTT:\n");
2188 seq_printf(m, "pd gtt offset: 0x%08x\n", ppgtt->pd_offset); 2189 seq_printf(m, "pd gtt offset: 0x%08x\n", ppgtt->pd.pd_offset);
2189 2190
2190 ppgtt->debug_dump(ppgtt, m); 2191 ppgtt->debug_dump(ppgtt, m);
2191 } 2192 }
@@ -4191,7 +4192,7 @@ i915_max_freq_set(void *data, u64 val)
4191{ 4192{
4192 struct drm_device *dev = data; 4193 struct drm_device *dev = data;
4193 struct drm_i915_private *dev_priv = dev->dev_private; 4194 struct drm_i915_private *dev_priv = dev->dev_private;
4194 u32 rp_state_cap, hw_max, hw_min; 4195 u32 hw_max, hw_min;
4195 int ret; 4196 int ret;
4196 4197
4197 if (INTEL_INFO(dev)->gen < 6) 4198 if (INTEL_INFO(dev)->gen < 6)
@@ -4208,18 +4209,10 @@ i915_max_freq_set(void *data, u64 val)
4208 /* 4209 /*
4209 * Turbo will still be enabled, but won't go above the set value. 4210 * Turbo will still be enabled, but won't go above the set value.
4210 */ 4211 */
4211 if (IS_VALLEYVIEW(dev)) { 4212 val = intel_freq_opcode(dev_priv, val);
4212 val = intel_freq_opcode(dev_priv, val);
4213 4213
4214 hw_max = dev_priv->rps.max_freq; 4214 hw_max = dev_priv->rps.max_freq;
4215 hw_min = dev_priv->rps.min_freq; 4215 hw_min = dev_priv->rps.min_freq;
4216 } else {
4217 val = intel_freq_opcode(dev_priv, val);
4218
4219 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP);
4220 hw_max = dev_priv->rps.max_freq;
4221 hw_min = (rp_state_cap >> 16) & 0xff;
4222 }
4223 4216
4224 if (val < hw_min || val > hw_max || val < dev_priv->rps.min_freq_softlimit) { 4217 if (val < hw_min || val > hw_max || val < dev_priv->rps.min_freq_softlimit) {
4225 mutex_unlock(&dev_priv->rps.hw_lock); 4218 mutex_unlock(&dev_priv->rps.hw_lock);
@@ -4266,7 +4259,7 @@ i915_min_freq_set(void *data, u64 val)
4266{ 4259{
4267 struct drm_device *dev = data; 4260 struct drm_device *dev = data;
4268 struct drm_i915_private *dev_priv = dev->dev_private; 4261 struct drm_i915_private *dev_priv = dev->dev_private;
4269 u32 rp_state_cap, hw_max, hw_min; 4262 u32 hw_max, hw_min;
4270 int ret; 4263 int ret;
4271 4264
4272 if (INTEL_INFO(dev)->gen < 6) 4265 if (INTEL_INFO(dev)->gen < 6)
@@ -4283,18 +4276,10 @@ i915_min_freq_set(void *data, u64 val)
4283 /* 4276 /*
4284 * Turbo will still be enabled, but won't go below the set value. 4277 * Turbo will still be enabled, but won't go below the set value.
4285 */ 4278 */
4286 if (IS_VALLEYVIEW(dev)) { 4279 val = intel_freq_opcode(dev_priv, val);
4287 val = intel_freq_opcode(dev_priv, val);
4288 4280
4289 hw_max = dev_priv->rps.max_freq; 4281 hw_max = dev_priv->rps.max_freq;
4290 hw_min = dev_priv->rps.min_freq; 4282 hw_min = dev_priv->rps.min_freq;
4291 } else {
4292 val = intel_freq_opcode(dev_priv, val);
4293
4294 rp_state_cap = I915_READ(GEN6_RP_STATE_CAP);
4295 hw_max = dev_priv->rps.max_freq;
4296 hw_min = (rp_state_cap >> 16) & 0xff;
4297 }
4298 4283
4299 if (val < hw_min || val > hw_max || val > dev_priv->rps.max_freq_softlimit) { 4284 if (val < hw_min || val > hw_max || val > dev_priv->rps.max_freq_softlimit) {
4300 mutex_unlock(&dev_priv->rps.hw_lock); 4285 mutex_unlock(&dev_priv->rps.hw_lock);
@@ -4370,6 +4355,85 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_cache_sharing_fops,
4370 i915_cache_sharing_get, i915_cache_sharing_set, 4355 i915_cache_sharing_get, i915_cache_sharing_set,
4371 "%llu\n"); 4356 "%llu\n");
4372 4357
4358static int i915_sseu_status(struct seq_file *m, void *unused)
4359{
4360 struct drm_info_node *node = (struct drm_info_node *) m->private;
4361 struct drm_device *dev = node->minor->dev;
4362 struct drm_i915_private *dev_priv = dev->dev_private;
4363 unsigned int s_tot = 0, ss_tot = 0, ss_per = 0, eu_tot = 0, eu_per = 0;
4364
4365 if (INTEL_INFO(dev)->gen < 9)
4366 return -ENODEV;
4367
4368 seq_puts(m, "SSEU Device Info\n");
4369 seq_printf(m, " Available Slice Total: %u\n",
4370 INTEL_INFO(dev)->slice_total);
4371 seq_printf(m, " Available Subslice Total: %u\n",
4372 INTEL_INFO(dev)->subslice_total);
4373 seq_printf(m, " Available Subslice Per Slice: %u\n",
4374 INTEL_INFO(dev)->subslice_per_slice);
4375 seq_printf(m, " Available EU Total: %u\n",
4376 INTEL_INFO(dev)->eu_total);
4377 seq_printf(m, " Available EU Per Subslice: %u\n",
4378 INTEL_INFO(dev)->eu_per_subslice);
4379 seq_printf(m, " Has Slice Power Gating: %s\n",
4380 yesno(INTEL_INFO(dev)->has_slice_pg));
4381 seq_printf(m, " Has Subslice Power Gating: %s\n",
4382 yesno(INTEL_INFO(dev)->has_subslice_pg));
4383 seq_printf(m, " Has EU Power Gating: %s\n",
4384 yesno(INTEL_INFO(dev)->has_eu_pg));
4385
4386 seq_puts(m, "SSEU Device Status\n");
4387 if (IS_SKYLAKE(dev)) {
4388 const int s_max = 3, ss_max = 4;
4389 int s, ss;
4390 u32 s_reg[s_max], eu_reg[2*s_max], eu_mask[2];
4391
4392 s_reg[0] = I915_READ(GEN9_SLICE0_PGCTL_ACK);
4393 s_reg[1] = I915_READ(GEN9_SLICE1_PGCTL_ACK);
4394 s_reg[2] = I915_READ(GEN9_SLICE2_PGCTL_ACK);
4395 eu_reg[0] = I915_READ(GEN9_SLICE0_SS01_EU_PGCTL_ACK);
4396 eu_reg[1] = I915_READ(GEN9_SLICE0_SS23_EU_PGCTL_ACK);
4397 eu_reg[2] = I915_READ(GEN9_SLICE1_SS01_EU_PGCTL_ACK);
4398 eu_reg[3] = I915_READ(GEN9_SLICE1_SS23_EU_PGCTL_ACK);
4399 eu_reg[4] = I915_READ(GEN9_SLICE2_SS01_EU_PGCTL_ACK);
4400 eu_reg[5] = I915_READ(GEN9_SLICE2_SS23_EU_PGCTL_ACK);
4401 eu_mask[0] = GEN9_PGCTL_SSA_EU08_ACK |
4402 GEN9_PGCTL_SSA_EU19_ACK |
4403 GEN9_PGCTL_SSA_EU210_ACK |
4404 GEN9_PGCTL_SSA_EU311_ACK;
4405 eu_mask[1] = GEN9_PGCTL_SSB_EU08_ACK |
4406 GEN9_PGCTL_SSB_EU19_ACK |
4407 GEN9_PGCTL_SSB_EU210_ACK |
4408 GEN9_PGCTL_SSB_EU311_ACK;
4409
4410 for (s = 0; s < s_max; s++) {
4411 if ((s_reg[s] & GEN9_PGCTL_SLICE_ACK) == 0)
4412 /* skip disabled slice */
4413 continue;
4414
4415 s_tot++;
4416 ss_per = INTEL_INFO(dev)->subslice_per_slice;
4417 ss_tot += ss_per;
4418 for (ss = 0; ss < ss_max; ss++) {
4419 unsigned int eu_cnt;
4420
4421 eu_cnt = 2 * hweight32(eu_reg[2*s + ss/2] &
4422 eu_mask[ss%2]);
4423 eu_tot += eu_cnt;
4424 eu_per = max(eu_per, eu_cnt);
4425 }
4426 }
4427 }
4428 seq_printf(m, " Enabled Slice Total: %u\n", s_tot);
4429 seq_printf(m, " Enabled Subslice Total: %u\n", ss_tot);
4430 seq_printf(m, " Enabled Subslice Per Slice: %u\n", ss_per);
4431 seq_printf(m, " Enabled EU Total: %u\n", eu_tot);
4432 seq_printf(m, " Enabled EU Per Subslice: %u\n", eu_per);
4433
4434 return 0;
4435}
4436
4373static int i915_forcewake_open(struct inode *inode, struct file *file) 4437static int i915_forcewake_open(struct inode *inode, struct file *file)
4374{ 4438{
4375 struct drm_device *dev = inode->i_private; 4439 struct drm_device *dev = inode->i_private;
@@ -4483,6 +4547,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
4483 {"i915_dp_mst_info", i915_dp_mst_info, 0}, 4547 {"i915_dp_mst_info", i915_dp_mst_info, 0},
4484 {"i915_wa_registers", i915_wa_registers, 0}, 4548 {"i915_wa_registers", i915_wa_registers, 0},
4485 {"i915_ddb_info", i915_ddb_info, 0}, 4549 {"i915_ddb_info", i915_ddb_info, 0},
4550 {"i915_sseu_status", i915_sseu_status, 0},
4486}; 4551};
4487#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) 4552#define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
4488 4553