tests/gem_lut_handle: Quit when we hit ENOSPC

I'd been working under the falsehood that we would always generate an
error for an invalid reloc->target_handle before reserving any object.
However, only the execlist is checked up front for validity before
reservation so ENOSPC is a genuine error condition raised by the test.
Fix it so that we stop reporting that limit as a test failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65391
This commit is contained in:
Chris Wilson 2013-06-27 19:58:57 +01:00
parent 60e3930987
commit ebfd01908f

View File

@ -126,7 +126,7 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsign
uint32_t target;
if (flags & BROKEN) {
target = -(rand() % 4096);
target = -(rand() % 4096) - 1;
} else {
target = rand() % (num_exec + 1);
if ((flags & USE_LUT) == 0)
@ -198,6 +198,10 @@ int main(int argc, char **argv)
fail(exec(fd, handle, USE_LUT | BROKEN));
for (i = 2; i <= 65536; i *= 2) {
if (many_exec(fd, handle, i+1, i+1, NORMAL) == -1 &&
errno == ENOSPC)
break;
pass(many_exec(fd, handle, i-1, i-1, NORMAL));
pass(many_exec(fd, handle, i-1, i, NORMAL));
pass(many_exec(fd, handle, i-1, i+1, NORMAL));