summaryrefslogtreecommitdiff
path: root/overlay/gem-interrupts.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-09-13 18:08:02 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-11-22 11:18:14 +0000
commit47fef4731e0f0f77b35a09e091b11c56669feb1b (patch)
tree594f5ec62f7d65ac603073ee777c58c1260466ba /overlay/gem-interrupts.c
parenta688deceae195aec863d8de45bdaefb251927c89 (diff)
intel-gpu-overlay: Consolidate perf PMU access to library
Various tool modules implement their owm PMU open wrapper which can be replaced by calling the library one. v2: * Remove extra newline. (Chris Wilson) * Commit msg. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/gem-interrupts.c')
-rw-r--r--overlay/gem-interrupts.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/overlay/gem-interrupts.c b/overlay/gem-interrupts.c
index 7ba54fcd..a84aef03 100644
--- a/overlay/gem-interrupts.c
+++ b/overlay/gem-interrupts.c
@@ -36,20 +36,6 @@
#include "gem-interrupts.h"
#include "debugfs.h"
-static int perf_open(void)
-{
- struct perf_event_attr attr;
-
- memset(&attr, 0, sizeof (attr));
-
- attr.type = i915_type_id();
- if (attr.type == 0)
- return -ENOENT;
- attr.config = I915_PERF_INTERRUPTS;
-
- return perf_event_open(&attr, -1, 0, -1, 0);
-}
-
static long long debugfs_read(void)
{
char buf[8192], *b;
@@ -127,7 +113,7 @@ int gem_interrupts_init(struct gem_interrupts *irqs)
{
memset(irqs, 0, sizeof(*irqs));
- irqs->fd = perf_open();
+ irqs->fd = perf_i915_open(I915_PERF_INTERRUPTS);
if (irqs->fd < 0 && interrupts_read() < 0)
irqs->error = ENODEV;