mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 05:13:47 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user