tests: Add gem_cpu_reloc
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 2 Oct 2012 16:27:16 +0000 (17:27 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 2 Oct 2012 16:35:01 +0000 (17:35 +0100)
commit3b9a76d2fa40b43ed3231d3c5382ea05317b9bde
tree54091753f2fd04ec98ab389566eb1e2ef2235258
parentd619a672df97f34cfbbebe89ed8cbe15827182a1
tests: Add gem_cpu_reloc

Attempt to stress test performing relocations whilst the batch is in the
CPU domain.

A freshly allocated buffer starts in the CPU domain, and the pwrite
should also be performed whilst in the CPU domain and so we should
execute the relocations within the CPU domain. If for any reason one of
those steps should land it in the GTT domain, we take the secondary
precaution of filling the mappable portion of the GATT.

In order to detect whether a relocation fails, we first fill a target
buffer with a sequence of invalid commands that would cause the GPU to
immediate hang, and then attempt to overwrite them with a legal, if
short, batchbuffer using a BLT. Then we come to execute the bo, if the
relocation fail and we either copy across all zeros or garbage, then the
GPU will hang.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
tests/.gitignore
tests/Makefile.am
tests/gem_cpu_reloc.c [new file with mode: 0644]