diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-12-14 20:47:26 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-12-14 21:30:36 +0000 |
commit | f8189464485ccbd07776e8c1a3aa1582e365cfe0 (patch) | |
tree | e48611e1a1a5ebf6a49b4895af75a23e051b976f | |
parent | cc23c25c368a4a6d721a9b8a3c9bf32044ebc585 (diff) |
tools: Use igt_device_get_pci_device() for known fd
If we know the right device fd, we can find the exact matching pci
device.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
-rw-r--r-- | tools/intel_l3_parity.c | 5 | ||||
-rw-r--r-- | tools/intel_perf_counters.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c index 484dd028..8225b272 100644 --- a/tools/intel_l3_parity.c +++ b/tools/intel_l3_parity.c @@ -36,6 +36,7 @@ #include <getopt.h> #include "intel_chipset.h" #include "intel_io.h" +#include "igt_device.h" #include "igt_sysfs.h" #include "drmtest.h" #include "config.h" @@ -192,7 +193,9 @@ int main(int argc, char *argv[]) if (intel_gen(devid) < 7 || IS_VALLEYVIEW(devid)) exit(77); - assert(intel_register_access_init(&mmio_data, intel_get_pci_device(), 0, device) == 0); + assert(intel_register_access_init(&mmio_data, + igt_device_get_pci_device(device), + 0, device) == 0); dir = igt_sysfs_open(device); diff --git a/tools/intel_perf_counters.c b/tools/intel_perf_counters.c index 22ad69a2..d297f2e8 100644 --- a/tools/intel_perf_counters.c +++ b/tools/intel_perf_counters.c @@ -44,6 +44,7 @@ #include "drm.h" #include "i915_drm.h" +#include "igt_device.h" #include "drmtest.h" #include "intel_io.h" #include "intel_batchbuffer.h" @@ -483,8 +484,9 @@ main(int argc, char **argv) if (oacontrol) { /* Forcewake */ - intel_register_access_init(&mmio_data, intel_get_pci_device(), - 0, fd); + intel_register_access_init(&mmio_data, + igt_device_get_pci_device(fd), + 0, fd); /* Enable performance counters */ intel_register_write(&mmio_data, OACONTROL, |