From 376b813e7c60826357034f4ea40ffada514fbdc3 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 3 Jul 2016 09:42:38 +0100 Subject: 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 --- tests/kms_cursor_legacy.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'tests/kms_cursor_legacy.c') 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 #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++; } -- cgit v1.2.3