summaryrefslogtreecommitdiff
path: root/tests/gem_fence_thrash.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-10-15 13:46:19 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-10-15 13:46:19 +0200
commit2e9e27ce6b7b7cb2db39590265d08bd19386855d (patch)
tree3f17b35a9d57d3ee5b0791b55bd331f162b1b81b /tests/gem_fence_thrash.c
parentb75451838a0b4315fa9494691c1615bce178d424 (diff)
tests/gem_fence_trash: some retuning
We actually want to test lru behaviour, so do a bit of work with the fence before yielding to the next thread (we use twice as many fences as there are, so yielding always is pretty bad, no matter how clever our fence stealing). Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_fence_thrash.c')
-rw-r--r--tests/gem_fence_thrash.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 8f2203c5..8ed4e08e 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -44,7 +44,7 @@
#include "i915_drm.h"
#include "drmtest.h"
-#define OBJECT_SIZE (1024*1024) /* restricted to 1MiB alignment on i915 fences */
+#define OBJECT_SIZE (128*1024) /* restricted to 1MiB alignment on i915 fences */
/* Before introduction of the LRU list for fences, allocation of a fence for a page
* fault would use the first inactive fence (i.e. in preference one with no outstanding
@@ -102,17 +102,15 @@ static void *
bo_copy (void *_arg)
{
int fd = *(int *)_arg;
- int offset = 0, n;
+ int n;
char *a, *b;
a = bo_create (fd);
b = bo_create (fd);
- for (n = 0; n < OBJECT_SIZE; n++) {
- memcpy (a + offset, b + offset, 1);
+ for (n = 0; n < 1000; n++) {
+ memcpy (a, b, OBJECT_SIZE);
pthread_yield ();
- offset += 4097;
- offset %= OBJECT_SIZE;
}
return NULL;