diff mbox

[35/35] hack: Print watermark programming duration

Message ID 1373014667-19484-36-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä July 5, 2013, 8:57 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Print how long watermark programming took. Seems to be ~5 usec on ILK
and IVB at the moment.
---
 drivers/gpu/drm/i915/intel_pm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 782c644..1e49c94 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2601,15 +2601,26 @@  void ilk_update_pipe_wm(struct drm_device *dev, enum pipe pipe)
 	spin_lock_irqsave(&dev_priv->wm.lock, flags);
 
 	if (intel_crtc->wm.dirty) {
+		ktime_t stime, etime;
+		s64 duration_ns;
+
 		DRM_DEBUG_KMS("pipe %c vblank, programming new watermarks\n",
 			      pipe_name(pipe));
 
+		stime = ktime_get();
+
 		drm_vblank_put(dev, pipe);
 
 		intel_crtc->wm.active = intel_crtc->wm.pending;
 		intel_crtc->wm.dirty = false;
 
 		ilk_program_watermarks(dev);
+
+		etime = ktime_get();
+
+		duration_ns = ktime_to_ns(etime) - ktime_to_ns(stime);
+		DRM_ERROR("pipe %c watermark programming took %lld ns\n",
+			  pipe_name(pipe), duration_ns);
 	}
 
 	spin_unlock_irqrestore(&dev_priv->wm.lock, flags);