From ebfd01908f787876040a679fc7895828b23d268d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 27 Jun 2013 19:58:57 +0100 Subject: [PATCH] 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 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65391 --- tests/gem_lut_handle.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/gem_lut_handle.c b/tests/gem_lut_handle.c index 34f886bf..339e7632 100644 --- a/tests/gem_lut_handle.c +++ b/tests/gem_lut_handle.c @@ -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));