From 7736d7ebb141b5e0bdfdcfa68001e4e00f59838d Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Tue, 9 May 2017 09:21:03 +0100 Subject: gem_wsim: Enable initial per-workload round-robin VCS engine assignment New command option -R enables the initial VCS engine assignment to be round-robinned across all clients. Signed-off-by: Tvrtko Ursulin --- benchmarks/gem_wsim.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'benchmarks') diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 26750a01..91d6fb7f 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -132,6 +132,7 @@ static int fd; #define BALANCE (1<<2) #define RT (1<<3) #define VCS2REMAP (1<<4) +#define INITVCSRR (1<<5) #define VCS_SEQNO_IDX(engine) (((engine) - VCS1) * 16) #define VCS_SEQNO_OFFSET(engine) (VCS_SEQNO_IDX(engine) * sizeof(uint32_t)) @@ -617,12 +618,15 @@ alloc_step_batch(struct workload *wrk, struct w_step *w, unsigned int flags) } static void -prepare_workload(struct workload *wrk, unsigned int flags) +prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags) { int max_ctx = -1; struct w_step *w; int i; + if (flags & INITVCSRR) + wrk->vcs_rr = id & 1; + if (flags & SEQNO) { const unsigned int status_sz = sizeof(uint32_t); uint32_t handle = gem_create(fd, status_sz); @@ -1123,7 +1127,8 @@ static void print_help(void) " -c Fork N clients emitting the workload simultaneously.\n" " -x Swap VCS1 and VCS2 engines in every other client.\n" " -b Load balancing to use. (0: rr, 1: qd, 2: rt, 3: rtr)\n" -" -2 Remap VCS2 to BCS\n" +" -2 Remap VCS2 to BCS.\n" +" -R Round-robin initial VCS assignment per client.\n" ); } @@ -1188,7 +1193,7 @@ int main(int argc, char **argv) fd = drm_open_driver(DRIVER_INTEL); intel_register_access_init(intel_get_pci_device(), false, fd); - while ((c = getopt(argc, argv, "q2c:n:r:xw:W:t:b:h")) != -1) { + while ((c = getopt(argc, argv, "q2Rc:n:r:xw:W:t:b:h")) != -1) { switch (c) { case 'W': if (master_workload >= 0) { @@ -1223,6 +1228,9 @@ int main(int argc, char **argv) case '2': flags |= VCS2REMAP; break; + case 'R': + flags |= INITVCSRR; + break; case 'b': switch (strtol(optarg, NULL, 0)) { case 0: @@ -1340,7 +1348,7 @@ int main(int argc, char **argv) if (flags & SWAPVCS && i & 1) flags_ &= ~SWAPVCS; - prepare_workload(w[i], flags_); + prepare_workload(i, w[i], flags_); } clock_gettime(CLOCK_MONOTONIC, &t_start); -- cgit v1.2.3