diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-02-05 15:42:41 -0500 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-02-22 11:46:57 -0500 |
commit | b5e50c3f56ee4aa0d0168eab5ece413ac5df76aa (patch) | |
tree | eb6ee1777dc52a00d3981e4a7a208bbe6a136263 /drivers/gpu/drm/i915/i915_debugfs.c | |
parent | 357b13c3e498bb658f511f91a9e4f09c9553be6e (diff) |
drm/i915: provide FBC status in debugfs
Tools like powertop want to check the current FBC status and report it
to the user. So add a debugfs file indicating whether FBC is enabled,
and if not, why.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 55340de618e..96e8b9b2cb3 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -477,6 +477,54 @@ static int i915_drpc_info(struct seq_file *m, void *unused) | |||
477 | return 0; | 477 | return 0; |
478 | } | 478 | } |
479 | 479 | ||
480 | static int i915_fbc_status(struct seq_file *m, void *unused) | ||
481 | { | ||
482 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
483 | struct drm_device *dev = node->minor->dev; | ||
484 | struct drm_crtc *crtc; | ||
485 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
486 | bool fbc_enabled = false; | ||
487 | |||
488 | if (!dev_priv->display.fbc_enabled) { | ||
489 | seq_printf(m, "FBC unsupported on this chipset\n"); | ||
490 | return 0; | ||
491 | } | ||
492 | |||
493 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | ||
494 | if (!crtc->enabled) | ||
495 | continue; | ||
496 | if (dev_priv->display.fbc_enabled(crtc)) | ||
497 | fbc_enabled = true; | ||
498 | } | ||
499 | |||
500 | if (fbc_enabled) { | ||
501 | seq_printf(m, "FBC enabled\n"); | ||
502 | } else { | ||
503 | seq_printf(m, "FBC disabled: "); | ||
504 | switch (dev_priv->no_fbc_reason) { | ||
505 | case FBC_STOLEN_TOO_SMALL: | ||
506 | seq_printf(m, "not enough stolen memory"); | ||
507 | break; | ||
508 | case FBC_UNSUPPORTED_MODE: | ||
509 | seq_printf(m, "mode not supported"); | ||
510 | break; | ||
511 | case FBC_MODE_TOO_LARGE: | ||
512 | seq_printf(m, "mode too large"); | ||
513 | break; | ||
514 | case FBC_BAD_PLANE: | ||
515 | seq_printf(m, "FBC unsupported on plane"); | ||
516 | break; | ||
517 | case FBC_NOT_TILED: | ||
518 | seq_printf(m, "scanout buffer not tiled"); | ||
519 | break; | ||
520 | default: | ||
521 | seq_printf(m, "unknown reason"); | ||
522 | } | ||
523 | seq_printf(m, "\n"); | ||
524 | } | ||
525 | return 0; | ||
526 | } | ||
527 | |||
480 | static int | 528 | static int |
481 | i915_wedged_open(struct inode *inode, | 529 | i915_wedged_open(struct inode *inode, |
482 | struct file *filp) | 530 | struct file *filp) |
@@ -599,6 +647,7 @@ static struct drm_info_list i915_debugfs_list[] = { | |||
599 | {"i915_delayfreq_table", i915_delayfreq_table, 0}, | 647 | {"i915_delayfreq_table", i915_delayfreq_table, 0}, |
600 | {"i915_inttoext_table", i915_inttoext_table, 0}, | 648 | {"i915_inttoext_table", i915_inttoext_table, 0}, |
601 | {"i915_drpc_info", i915_drpc_info, 0}, | 649 | {"i915_drpc_info", i915_drpc_info, 0}, |
650 | {"i915_fbc_status", i915_fbc_status, 0}, | ||
602 | }; | 651 | }; |
603 | #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) | 652 | #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list) |
604 | 653 | ||