diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2016-04-15 06:34:53 -0400 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2016-04-15 09:53:29 -0400 |
commit | be19b10d24e3c22f6bf58d8211071a09ae23b14f (patch) | |
tree | c7cbd72588ad59ee064a4b04af7d046631e7081a | |
parent | be12a86b46e8b501611bbf4bf96f83fdd5748252 (diff) |
drm/i915: Show pin mapped counts and sizes in debugfs
Show a total and purgeable number of pin mapped objects
and their total and purgeable size.
Example output (new stat prefixed with a star):
# cat i915_gem_objects
19920 objects, 289243136 bytes
19920 [18466] objects, 288714752 [267911168] bytes in gtt
0 [0] active objects, 0 [0] bytes
19917 [18466] inactive objects, 288714752 [267911168] bytes
0 unbound objects, 0 bytes
0 purgeable objects, 0 bytes
1 pinned mappable objects, 3145728 bytes
0 fault mappable objects, 0 bytes
* 19914 [0] pin mapped objects, 285560832 [0] bytes [purgeable]
4294967296 [268435456] gtt total
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1460716493-27826-1-git-send-email-tvrtko.ursulin@linux.intel.com
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 9302a6961d04..58e2f48b4fd7 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -443,6 +443,8 @@ static int i915_gem_object_info(struct seq_file *m, void* data) | |||
443 | struct i915_ggtt *ggtt = &dev_priv->ggtt; | 443 | struct i915_ggtt *ggtt = &dev_priv->ggtt; |
444 | u32 count, mappable_count, purgeable_count; | 444 | u32 count, mappable_count, purgeable_count; |
445 | u64 size, mappable_size, purgeable_size; | 445 | u64 size, mappable_size, purgeable_size; |
446 | unsigned long pin_mapped_count = 0, pin_mapped_purgeable_count = 0; | ||
447 | u64 pin_mapped_size = 0, pin_mapped_purgeable_size = 0; | ||
446 | struct drm_i915_gem_object *obj; | 448 | struct drm_i915_gem_object *obj; |
447 | struct drm_file *file; | 449 | struct drm_file *file; |
448 | struct i915_vma *vma; | 450 | struct i915_vma *vma; |
@@ -476,6 +478,14 @@ static int i915_gem_object_info(struct seq_file *m, void* data) | |||
476 | size += obj->base.size, ++count; | 478 | size += obj->base.size, ++count; |
477 | if (obj->madv == I915_MADV_DONTNEED) | 479 | if (obj->madv == I915_MADV_DONTNEED) |
478 | purgeable_size += obj->base.size, ++purgeable_count; | 480 | purgeable_size += obj->base.size, ++purgeable_count; |
481 | if (obj->mapping) { | ||
482 | pin_mapped_count++; | ||
483 | pin_mapped_size += obj->base.size; | ||
484 | if (obj->pages_pin_count == 0) { | ||
485 | pin_mapped_purgeable_count++; | ||
486 | pin_mapped_purgeable_size += obj->base.size; | ||
487 | } | ||
488 | } | ||
479 | } | 489 | } |
480 | seq_printf(m, "%u unbound objects, %llu bytes\n", count, size); | 490 | seq_printf(m, "%u unbound objects, %llu bytes\n", count, size); |
481 | 491 | ||
@@ -493,6 +503,14 @@ static int i915_gem_object_info(struct seq_file *m, void* data) | |||
493 | purgeable_size += obj->base.size; | 503 | purgeable_size += obj->base.size; |
494 | ++purgeable_count; | 504 | ++purgeable_count; |
495 | } | 505 | } |
506 | if (obj->mapping) { | ||
507 | pin_mapped_count++; | ||
508 | pin_mapped_size += obj->base.size; | ||
509 | if (obj->pages_pin_count == 0) { | ||
510 | pin_mapped_purgeable_count++; | ||
511 | pin_mapped_purgeable_size += obj->base.size; | ||
512 | } | ||
513 | } | ||
496 | } | 514 | } |
497 | seq_printf(m, "%u purgeable objects, %llu bytes\n", | 515 | seq_printf(m, "%u purgeable objects, %llu bytes\n", |
498 | purgeable_count, purgeable_size); | 516 | purgeable_count, purgeable_size); |
@@ -500,6 +518,10 @@ static int i915_gem_object_info(struct seq_file *m, void* data) | |||
500 | mappable_count, mappable_size); | 518 | mappable_count, mappable_size); |
501 | seq_printf(m, "%u fault mappable objects, %llu bytes\n", | 519 | seq_printf(m, "%u fault mappable objects, %llu bytes\n", |
502 | count, size); | 520 | count, size); |
521 | seq_printf(m, | ||
522 | "%lu [%lu] pin mapped objects, %llu [%llu] bytes [purgeable]\n", | ||
523 | pin_mapped_count, pin_mapped_purgeable_count, | ||
524 | pin_mapped_size, pin_mapped_purgeable_size); | ||
503 | 525 | ||
504 | seq_printf(m, "%llu [%llu] gtt total\n", | 526 | seq_printf(m, "%llu [%llu] gtt total\n", |
505 | ggtt->base.total, ggtt->mappable_end - ggtt->base.start); | 527 | ggtt->base.total, ggtt->mappable_end - ggtt->base.start); |