diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-07-20 10:08:28 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-09-07 19:03:03 +0100 |
commit | 61f8de7d04e6b69d1cb43770bbef522311ebc3cc (patch) | |
tree | 7ebf71fbc8e88f0d829bec856e1cba68288765c3 /lib/igt_rand.h | |
parent | a19ef054c5a2f3ea4aa64f01449bbb015fa88707 (diff) |
igt/gem_exec_schedule: Exercise reordering with many priority levels
Apply a little more stress to the scheduler.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: MichaĆ Winiarski <michal.winiarski@intel.com>
Diffstat (limited to 'lib/igt_rand.h')
-rw-r--r-- | lib/igt_rand.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/igt_rand.h b/lib/igt_rand.h index f664af41..c9cb3243 100644 --- a/lib/igt_rand.h +++ b/lib/igt_rand.h @@ -38,4 +38,10 @@ static inline void hars_petruska_f54_1_random_perturb(uint32_t xor) hars_petruska_f54_1_random_seed(hars_petruska_f54_1_random_unsafe()); } +/* Returns: pseudo-random number in interval [0, ep_ro) */ +static inline uint32_t hars_petruska_f54_1_random_unsafe_max(uint32_t ep_ro) +{ + return ((uint64_t)hars_petruska_f54_1_random_unsafe() * ep_ro) >> 32; +} + #endif /* IGT_RAND_H */ |