summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-11-27 21:23:12 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-11-28 11:53:41 +0000
commit33bd443623bdd3ffe0860b2de00d484e5ce74f5e (patch)
tree3745faa4c0e0097c74d1de58062b8c029be33916 /tests
parentb6321b58dcaa41ba1d28aced42d6b15dc3d49ca2 (diff)
i915/gem_exec_capture: Trim the blocking workload
While we want the capture to last long enough to delay the concurrent client, we don't want to wait forever for the capture to complete to proceed with the testing. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2559 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/i915/gem_exec_capture.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c
index cb0d3151..3da78d63 100644
--- a/tests/i915/gem_exec_capture.c
+++ b/tests/i915/gem_exec_capture.c
@@ -21,6 +21,7 @@
* IN THE SOFTWARE.
*/
+#include <sys/poll.h>
#include <zlib.h>
#include "i915/gem.h"
@@ -524,6 +525,7 @@ static void prioinv(int fd, int dir, unsigned ring, const char *name)
gtt, ram);
count = min(gtt, ram) / 4;
+ count = min(count, 256); /* Keep the duration within reason */
igt_require(count > 1);
intel_require_memory(count, size, CHECK_RAM);
@@ -535,18 +537,26 @@ static void prioinv(int fd, int dir, unsigned ring, const char *name)
igt_assert(pipe(link) == 0);
igt_fork(child, 1) {
fd = gem_reopen_driver(fd);
- igt_debug("Submitting large hang + capture\n");
+ igt_debug("Submitting large capture [%ld x %dMiB objects]\n",
+ count, (int)(size >> 20));
free(__captureN(fd, dir, ring, size, count, ASYNC));
write(link[1], &fd, sizeof(fd)); /* wake the parent up */
igt_force_gpu_reset(fd);
+ write(link[1], &fd, sizeof(fd)); /* wake the parent up */
}
read(link[0], &dummy, sizeof(dummy));
+ igt_require_f(poll(&(struct pollfd){link[0], POLLIN}, 1, 500) == 0,
+ "Capture completed too quickly! Will not block\n");
igt_debug("Submitting nop\n");
gem_execbuf(fd, &execbuf);
igt_assert_eq(gem_wait(fd, obj.handle, &timeout), 0);
gem_close(fd, obj.handle);
+ igt_assert_f(poll(&(struct pollfd){link[0], POLLIN}, 1, 0) == 0,
+ "Capture completed before nop!\n");
+
+ igt_debug("Waiting for capture/reset to complete\n");
igt_waitchildren();
close(link[0]);
close(link[1]);