aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-30 07:26:48 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-03 04:09:27 -0400
commitbe2cde9a6d922e5e43efd2ad39bc43ce70a5d79b (patch)
tree739ab423a51ed2a61f4fac7ec895752b81f2ece4
parent20e4d407fbe39bd15f6d4ded25e8c307789ecc80 (diff)
drm/i915: add a tracepoint for gpu frequency changes
We've had and still have too many issues where the gpu turbo doesn't quite to what it's supposed to do (or what we want it to do). Adding a tracepoint to track when the desired gpu frequency changes should help a lot in characterizing and understanding problematic workloads. Also, this should be fairly interesting for power tuning (and especially noticing when the gpu is stuck in high frequencies, as has happened in the past) and hence for integration into powertop and similar tools. Cc: Arjan van de Ven <arjan@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_trace.h15
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c2
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h
index 3c4093d91f60..8134421b89a6 100644
--- a/drivers/gpu/drm/i915/i915_trace.h
+++ b/drivers/gpu/drm/i915/i915_trace.h
@@ -430,6 +430,21 @@ TRACE_EVENT(i915_reg_rw,
430 (u32)(__entry->val >> 32)) 430 (u32)(__entry->val >> 32))
431); 431);
432 432
433TRACE_EVENT(intel_gpu_freq_change,
434 TP_PROTO(u32 freq),
435 TP_ARGS(freq),
436
437 TP_STRUCT__entry(
438 __field(u32, freq)
439 ),
440
441 TP_fast_assign(
442 __entry->freq = freq;
443 ),
444
445 TP_printk("new_freq=%u", __entry->freq)
446);
447
433#endif /* _I915_TRACE_H_ */ 448#endif /* _I915_TRACE_H_ */
434 449
435/* This part must be outside protection */ 450/* This part must be outside protection */
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 8dc802c4ec74..7ae358211216 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2337,6 +2337,8 @@ void gen6_set_rps(struct drm_device *dev, u8 val)
2337 I915_WRITE(GEN6_RP_INTERRUPT_LIMITS, limits); 2337 I915_WRITE(GEN6_RP_INTERRUPT_LIMITS, limits);
2338 2338
2339 dev_priv->rps.cur_delay = val; 2339 dev_priv->rps.cur_delay = val;
2340
2341 trace_intel_gpu_freq_change(val * 50);
2340} 2342}
2341 2343
2342static void gen6_disable_rps(struct drm_device *dev) 2344static void gen6_disable_rps(struct drm_device *dev)