From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAADC6EB7F for ; Fri, 3 Apr 2020 13:03:28 +0000 (UTC) From: Arkadiusz Hiler Date: Fri, 3 Apr 2020 16:03:01 +0300 Message-ID: <20200403130306.1272436-1-arkadiusz.hiler@intel.com> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t 1/6] tests/kms_vblank: Make sure that we have a mode set List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org List-ID: Subtest 'invalid' was depending on a "leftover" mode set by something external (usually fbcon) in order to work. Let's make the test more robust by setting the mode explicitly. Cc: Imre Deak Signed-off-by: Arkadiusz Hiler --- tests/kms_vblank.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c index a895ab80..edf8581e 100644 --- a/tests/kms_vblank.c +++ b/tests/kms_vblank.c @@ -472,9 +472,22 @@ static void invalid_subtest(data_t *data, int fd) { union drm_wait_vblank vbl; unsigned long valid_flags; + enum pipe pipe; + igt_output_t* output; + bool found = false; igt_display_require_output_on_pipe(&data->display, 0); + /* we need to have a mode set, otherwise we will get EINVAL no matter what */ + for_each_pipe_with_single_output(&data->display, pipe, output) { + data->pipe = pipe; + found = true; + break; + } + + igt_require_f(found, "No outputs connected = no vblanks\n"); + prepare_crtc(data, fd, output); + /* First check all is well with a simple query */ memset(&vbl, 0, sizeof(vbl)); vbl.request.type = DRM_VBLANK_RELATIVE; @@ -508,6 +521,7 @@ 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 -- 2.24.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev