summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-03 09:42:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-03 11:23:05 +0100
commit376b813e7c60826357034f4ea40ffada514fbdc3 (patch)
tree12d829ab778cd16e0b41eea88d8153163e624485 /lib/igt_aux.c
parent3e765840129a17b462565f7b48dfe9d9792b292f (diff)
igt/gem_exec_gttfill: Reduce overhead in setting up filler batches
Since all the batches start with the same content, we can reuse the same buf to fill them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index d8e718f5..1cb93984 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -57,6 +57,7 @@
#include "igt_aux.h"
#include "igt_debugfs.h"
#include "igt_gt.h"
+#include "igt_rand.h"
#include "config.h"
#include "intel_reg.h"
#include "ioctl_wrappers.h"
@@ -486,15 +487,6 @@ void igt_exchange_int(void *array, unsigned i, unsigned j)
int_arr[j] = tmp;
}
-static uint32_t
-hars_petruska_f54_1_random_unsafe(void)
-{
- static uint32_t state = 0x12345678;
-#define rol(x,k) ((x << k) | (x >> (32-k)))
- return state = (state ^ rol (state, 5) ^ rol (state, 24)) + 0x37798849;
-#undef rol
-}
-
/**
* igt_permute_array:
* @array: pointer to array
@@ -1206,19 +1198,9 @@ static struct igt_siglatency {
int sig;
} igt_siglatency;
-static uint32_t
-__hars_petruska_f54_1_random (void)
-{
- static uint32_t state = 0x12345678;
-
-#define rol(x,k) ((x << k) | (x >> (32-k)))
- return state = (state ^ rol (state, 5) ^ rol (state, 24)) + 0x37798849;
-#undef rol
-}
-
static long delay(void)
{
- return __hars_petruska_f54_1_random() % (NSEC_PER_SEC / 1000);
+ return hars_petruska_f54_1_random_unsafe() % (NSEC_PER_SEC / 1000);
}
static double elapsed(const struct timespec *now, const struct timespec *last)