From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB02CC36010 for ; Tue, 8 Apr 2025 00:02:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E84910E591; Tue, 8 Apr 2025 00:02:44 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="C8wqMpN+"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2FAF810E58E for ; Tue, 8 Apr 2025 00:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TeO15pTnC+hcOCguRxH/+h7ft1JK5+bR2A3QwwvRpR8=; b=C8wqMpN+2GMGwNkqtSt1c6g6LX G8A7J0i8mklxULPoF2EWWWHSh+nJIRuEBZU2BdaVc4t2p/RO3f250/BtFrwyAVNYWojYyQonK7Bul d5oBBRVhj5u7953hPGKS037/seRHtio/Vwo3pf7rL+Uib3BEunyoPNRRBs5OwoubzEy9GiJ8SR78S aefuSBWl0bJtLU5queVeVxKL0vsYxWP91M1qFntNaIwNsk5EXwjMDJgf/WuwHifvZhblagOEdAun/ n1qPYb6q+Ek6UV5NaMSkMBBpAA3L2hqM/IV3GZXb9AF5u+Lil0vyshNw8zexgvUZqnq2ZjfW3bC4o Ze751ygQ==; Received: from [187.57.129.172] (helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1u1wQJ-00D5aL-NL; Tue, 08 Apr 2025 02:02:40 +0200 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: igt-dev@lists.freedesktop.org, Jeevan B , Kamil Konieczny Cc: kernel-dev@igalia.com, Vitaly Prosyak , Alex Hung , Melissa Wen , Rodrigo Siqueira , =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v6 3/4] kms_async_flips: Refactor data options Date: Mon, 7 Apr 2025 21:02:20 -0300 Message-ID: <20250408000221.140459-4-andrealmeid@igalia.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250408000221.140459-1-andrealmeid@igalia.com> References: <20250408000221.140459-1-andrealmeid@igalia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" Setting the test data options as true and false for every test is error prone. Instead, reset all the data to false at the end of a test and just set the needed options to true before running a test. Signed-off-by: André Almeida Reviewed-by: Melissa Wen --- tests/kms_async_flips.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c index fc9cbd3f1..3535817b4 100644 --- a/tests/kms_async_flips.c +++ b/tests/kms_async_flips.c @@ -234,6 +234,12 @@ static void test_init(data_t *data) data->plane = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY); } +static void test_init_ops(data_t *data) +{ + data->alternate_sync_async = false; + data->atomic_path = false; +} + static void test_init_fbs(data_t *data) { int i; @@ -785,8 +791,7 @@ igt_main igt_describe("Wait for page flip events in between successive asynchronous flips"); igt_subtest_with_dynamic("async-flip-with-page-flip-events") { - data.alternate_sync_async = false; - data.atomic_path = false; + test_init_ops(&data); if (is_intel_device(data.drm_fd)) run_test_with_modifiers(&data, test_async_flip); else @@ -796,7 +801,7 @@ igt_main igt_describe("Wait for page flip events in between successive " "asynchronous flips using atomic path"); igt_subtest_with_dynamic("async-flip-with-page-flip-events-atomic") { - data.alternate_sync_async = false; + test_init_ops(&data); data.atomic_path = true; if (is_intel_device(data.drm_fd)) run_test_with_modifiers(&data, test_async_flip); @@ -806,13 +811,14 @@ igt_main igt_describe("Alternate between sync and async flips"); igt_subtest_with_dynamic("alternate-sync-async-flip") { + test_init_ops(&data); data.alternate_sync_async = true; - data.atomic_path = false; run_test(&data, test_async_flip); } igt_describe("Alternate between sync and async flips using atomic path"); igt_subtest_with_dynamic("alternate-sync-async-flip-atomic") { + test_init_ops(&data); data.alternate_sync_async = true; data.atomic_path = true; run_test(&data, test_async_flip); @@ -821,13 +827,14 @@ igt_main igt_describe("Verify that the async flip timestamp does not " "coincide with either previous or next vblank"); igt_subtest_with_dynamic("test-time-stamp") { - data.atomic_path = false; + test_init_ops(&data); run_test(&data, test_timestamp); } igt_describe("Verify that the async flip timestamp does not coincide " "with either previous or next vblank with atomic path"); igt_subtest_with_dynamic("test-time-stamp-atomic") { + test_init_ops(&data); data.atomic_path = true; run_test(&data, test_timestamp); } @@ -835,6 +842,7 @@ igt_main igt_describe("Verify that the DRM_IOCTL_MODE_CURSOR passes after async flip"); igt_subtest_with_dynamic("test-cursor") { + test_init_ops(&data); /* * Intel's PSR2 selective fetch adds other planes to state when * necessary, causing the async flip to fail because async flip is not @@ -844,13 +852,13 @@ igt_main "PSR2 sel fetch causes cursor to be added to primary plane " "pages flips and async flip is not supported in cursor\n"); - data.atomic_path = false; run_test(&data, test_cursor); } igt_describe("Verify that the DRM_IOCTL_MODE_CURSOR passes after " "async flip with atomic commit"); igt_subtest_with_dynamic("test-cursor-atomic") { + test_init_ops(&data); /* * Intel's PSR2 selective fetch adds other planes to state when * necessary, causing the async flip to fail because async flip is not @@ -865,6 +873,7 @@ igt_main igt_describe("Negative case to verify if changes in fb are rejected from kernel as expected"); igt_subtest_with_dynamic("invalid-async-flip") { + test_init_ops(&data); /* TODO: support more vendors */ igt_require(is_intel_device(data.drm_fd)); igt_require(igt_display_has_format_mod(&data.display, DRM_FORMAT_XRGB8888, @@ -872,13 +881,13 @@ igt_main igt_require(igt_display_has_format_mod(&data.display, DRM_FORMAT_XRGB8888, I915_FORMAT_MOD_Y_TILED)); - data.atomic_path = false; run_test(&data, test_invalid); } igt_describe("Negative case to verify if changes in fb are rejected " "from kernel as expected when async flip is done using atomic path"); igt_subtest_with_dynamic("invalid-async-flip-atomic") { + test_init_ops(&data); data.atomic_path = true; /* TODO: support more vendors */ igt_require(is_intel_device(data.drm_fd)); @@ -892,16 +901,17 @@ igt_main igt_describe("Use CRC to verify async flip scans out the correct framebuffer"); igt_subtest_with_dynamic("crc") { + test_init_ops(&data); /* Devices without CRC can't run this test */ igt_require_pipe_crc(data.drm_fd); - data.atomic_path = false; run_test(&data, test_crc); } igt_describe("Use CRC to verify async flip scans out the correct framebuffer " "with atomic commit"); igt_subtest_with_dynamic("crc-atomic") { + test_init_ops(&data); /* Devices without CRC can't run this test */ igt_require_pipe_crc(data.drm_fd); @@ -911,6 +921,7 @@ igt_main igt_describe("Verify the async flip functionality after suspend and resume cycle"); igt_subtest_with_dynamic("async-flip-suspend-resume") { + test_init_ops(&data); data.suspend_resume = true; run_test(&data, test_async_flip); } -- 2.49.0