From 47fef4731e0f0f77b35a09e091b11c56669feb1b Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Wed, 13 Sep 2017 18:08:02 +0100 Subject: 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 Reviewed-by: Chris Wilson --- overlay/gem-interrupts.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'overlay/gem-interrupts.c') 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; -- cgit v1.2.3