[igt-dev] [PATCH i-g-t] tests/kms_vblank: Fix spurious test failure.
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Fri Feb 2 11:41:16 UTC 2018
igt_system_suspend_autoresume() calls igt_require(), which isn't allowed
to be called from a forked child. Run subtests directly from the test body,
except when a forked test is requested.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104783
---
tests/kms_vblank.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 5df2da7b038c..c94e67f41976 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -113,8 +113,6 @@ static int wait_vblank(int fd, union drm_wait_vblank *vbl)
static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
{
- int nchildren =
- data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
igt_display_t *display = &data->display;
igt_output_t *output = data->output;
int fd = display->drm_fd;
@@ -143,9 +141,14 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
igt_assert_eq(wait_vblank(fd, &vbl), 0);
}
- igt_fork(child, nchildren)
- testfunc(data, fd, nchildren);
- igt_waitchildren();
+ if (data->flags & FORKED) {
+ int nchildren = sysconf(_SC_NPROCESSORS_ONLN);
+
+ igt_fork(child, nchildren)
+ testfunc(data, fd, nchildren);
+ igt_waitchildren();
+ } else
+ testfunc(data, fd, 1);
if (data->flags & BUSY) {
struct drm_event_vblank buf;
--
2.15.1
More information about the igt-dev
mailing list