@@ -1521,48 +1521,16 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
intel_runtime_pm_get(dev_priv);
- if (intel_fbc_enabled(dev)) {
+ if (intel_fbc_enabled(dev))
seq_puts(m, "FBC enabled\n");
- } else {
- seq_puts(m, "FBC disabled: ");
- switch (dev_priv->fbc.no_fbc_reason) {
- case FBC_OK:
- seq_puts(m, "FBC actived, but currently disabled in hardware");
- break;
- case FBC_UNSUPPORTED:
- seq_puts(m, "unsupported by this chipset");
- break;
- case FBC_NO_OUTPUT:
- seq_puts(m, "no outputs");
- break;
- case FBC_STOLEN_TOO_SMALL:
- seq_puts(m, "not enough stolen memory");
- break;
- case FBC_UNSUPPORTED_MODE:
- seq_puts(m, "mode not supported");
- break;
- case FBC_MODE_TOO_LARGE:
- seq_puts(m, "mode too large");
- break;
- case FBC_BAD_PLANE:
- seq_puts(m, "FBC unsupported on plane");
- break;
- case FBC_NOT_TILED:
- seq_puts(m, "scanout buffer not tiled");
- break;
- case FBC_MULTIPLE_PIPES:
- seq_puts(m, "multiple pipes are enabled");
- break;
- case FBC_MODULE_PARAM:
- seq_puts(m, "disabled per module param (default off)");
- break;
- case FBC_CHIP_DEFAULT:
- seq_puts(m, "disabled per chip default");
- break;
- default:
- seq_puts(m, "unknown reason");
- }
- seq_putc(m, '\n');
+ else {
+ const char unknown_reason[] = "unknown reason";
+ const char *reason = dev_priv->fbc.no_fbc_str;
+
+ if (!reason)
+ reason = unknown_reason;
+
+ seq_printf(m, "FBC disabled: %s\n", reason);
}
intel_runtime_pm_put(dev_priv);
@@ -826,6 +826,7 @@ struct i915_fbc {
FBC_MODULE_PARAM,
FBC_CHIP_DEFAULT, /* disabled by default on this chip */
} no_fbc_reason;
+ const char *no_fbc_str;
};
/**
@@ -471,6 +471,7 @@ static void set_no_fbc_reason(struct drm_i915_private *dev_priv,
return;
dev_priv->fbc.no_fbc_reason = reason;
+ dev_priv->fbc.no_fbc_str = reason_str;
DRM_DEBUG_KMS("Disabling FBC: %s\n", reason_str);
}
@@ -671,6 +672,7 @@ void intel_fbc_update(struct drm_device *dev)
intel_fbc_enable(crtc);
dev_priv->fbc.no_fbc_reason = FBC_OK;
+ dev_priv->fbc.no_fbc_str = NULL;
return;
out_disable:
@@ -693,6 +695,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
if (!HAS_FBC(dev_priv)) {
dev_priv->fbc.enabled = false;
dev_priv->fbc.no_fbc_reason = FBC_UNSUPPORTED;
+ dev_priv->fbc.no_fbc_str = "unsupported";
return;
}
No need to duplicate the logic and strings in debugfs, we can just reuse the ones from when we disabled FBC. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> --- drivers/gpu/drm/i915/i915_debugfs.c | 50 +++++++------------------------------ drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_fbc.c | 3 +++ 3 files changed, 13 insertions(+), 41 deletions(-)