]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915: add a tracepoint for gpu frequency changes
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 30 Aug 2012 11:26:48 +0000 (13:26 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Sep 2012 08:09:27 +0000 (10:09 +0200)
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>
drivers/gpu/drm/i915/i915_trace.h
drivers/gpu/drm/i915/intel_pm.c

index 3c4093d91f60d1e5b6e903d9a24f66285884ed82..8134421b89a6c582b9862a252e246fb9f69ae12f 100644 (file)
@@ -430,6 +430,21 @@ TRACE_EVENT(i915_reg_rw,
                (u32)(__entry->val >> 32))
 );
 
+TRACE_EVENT(intel_gpu_freq_change,
+           TP_PROTO(u32 freq),
+           TP_ARGS(freq),
+
+           TP_STRUCT__entry(
+                            __field(u32, freq)
+                            ),
+
+           TP_fast_assign(
+                          __entry->freq = freq;
+                          ),
+
+           TP_printk("new_freq=%u", __entry->freq)
+);
+
 #endif /* _I915_TRACE_H_ */
 
 /* This part must be outside protection */
index 8dc802c4ec7499416ed9b46a3bcacf867d50686d..7ae3582112160b0f90fdf974c2e68d33c89af917 100644 (file)
@@ -2337,6 +2337,8 @@ void gen6_set_rps(struct drm_device *dev, u8 val)
        I915_WRITE(GEN6_RP_INTERRUPT_LIMITS, limits);
 
        dev_priv->rps.cur_delay = val;
+
+       trace_intel_gpu_freq_change(val * 50);
 }
 
 static void gen6_disable_rps(struct drm_device *dev)