summaryrefslogtreecommitdiff
path: root/tests/kms_cursor_legacy.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 /tests/kms_cursor_legacy.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 'tests/kms_cursor_legacy.c')
-rw-r--r--tests/kms_cursor_legacy.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 192a0cf3..7dca383e 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -26,6 +26,7 @@
#include <sched.h>
#include "igt.h"
+#include "igt_rand.h"
#include "igt_stats.h"
#if defined(__x86_64__) || defined(__i386__)
@@ -41,16 +42,6 @@ struct data {
drmModeRes *resources;
};
-static uint32_t state = 0x12345678;
-
-static uint32_t
-hars_petruska_f54_1_random (void)
-{
-#define rol(x,k) ((x << k) | (x >> (32-k)))
- return state = (state ^ rol (state, 5) ^ rol (state, 24)) + 0x37798849;
-#undef rol
-}
-
static void stress(struct data *data,
uint32_t *crtc_id, unsigned num_crtcs,
int num_children, unsigned mode,
@@ -94,9 +85,9 @@ static void stress(struct data *data,
CPU_SET(child, &allowed);
sched_setaffinity(getpid(), sizeof(cpu_set_t), &allowed);
- state ^= child;
+ hars_petruska_f54_1_random_perturb(child);
igt_until_timeout(timeout) {
- arg.crtc_id = crtc_id[hars_petruska_f54_1_random() % num_crtcs];
+ arg.crtc_id = crtc_id[hars_petruska_f54_1_random_unsafe() % num_crtcs];
do_ioctl(data->fd, DRM_IOCTL_MODE_CURSOR, &arg);
count++;
}