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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Print all the latency values on a single line.

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

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,
-- 
2.18.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux