[PATCH 35/35] hack: Print watermark programming duration

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

 



From: Ville Syrj?l? <ville.syrjala at 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 --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);
-- 
1.8.1.5



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux