tests/kms_vblank: Turn on hardware before testing invalid vblank.
PATCH v3 1/1 tests/kms_vblank: Turn on hardware before testing invalid vblank.
From: Mark Yacoub <[email protected]>
[Why]
Before any hardware is on, the vblank is off and its ref counter is in an initialized state as each driver handles toggling it differently. Ioctl DRM_IOCTL_WAIT_VBLANK could return 0 such as on i915, or an invalid integer that doesn't mean much, such as on Zork running Kernel 5.4 due to the kernel workaround that increments the vblank ref count to prevent a get from enabling the interrupt.
[How]
For invalid_subtest(), active the CRTCs to turn the hardware on so DRM_IOCTL_WAIT_VBLANK returns something meaningful.
Changes since v3:
Turn on only 1 output instead of all.
Changes since v2:
1. Updated Signed-off-by.
Changes since v1:
1. Update Commit message
2. Rename variable p to pipe_number
--- tests/kms_vblank.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
tests/kms_vblank.c +14 -7
@@ -475,8 +475,13 @@ static void invalid_subtest(data_t *data, int fd) {union drm_wait_vblank vbl;unsigned long valid_flags; +igt_display_t * display = &data->display; +igt_output_t * output; -igt_display_require_output_on_pipe (&data->display,0 ); +igt_display_require_output_on_pipe (display,0 ); +igt_require (display->n_outputs); + output = &display->outputs[0 ]; +prepare_crtc (data, fd, output);/* First check all is well with a simple query */ memset (&vbl,0 ,sizeof (vbl));
@@ -511,6 +516,8 @@ static void invalid_subtest(data_t *data, int fd) vbl.request.type |= _DRM_VBLANK_SECONDARY; vbl.request.type |= _DRM_VBLANK_FLAGS_MASK;igt_assert_eq (wait_vblank (fd, &vbl), -EINVAL ); + +cleanup_crtc (data, fd, output); } igt_main
@@ -529,11 +536,11 @@ igt_main igt_subtest("invalid")invalid_subtest (&data, fd); -igt_describe ("check the Vblank and flip events works with given crtc id" ); - igt_subtest("crtc-id") -crtc_id_subtest (&data, fd); +// igt_describe("check the Vblank and flip events works with given crtc id"); +// igt_subtest("crtc-id") +// crtc_id_subtest(&data, fd); -for_each_pipe_static (data.pipe) - igt_subtest_group -run_subtests_for_pipe (&data); +// for_each_pipe_static(data.pipe) +// igt_subtest_group +// run_subtests_for_pipe(&data); }
Signature · 6 lines
2.32.0.288.g62a8d224e6-goog _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev