summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2019-03-12 13:48:13 +0100
committerMichał Winiarski <michal.winiarski@intel.com>2019-03-20 10:36:36 +0100
commit8ae86621d6fff60b6e20c6b0f9b336785c935b0f (patch)
tree12d83d267f5dafb16bcef5edec173ff57cf4dfbd /benchmarks
parent1bbe0b11a40cbb8433a3863745b7023e54c36ae3 (diff)
lib/igt_device: Move intel_get_pci_device under igt_device
It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/gem_latency.c4
-rw-r--r--benchmarks/gem_wsim.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index c3fc4bf0..a20bbf8a 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -44,6 +44,8 @@
#include <sys/resource.h>
#include "drm.h"
+#include "igt_device.h"
+
#define LOCAL_I915_EXEC_FENCE_IN (1<<16)
#define LOCAL_I915_EXEC_FENCE_OUT (1<<17)
@@ -456,7 +458,7 @@ static int run(int seconds,
if (gen < 6)
return IGT_EXIT_SKIP; /* Needs BCS timestamp */
- intel_register_access_init(intel_get_pci_device(), false, fd);
+ intel_register_access_init(igt_device_get_pci_device(fd), false, fd);
if (gen == 6)
timestamp_reg = REG(RCS_TIMESTAMP);
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index afb9644d..21e26686 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -41,7 +41,6 @@
#include <limits.h>
#include <pthread.h>
-
#include "intel_chipset.h"
#include "intel_reg.h"
#include "drm.h"
@@ -50,6 +49,7 @@
#include "intel_io.h"
#include "igt_aux.h"
+#include "igt_device.h"
#include "igt_rand.h"
#include "igt_perf.h"
#include "sw_sync.h"
@@ -2223,7 +2223,7 @@ static void init_clocks(void)
uint32_t rcs_start, rcs_end;
double overhead, t;
- intel_register_access_init(intel_get_pci_device(), false, fd);
+ intel_register_access_init(igt_device_get_pci_device(fd), false, fd);
if (verbose <= 1)
return;