diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-12-14 03:42:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-12-14 03:42:31 +0000 |
commit | cf5b1d507965229d1bd385b8d610f6834e2f95db (patch) | |
tree | 0c954fa9c715cc9787f93df22af0e09a2308f2db | |
parent | cc9d528a22ece0df0391a38794e21c60a0b23740 (diff) | |
parent | 8430989a3a14a5963d9dcf53a90b0727bd28af02 (diff) | |
download | igt-gpu-tools-cf5b1d507965229d1bd385b8d610f6834e2f95db.tar.gz |
Merge "Fix igt-gpu-tools/kms_vblank test failure"
-rw-r--r-- | lib/igt_kms.c | 3 | ||||
-rw-r--r-- | tests/kms_vblank.c | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 218d3bedb..ba4de9c70 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -2916,7 +2916,8 @@ static int igt_plane_commit(igt_plane_t *plane, if (plane->type == DRM_PLANE_TYPE_CURSOR && s == COMMIT_LEGACY) { return igt_cursor_commit_legacy(plane, pipe, fail_on_error); - } else if (plane->type == DRM_PLANE_TYPE_PRIMARY && s == COMMIT_LEGACY) { + } else if (plane->type == DRM_PLANE_TYPE_PRIMARY && s == COMMIT_LEGACY && + plane == igt_pipe_get_plane_type(plane->pipe, DRM_PLANE_TYPE_PRIMARY)) { return igt_primary_plane_commit_legacy(plane, pipe, fail_on_error); } else { diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c index babef39d0..8076e136c 100644 --- a/tests/kms_vblank.c +++ b/tests/kms_vblank.c @@ -283,7 +283,16 @@ static void vblank_query(data_t *data, int fd, int nchildren) vbl.request.sequence = 0; igt_assert_eq(wait_vblank(fd, &vbl), 0); count++; - } while ((vbl.reply.sequence - sq) <= 120); + + /* + * break the loop and fail after 10 seconds to prevent hang. + * Ideally, it should take only 2 seconds for 120 vblank in 60 fps. + */ + clock_gettime(CLOCK_MONOTONIC, &end); + igt_assert_f(end.tv_sec - start.tv_sec < 10, + "VBlank Sequence number increased by only %lu in %lu seconds.\n", + vbl.reply.sequence - sq, end.tv_sec - start.tv_sec); + } while (vbl.reply.sequence <= (sq + 120)); clock_gettime(CLOCK_MONOTONIC, &end); igt_info("Time to query current counter (%s): %7.3fµs\n", |