OSDN Git Service

drm/i915: Add stats for GuC log buffer flush interrupts
authorAkash Goel <akash.goel@intel.com>
Wed, 12 Oct 2016 16:24:36 +0000 (21:54 +0530)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 25 Oct 2016 08:34:23 +0000 (09:34 +0100)
commit5aa1ee4b12bee127576b3ea41eeafda2c45bc118
treee05bbfd54560869a83f6119e98b03b3eed5d8a8b
parent5dd7989bbd28a76f1740344e4e2d01dc848158a9
drm/i915: Add stats for GuC log buffer flush interrupts

GuC firmware sends an interrupt to flush the log buffer when it
becomes half full. GuC firmware also tracks how many times the
buffer overflowed.
It would be useful to maintain a statistics of how many flush
interrupts were received and for which type of log buffer,
along with the overflow count of each buffer type.
Augmented i915_log_info debugfs to report back these statistics.

v2:
- Update the logic to detect multiple overflows between the 2
  flush interrupts and also log a message for overflow (Tvrtko)
- Track the number of times there was no free sub buffer to capture
  the GuC log buffer. (Tvrtko)

v3:
- Fix the printf field width for overflow counter, set it to 10 as per the
  max value of u32, which takes 10 digits in decimal form. (Tvrtko)

v4:
- Move the log buffer overflow handling to a new function for better
  readability. (Tvrtko)

Signed-off-by: Akash Goel <akash.goel@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_guc_submission.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_guc.h