tests: improve concurrent blit tests

By adding another testcase that follows up with a gpu read. This
checks whether the kernel properly tracks the pending write and
doesn't lose it (or sync up to the wrong seqno).

For some odd reason only the cpu mmap variant blows up, the gtt one
works here. I need to look into that some more.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2012-07-13 10:35:11 +02:00
parent fbd6d04959
commit d9fb72e266
2 changed files with 24 additions and 2 deletions

View File

@ -93,7 +93,7 @@ main(int argc, char **argv)
drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
int num_buffers = 128, max;
drm_intel_bo *src[128], *dst[128];
drm_intel_bo *src[128], *dst[128], *dummy;
int width = 512, height = 512;
int fd;
int i;
@ -112,6 +112,7 @@ main(int argc, char **argv)
src[i] = create_bo(bufmgr, i, width, height);
dst[i] = create_bo(bufmgr, ~i, width, height);
}
dummy = create_bo(bufmgr, 0, width, height);
/* try to overwrite the source values */
for (i = 0; i < num_buffers; i++)
@ -127,5 +128,15 @@ main(int argc, char **argv)
for (i = num_buffers; i--; )
cmp_bo(dst[i], 0xdeadbeef, width, height);
/* and finally try to trick the kernel into loosing the pending write */
for (i = num_buffers; i--; )
set_bo(src[i], 0xabcdabcd, width, height);
for (i = 0; i < num_buffers; i++)
intel_copy_bo(batch, dst[i], src[i], width, height);
for (i = num_buffers; i--; )
intel_copy_bo(batch, dummy, dst[i], width, height);
for (i = num_buffers; i--; )
cmp_bo(dst[i], 0xabcdabcd, width, height);
return 0;
}

View File

@ -96,7 +96,7 @@ main(int argc, char **argv)
drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
int num_buffers = 128, max;
drm_intel_bo *src[128], *dst[128];
drm_intel_bo *src[128], *dst[128], *dummy;
int width = 512, height = 512;
int fd;
int i;
@ -115,6 +115,7 @@ main(int argc, char **argv)
src[i] = create_bo(bufmgr, i, width, height);
dst[i] = create_bo(bufmgr, ~i, width, height);
}
dummy = create_bo(bufmgr, 0, width, height);
/* try to overwrite the source values */
for (i = 0; i < num_buffers; i++)
@ -130,5 +131,15 @@ main(int argc, char **argv)
for (i = num_buffers; i--; )
cmp_bo(dst[i], 0xdeadbeef, width, height);
/* and finally try to trick the kernel into loosing the pending write */
for (i = num_buffers; i--; )
set_bo(src[i], 0xabcdabcd, width, height);
for (i = 0; i < num_buffers; i++)
intel_copy_bo(batch, dst[i], src[i], width, height);
for (i = num_buffers; i--; )
intel_copy_bo(batch, dummy, dst[i], width, height);
for (i = num_buffers; i--; )
cmp_bo(dst[i], 0xabcdabcd, width, height);
return 0;
}