drm/i915: Add frontbuffer tracking tracepoints
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 14 Apr 2021 02:23:02 +0000 (05:23 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 28 Apr 2021 12:55:21 +0000 (15:55 +0300)
Add some tracpoints for frontbuffer tracking so we can
try to figure out what's going on.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210414022309.30898-2-ville.syrjala@linux.intel.com
Acked-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_frontbuffer.c
drivers/gpu/drm/i915/i915_trace.h

index 6fc6965..8161d49 100644 (file)
@@ -58,6 +58,7 @@
 #include "display/intel_dp.h"
 
 #include "i915_drv.h"
+#include "i915_trace.h"
 #include "intel_display_types.h"
 #include "intel_fbc.h"
 #include "intel_frontbuffer.h"
@@ -87,6 +88,8 @@ static void frontbuffer_flush(struct drm_i915_private *i915,
        if (!frontbuffer_bits)
                return;
 
+       trace_intel_frontbuffer_flush(frontbuffer_bits, origin);
+
        might_sleep();
        intel_edp_drrs_flush(i915, frontbuffer_bits);
        intel_psr_flush(i915, frontbuffer_bits, origin);
@@ -173,6 +176,8 @@ void __intel_fb_invalidate(struct intel_frontbuffer *front,
                spin_unlock(&i915->fb_tracking.lock);
        }
 
+       trace_intel_frontbuffer_invalidate(frontbuffer_bits, origin);
+
        might_sleep();
        intel_psr_invalidate(i915, frontbuffer_bits, origin);
        intel_edp_drrs_invalidate(i915, frontbuffer_bits);
index cac385e..6778ad2 100644 (file)
@@ -475,6 +475,44 @@ TRACE_EVENT(intel_pipe_update_end,
                      __entry->scanline)
 );
 
+/* frontbuffer tracking */
+
+TRACE_EVENT(intel_frontbuffer_invalidate,
+           TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
+           TP_ARGS(frontbuffer_bits, origin),
+
+           TP_STRUCT__entry(
+                            __field(unsigned int, frontbuffer_bits)
+                            __field(unsigned int, origin)
+                            ),
+
+           TP_fast_assign(
+                          __entry->frontbuffer_bits = frontbuffer_bits;
+                          __entry->origin = origin;
+                          ),
+
+           TP_printk("frontbuffer_bits=0x%08x, origin=%u",
+                     __entry->frontbuffer_bits, __entry->origin)
+);
+
+TRACE_EVENT(intel_frontbuffer_flush,
+           TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
+           TP_ARGS(frontbuffer_bits, origin),
+
+           TP_STRUCT__entry(
+                            __field(unsigned int, frontbuffer_bits)
+                            __field(unsigned int, origin)
+                            ),
+
+           TP_fast_assign(
+                          __entry->frontbuffer_bits = frontbuffer_bits;
+                          __entry->origin = origin;
+                          ),
+
+           TP_printk("frontbuffer_bits=0x%08x, origin=%u",
+                     __entry->frontbuffer_bits, __entry->origin)
+);
+
 /* object tracking */
 
 TRACE_EVENT(i915_gem_object_create,