diff mbox series

[06/12] drm/i915: Make the WM memory latency print more compact

Message ID 20181010130454.28557-7-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Clean up the wm mem latency stuff | expand

Commit Message

Ville Syrjala Oct. 10, 2018, 1:04 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Print all the latency values on a single line.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index c03d4835d0e0..9fe5a390caa9 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -796,25 +796,22 @@  static bool is_enabling(int old, int new, int threshold)
 	return old < threshold && new >= threshold;
 }
 
+static DEFINE_SNPRINTF_ARRAY(snprintf_wm_array,
+			     u16, wm, level, "%d.%d",
+			     wm[level] / 10, wm[level] % 10);
+
 static void intel_print_wm_latency(struct drm_i915_private *dev_priv,
 				   const char *name,
 				   const uint16_t wm[8])
 {
-	int level, num_levels = dev_priv->wm.num_levels;
+	char str[64];
 
-	for (level = 0; level < num_levels; level++) {
-		unsigned int latency = wm[level];
+	if ((drm_debug & DRM_UT_KMS) == 0)
+		return;
 
-		if (latency == 0) {
-			DRM_ERROR("%s WM%d latency not provided\n",
-				  name, level);
-			continue;
-		}
+	snprintf_wm_array(str, sizeof(str), wm, dev_priv->wm.num_levels);
 
-		DRM_DEBUG_KMS("%s WM%d latency %u (%u.%u usec)\n",
-			      name, level, wm[level],
-			      latency / 10, latency % 10);
-	}
+	DRM_DEBUG_KMS("%s: %s (usec)", name, str);
 }
 
 static int intel_plane_wm_latency(struct intel_plane *plane,