diff options
author | Daniel Mrzyglod <daniel.t.mrzyglod@intel.com> | 2019-08-29 15:10:37 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-29 17:05:29 +0100 |
commit | d38950f2c0ca846816c9b0e6601181cc7e1982de (patch) | |
tree | d0693ca7e6bb61d387f4ca2e75c93fa4e265e235 /tools/intel_perf_counters.c | |
parent | 6e3af15a9e9dcd6159a74e5e66aec3e1c1347d51 (diff) |
lib/intel_mmio: add additional api for multiple devices
Library was limited for reading registers for only
one device at a time in igt tests.
Changes in this patch give as oportunity to test multiple devices in
the same time.
v8: pack and rename structure, remove unnecessary field
v7: remove unnecessary code
v6: Reword patch. Cosmetic changes.
Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Daniele Spurio Ceraolo <daniele.ceraolospurio@intel.com>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Zbigniew KempczyĆski <zbigniew.kempczynski@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools/intel_perf_counters.c')
-rw-r--r-- | tools/intel_perf_counters.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/intel_perf_counters.c b/tools/intel_perf_counters.c index 50c4bce6..5824d9c1 100644 --- a/tools/intel_perf_counters.c +++ b/tools/intel_perf_counters.c @@ -441,6 +441,7 @@ gen7_get_counters(void) int main(int argc, char **argv) { + struct intel_mmio_data mmio_data; uint32_t devid; int counter_format; int counter_count; @@ -483,10 +484,11 @@ main(int argc, char **argv) if (oacontrol) { /* Forcewake */ - intel_register_access_init(intel_get_pci_device(), 0, fd); + intel_register_access_init(&mmio_data, intel_get_pci_device(), + 0, fd); /* Enable performance counters */ - intel_register_write(OACONTROL, + intel_register_write(&mmio_data, OACONTROL, counter_format << OACONTROL_COUNTER_SELECT_SHIFT | PERFORMANCE_COUNTER_ENABLE); } @@ -520,10 +522,10 @@ main(int argc, char **argv) if (oacontrol) { /* Disable performance counters */ - intel_register_write(OACONTROL, 0); + intel_register_write(&mmio_data, OACONTROL, 0); /* Forcewake */ - intel_register_access_fini(); + intel_register_access_fini(&mmio_data); } free(totals); |