[igt-dev] [PATCH i-g-t 03/17] benchmarks/gem_wsim: fix duration range check
Marcin Bernatowicz
marcin.bernatowicz at linux.intel.com
Thu Oct 5 18:57:21 UTC 2023
When scale duration (-f) command line option is provided,
the max duration check does not take it into account, fix it.
v2:
- improve error message (Tvrtko)
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
---
benchmarks/gem_wsim.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 42690d3d0..9d9cbd9c2 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -1142,10 +1142,10 @@ parse_workload(struct w_arg *arg, unsigned int flags, double scale_dur,
if (sep && *sep == '-') {
tmpl = strtol(sep + 1, NULL, 10);
check_arg(tmpl <= 0 ||
- tmpl <= step.duration.min ||
+ __duration(tmpl, scale_dur) <= step.duration.min ||
tmpl == LONG_MIN ||
tmpl == LONG_MAX,
- "Invalid duration range at step %u!\n",
+ "Invalid maximum duration at step %u!\n",
nr_steps);
step.duration.max = __duration(tmpl,
scale_dur);
--
2.42.0
More information about the igt-dev
mailing list