summaryrefslogtreecommitdiff
path: root/benchmarks/gem_wsim.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-05-16 08:11:29 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2017-05-16 08:11:29 +0100
commit26a5e655883f2b0a2ff903cb24e40d6e2570dbe3 (patch)
treeedc4d09094164bf1f233b5bb27b050851f58482a /benchmarks/gem_wsim.c
parent0943be8987ae9ab099ee9d1a1832cf62a918ca5b (diff)
gem_wsim: Simplify batch offset block a bit
Just compact it a bit by avoiding the min != max check duplication and change get_duration to change w_step. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'benchmarks/gem_wsim.c')
-rw-r--r--benchmarks/gem_wsim.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 93ffc1f2..5cf59a68 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -497,8 +497,10 @@ clone_workload(struct workload *_wrk)
#define PAGE_SIZE (4096)
#endif
-static unsigned int get_duration(struct duration *dur)
+static unsigned int get_duration(struct w_step *w)
{
+ struct duration *dur = &w->duration;
+
if (dur->min == dur->max)
return dur->min;
else
@@ -1306,14 +1308,9 @@ run_workload(unsigned int id, struct workload *wrk,
if (flags & RT)
update_bb_rt(w, engine, wrk->seqno[engine]);
- if (w->duration.min != w->duration.max) {
- unsigned int d = get_duration(&w->duration);
- unsigned long offset;
-
- offset = ALIGN(w->bb_sz - get_bb_sz(d),
- 2 * sizeof(uint32_t));
- w->eb.batch_start_offset = offset;
- }
+ w->eb.batch_start_offset =
+ ALIGN(w->bb_sz - get_bb_sz(get_duration(w)),
+ 2 * sizeof(uint32_t));
if (throttle > 0)
w_sync_to(wrk, w, i - throttle);