summaryrefslogtreecommitdiff
path: root/tests/panfrost_submit.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2021-06-22 10:51:02 +0200
committerBoris Brezillon <boris.brezillon@collabora.com>2021-06-28 10:04:30 +0200
commitc2a8d23b2e3d9d37df06a4c756105f8b2998da88 (patch)
tree068da100ce4599aa9aa4ac805f32f8d9977e3838 /tests/panfrost_submit.c
parent09b7e9dbd4b9fb927a08d2ed334f2ca6749bcf1d (diff)
tests/panfrost: Extend the pan-reset test
Extend the pan-reset test to make sure jobs from other context get resumed after a reset. v2: * New patch Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Diffstat (limited to 'tests/panfrost_submit.c')
-rw-r--r--tests/panfrost_submit.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/tests/panfrost_submit.c b/tests/panfrost_submit.c
index abc27492..6c47d1f2 100644
--- a/tests/panfrost_submit.c
+++ b/tests/panfrost_submit.c
@@ -130,26 +130,31 @@ igt_main
}
igt_subtest("pan-reset") {
- struct panfrost_submit *submit;
- struct mali_job_descriptor_header *headers[2];
-
- submit = igt_panfrost_job_loop(fd);
- headers[0] = igt_panfrost_job_loop_get_job_header(submit, 0);
- headers[1] = igt_panfrost_job_loop_get_job_header(submit, 1);
- do_ioctl(fd, DRM_IOCTL_PANFROST_SUBMIT, submit->args);
-
- /* The job should stay active for BAD_JOB_TIME_NSEC until the
- * scheduler consider it as a GPU hang and reset the GPU.
- * After the reset, the job fence is signaled.
- */
- igt_assert(!syncobj_wait(fd, &submit->args->out_sync, 1,
+ int tmpfd = drm_open_driver(DRIVER_PANFROST);
+ struct panfrost_submit *submit[2];
+ struct mali_job_descriptor_header *headers[3];
+
+ submit[0] = igt_panfrost_job_loop(fd);
+ submit[1] = igt_panfrost_null_job(tmpfd);
+ headers[0] = igt_panfrost_job_loop_get_job_header(submit[0], 0);
+ headers[1] = igt_panfrost_job_loop_get_job_header(submit[0], 1);
+ headers[2] = submit[1]->submit_bo->map;
+ do_ioctl(fd, DRM_IOCTL_PANFROST_SUBMIT, submit[0]->args);
+ do_ioctl(tmpfd, DRM_IOCTL_PANFROST_SUBMIT, submit[1]->args);
+ /* First job should timeout, second job should complete right after the timeout */
+ igt_assert(!syncobj_wait(fd, &submit[0]->args->out_sync, 1,
abs_timeout(SHORT_TIME_NSEC), 0, NULL));
- igt_assert(syncobj_wait(fd, &submit->args->out_sync, 1,
+ igt_assert(syncobj_wait(fd, &submit[0]->args->out_sync, 1,
abs_timeout(BAD_JOB_TIME_NSEC), 0, NULL));
+ igt_assert(syncobj_wait(tmpfd, &submit[1]->args->out_sync, 1,
+ abs_timeout(SHORT_TIME_NSEC), 0, NULL));
/* At least one job header of the job loop should have its exception status set to 0 */
igt_assert(headers[0]->exception_status != 1 || headers[1]->exception_status != 1);
- igt_panfrost_free_job(fd, submit);
+ check_done(headers[2]);
+ igt_panfrost_free_job(fd, submit[0]);
+ igt_panfrost_free_job(tmpfd, submit[1]);
+ close(tmpfd);
}
igt_fixture {