From patchwork Fri Feb 27 01:30:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 5897371 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3A5E89F38E for ; Fri, 27 Feb 2015 01:31:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F3AA20220 for ; Fri, 27 Feb 2015 01:31:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5DE9B2021F for ; Fri, 27 Feb 2015 01:31:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D96CA6E866; Thu, 26 Feb 2015 17:31:11 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 8ED296E862 for ; Thu, 26 Feb 2015 17:31:04 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 26 Feb 2015 17:22:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,656,1418112000"; d="scan'208";a="657878748" Received: from akacprow-mobl.ger.corp.intel.com (HELO strange.ger.corp.intel.com) ([10.252.19.34]) by orsmga001.jf.intel.com with ESMTP; 26 Feb 2015 17:31:03 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Fri, 27 Feb 2015 01:30:58 +0000 Message-Id: <1425000660-1487-3-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1425000660-1487-1-git-send-email-damien.lespiau@intel.com> References: <1425000660-1487-1-git-send-email-damien.lespiau@intel.com> Subject: [Intel-gfx] [PATCH 2/4] drm/i915: Use the original FBC reason strings in debugfs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 94b3984..9ceae48 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -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); diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a1dd8bc..e262397 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -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; }; /** diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index 0cad32c..6cdf6e2 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c @@ -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; }