From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 62F776E0E4 for ; Thu, 12 Mar 2020 09:51:57 +0000 (UTC) From: Arkadiusz Hiler Date: Thu, 12 Mar 2020 11:51:37 +0200 Message-ID: <20200312095137.551252-2-arkadiusz.hiler@intel.com> In-Reply-To: <20200312095137.551252-1-arkadiusz.hiler@intel.com> References: <20200312095137.551252-1-arkadiusz.hiler@intel.com> MIME-Version: 1.0 Subject: [igt-dev] [PATCH i-g-t 2/2] tests/kms_chamelium: Don't fail random palnes tests on invalid config 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 Cc: Petri Latvala , Martin Peres List-ID: It is possible to generate a configuration that the driver rejects because it cannot be handled (e.g. exceeding the number of available scalers). Until now the test was failing in such cases with: igt_kms-CRITICAL: Test assertion failure function igt_display_commit_atomic, file ../lib/igt_kms.c:3490: igt_kms-CRITICAL: Failed assertion: ret == 0 igt_kms-CRITICAL: Last errno: 22, Invalid argument igt_kms-CRITICAL: error: -22 != 0 With this change we will just note that the atomic commit is invalid and pass the test without causing random noise. Cc: Petri Latvala Cc: Martin Peres Signed-off-by: Arkadiusz Hiler --- tests/kms_chamelium.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c index 8046ac65..b563cce4 100644 --- a/tests/kms_chamelium.c +++ b/tests/kms_chamelium.c @@ -2402,6 +2402,7 @@ static void test_display_planes_random(data_t *data, bool allow_yuv; unsigned int i; unsigned int fb_id; + int ret; switch (check) { case CHAMELIUM_CHECK_CRC: @@ -2478,7 +2479,15 @@ static void test_display_planes_random(data_t *data, fb_crc = chamelium_calculate_fb_crc_async_start(data->drm_fd, &result_fb); - igt_display_commit2(&data->display, COMMIT_ATOMIC); + ret = igt_display_try_commit2(&data->display, COMMIT_ATOMIC); + + /* we have invalid configuration, noting we can do */ + if (ret == -EINVAL) { + igt_info("The random plane configuration is invalid, " + "passing the test without testing anything.\n"); + goto cleanup; + } + if (check == CHAMELIUM_CHECK_CRC) { chamelium_capture(data->chamelium, port, 0, 0, 0, 0, 1); @@ -2505,6 +2514,8 @@ static void test_display_planes_random(data_t *data, chamelium_destroy_frame_dump(dump); } +cleanup: + for (i = 0; i < overlay_planes_count; i++) igt_remove_fb(data->drm_fd, &overlay_fbs[i]); -- 2.24.1 _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev