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 4BB37D1CDC6 for ; Tue, 9 Dec 2025 15:25:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EDF0510E1F1; Tue, 9 Dec 2025 15:25:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="dOu2OjOf"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D1CE10E1F1 for ; Tue, 9 Dec 2025 15:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765293922; x=1796829922; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=m73HAvdWzGmNFBN422RCY/o32jsw0G539yvInA5mfF4=; b=dOu2OjOfR9vUtuOlayvHcYdS5ZPrbPUIHRUQc+YzNc4wbeMsY+7Dek8k l7X5ys52ggbgj8Z7emF7WXnWTZ94P94hfntQ3sr7BW1uT7XHPJKlRtBnR 6qUluszlTt3Juh87K6H4u8jT+J5S71gZvNYxkBtkII3itUxlLkOaAQyfe Ful6lZonGdggyD8nIw9NfvLKIMUaxTsrZftKKthHBjX/DUJeh/Qh8Hxyp ovDbY7PQYbFoTgPqkNJKGdjmysDS10cKQFflfcgzFfiMXzA67h+UkZN1Q Jo4A2jE0e7R0HbGKct1z+DNbDaT2pobJCDq+7/8jKud9AdxbczQ4IbC1R w==; X-CSE-ConnectionGUID: ZcWchFUFSHuVyAs9O8nIpA== X-CSE-MsgGUID: GaZArsIBQQCYRaLNQlZq+g== X-IronPort-AV: E=McAfee;i="6800,10657,11637"; a="78718595" X-IronPort-AV: E=Sophos;i="6.20,261,1758610800"; d="scan'208";a="78718595" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2025 07:25:22 -0800 X-CSE-ConnectionGUID: RidgWe8IQGmJNxfGIwxdoQ== X-CSE-MsgGUID: 8al4f0GYRfawlkYQh3vekw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,261,1758610800"; d="scan'208";a="197027766" Received: from bilal-nuc7i7bnh.iind.intel.com ([10.190.239.45]) by fmviesa010.fm.intel.com with ESMTP; 09 Dec 2025 07:25:20 -0800 From: Mohammed Bilal To: igt-dev@lists.freedesktop.org Cc: jeevan.b@intel.com, kunal1.joshi@intel.com, sameer.lattannavar@intel.com, karthik.b.s@intel.com, Mohammed Bilal Subject: [PATCH i-g-t v3 2/2] tests/chamelium/kms_chamelium_hpd: use helper function for connector lookup in DP/HDMI/VGA tests Date: Tue, 9 Dec 2025 20:53:59 +0530 Message-ID: <20251209152359.907648-3-mohammed.bilal@intel.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251209152359.907648-1-mohammed.bilal@intel.com> References: <20251209152359.907648-1-mohammed.bilal@intel.com> MIME-Version: 1.0 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" Replace the old connector_subtest() + per-connector igt_fixture blocks with a unified CONNECTOR_TEST() helper based on get_port(). The previous fixtures were always executed even when running other subtests, causing false failures when HDMI/VGA/DP connectors were not present. Using CONNECTOR_TEST() makes each subtest perform its own connector lookup and skip cleanly if unavailable, while removing repeated boilerplate across DP/HDMI/VGA hotplug tests. Signed-off-by: Mohammed Bilal --- tests/chamelium/kms_chamelium_hpd.c | 240 +++++++++++----------------- 1 file changed, 97 insertions(+), 143 deletions(-) diff --git a/tests/chamelium/kms_chamelium_hpd.c b/tests/chamelium/kms_chamelium_hpd.c index 161f494e9..198ec6039 100644 --- a/tests/chamelium/kms_chamelium_hpd.c +++ b/tests/chamelium/kms_chamelium_hpd.c @@ -463,157 +463,114 @@ IGT_TEST_DESCRIPTION("Testing HPD with a Chamelium board"); igt_main { chamelium_data_t data; - struct chamelium_port *port; - int p; igt_fixture { chamelium_init_test(&data); } igt_describe("DisplayPort tests"); - igt_subtest_group { - igt_fixture { - chamelium_require_connector_present( - data.ports, DRM_MODE_CONNECTOR_DisplayPort, - data.port_count, 1); - } - igt_describe(test_basic_hotplug_desc); - connector_subtest("dp-hpd", DisplayPort) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_DP_HDMI, - TEST_MODESET_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("dp-hpd-fast", DisplayPort) test_hotplug( - &data, port, HPD_TOGGLE_COUNT_FAST, TEST_MODESET_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("dp-hpd-enable-disable-mode", DisplayPort) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_FAST, - TEST_MODESET_ON_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("dp-hpd-with-enabled-mode", DisplayPort) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_FAST, - TEST_MODESET_ON); - - igt_describe(test_hotplug_for_each_pipe_desc); - connector_subtest("dp-hpd-for-each-pipe", DisplayPort) - test_hotplug_for_each_pipe(&data, port); - - igt_describe(test_suspend_resume_hpd_desc); - connector_subtest("dp-hpd-after-suspend", DisplayPort) - test_suspend_resume_hpd(&data, port, SUSPEND_STATE_MEM, - SUSPEND_TEST_NONE); - - igt_describe(test_suspend_resume_hpd_desc); - connector_subtest("dp-hpd-after-hibernate", DisplayPort) - test_suspend_resume_hpd(&data, port, SUSPEND_STATE_DISK, - SUSPEND_TEST_DEVICES); - - igt_describe(test_hpd_storm_detect_desc); - connector_subtest("dp-hpd-storm", DisplayPort) - test_hpd_storm_detect(&data, port, - HPD_STORM_PULSE_INTERVAL_DP); - - igt_describe(test_hpd_storm_disable_desc); - connector_subtest("dp-hpd-storm-disable", DisplayPort) - test_hpd_storm_disable(&data, port, - HPD_STORM_PULSE_INTERVAL_DP); - } + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("dp-hpd", DisplayPort, test_hotplug, + HPD_TOGGLE_COUNT_DP_HDMI, TEST_MODESET_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("dp-hpd-fast", DisplayPort, test_hotplug, + HPD_TOGGLE_COUNT_FAST, TEST_MODESET_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("dp-hpd-enable-disable-mode", DisplayPort, test_hotplug, + HPD_TOGGLE_COUNT_FAST, TEST_MODESET_ON_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("dp-hpd-with-enabled-mode", DisplayPort, test_hotplug, + HPD_TOGGLE_COUNT_FAST, TEST_MODESET_ON); + + igt_describe(test_hotplug_for_each_pipe_desc); + CONNECTOR_TEST("dp-hpd-for-each-pipe", DisplayPort, test_hotplug_for_each_pipe); + + igt_describe(test_suspend_resume_hpd_desc); + CONNECTOR_TEST("dp-hpd-after-suspend", DisplayPort, test_suspend_resume_hpd, + SUSPEND_STATE_MEM, SUSPEND_TEST_NONE); + + igt_describe(test_suspend_resume_hpd_desc); + CONNECTOR_TEST("dp-hpd-after-hibernate", DisplayPort, test_suspend_resume_hpd, + SUSPEND_STATE_DISK, SUSPEND_TEST_DEVICES); + + igt_describe(test_hpd_storm_detect_desc); + CONNECTOR_TEST("dp-hpd-storm", DisplayPort, test_hpd_storm_detect, + HPD_STORM_PULSE_INTERVAL_DP); + + igt_describe(test_hpd_storm_disable_desc); + CONNECTOR_TEST("dp-hpd-storm-disable", DisplayPort, test_hpd_storm_disable, + HPD_STORM_PULSE_INTERVAL_DP); igt_describe("HDMI tests"); - igt_subtest_group { - igt_fixture { - chamelium_require_connector_present( - data.ports, DRM_MODE_CONNECTOR_HDMIA, - data.port_count, 1); - } - igt_describe(test_basic_hotplug_desc); - connector_subtest("hdmi-hpd", HDMIA) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_DP_HDMI, - TEST_MODESET_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("hdmi-hpd-fast", HDMIA) test_hotplug( - &data, port, HPD_TOGGLE_COUNT_FAST, TEST_MODESET_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("hdmi-hpd-enable-disable-mode", HDMIA) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_FAST, - TEST_MODESET_ON_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("hdmi-hpd-with-enabled-mode", HDMIA) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_FAST, - TEST_MODESET_ON); - - igt_describe(test_hotplug_for_each_pipe_desc); - connector_subtest("hdmi-hpd-for-each-pipe", HDMIA) - test_hotplug_for_each_pipe(&data, port); - - igt_describe(test_suspend_resume_hpd_desc); - connector_subtest("hdmi-hpd-after-suspend", HDMIA) - test_suspend_resume_hpd(&data, port, SUSPEND_STATE_MEM, - SUSPEND_TEST_NONE); - - igt_describe(test_suspend_resume_hpd_desc); - connector_subtest("hdmi-hpd-after-hibernate", HDMIA) - test_suspend_resume_hpd(&data, port, SUSPEND_STATE_DISK, - SUSPEND_TEST_DEVICES); - - igt_describe(test_hpd_storm_detect_desc); - connector_subtest("hdmi-hpd-storm", HDMIA) - test_hpd_storm_detect(&data, port, - HPD_STORM_PULSE_INTERVAL_HDMI); - - igt_describe(test_hpd_storm_disable_desc); - connector_subtest("hdmi-hpd-storm-disable", HDMIA) - test_hpd_storm_disable(&data, port, - HPD_STORM_PULSE_INTERVAL_HDMI); - } + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("hdmi-hpd", HDMIA, test_hotplug, + HPD_TOGGLE_COUNT_DP_HDMI, TEST_MODESET_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("hdmi-hpd-fast", HDMIA, test_hotplug, + HPD_TOGGLE_COUNT_FAST, TEST_MODESET_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("hdmi-hpd-enable-disable-mode", HDMIA, test_hotplug, + HPD_TOGGLE_COUNT_FAST, TEST_MODESET_ON_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("hdmi-hpd-with-enabled-mode", HDMIA, test_hotplug, + HPD_TOGGLE_COUNT_FAST, TEST_MODESET_ON); + + igt_describe(test_hotplug_for_each_pipe_desc); + CONNECTOR_TEST("hdmi-hpd-for-each-pipe", HDMIA, test_hotplug_for_each_pipe); + + igt_describe(test_suspend_resume_hpd_desc); + CONNECTOR_TEST("hdmi-hpd-after-suspend", HDMIA, test_suspend_resume_hpd, + SUSPEND_STATE_MEM, SUSPEND_TEST_NONE); + + igt_describe(test_suspend_resume_hpd_desc); + CONNECTOR_TEST("hdmi-hpd-after-hibernate", HDMIA, test_suspend_resume_hpd, + SUSPEND_STATE_DISK, SUSPEND_TEST_DEVICES); + + igt_describe(test_hpd_storm_detect_desc); + CONNECTOR_TEST("hdmi-hpd-storm", HDMIA, test_hpd_storm_detect, + HPD_STORM_PULSE_INTERVAL_HDMI); + + igt_describe(test_hpd_storm_disable_desc); + CONNECTOR_TEST("hdmi-hpd-storm-disable", HDMIA, test_hpd_storm_disable, + HPD_STORM_PULSE_INTERVAL_HDMI); igt_describe("VGA tests"); - igt_subtest_group { - igt_fixture { - chamelium_require_connector_present( - data.ports, DRM_MODE_CONNECTOR_VGA, - data.port_count, 1); - } - igt_describe(test_basic_hotplug_desc); - connector_subtest("vga-hpd", VGA) test_hotplug( - &data, port, HPD_TOGGLE_COUNT_VGA, TEST_MODESET_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("vga-hpd-fast", VGA) test_hotplug( - &data, port, HPD_TOGGLE_COUNT_FAST, TEST_MODESET_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("vga-hpd-enable-disable-mode", VGA) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_FAST, - TEST_MODESET_ON_OFF); - - igt_describe(test_basic_hotplug_desc); - connector_subtest("vga-hpd-with-enabled-mode", VGA) - test_hotplug(&data, port, HPD_TOGGLE_COUNT_FAST, - TEST_MODESET_ON); - - igt_describe(test_suspend_resume_hpd_desc); - connector_subtest("vga-hpd-after-suspend", VGA) - test_suspend_resume_hpd(&data, port, SUSPEND_STATE_MEM, - SUSPEND_TEST_NONE); - - igt_describe(test_suspend_resume_hpd_desc); - connector_subtest("vga-hpd-after-hibernate", VGA) - test_suspend_resume_hpd(&data, port, SUSPEND_STATE_DISK, - SUSPEND_TEST_DEVICES); - - igt_describe(test_hpd_without_ddc_desc); - connector_subtest("vga-hpd-without-ddc", VGA) - test_hpd_without_ddc(&data, port); - } + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("vga-hpd", VGA, test_hotplug, HPD_TOGGLE_COUNT_VGA, TEST_MODESET_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("vga-hpd-fast", VGA, test_hotplug, HPD_TOGGLE_COUNT_FAST, TEST_MODESET_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("vga-hpd-enable-disable-mode", VGA, + test_hotplug, HPD_TOGGLE_COUNT_FAST, TEST_MODESET_ON_OFF); + + igt_describe(test_basic_hotplug_desc); + CONNECTOR_TEST("vga-hpd-with-enabled-mode", VGA, + test_hotplug, HPD_TOGGLE_COUNT_FAST, TEST_MODESET_ON); + + igt_describe(test_suspend_resume_hpd_desc); + CONNECTOR_TEST("vga-hpd-after-suspend", VGA, + test_suspend_resume_hpd, SUSPEND_STATE_MEM, SUSPEND_TEST_NONE); + + igt_describe(test_suspend_resume_hpd_desc); + CONNECTOR_TEST("vga-hpd-after-hibernate", VGA, + test_suspend_resume_hpd, SUSPEND_STATE_DISK, SUSPEND_TEST_DEVICES); + + igt_describe(test_hpd_without_ddc_desc); + CONNECTOR_TEST("vga-hpd-without-ddc", VGA, test_hpd_without_ddc); + + igt_describe(test_hotplug_for_each_pipe_desc); + CONNECTOR_TEST("vga-hpd-for-each-pipe", VGA, test_hotplug_for_each_pipe); igt_describe("Tests that operate on all connectors"); igt_subtest_group { @@ -623,7 +580,8 @@ igt_main igt_describe(test_suspend_resume_hpd_common_desc); igt_subtest("common-hpd-after-suspend") - test_suspend_resume_hpd_common(&data, SUSPEND_STATE_MEM, + test_suspend_resume_hpd_common(&data, + SUSPEND_STATE_MEM, SUSPEND_TEST_NONE); igt_describe(test_suspend_resume_hpd_common_desc); @@ -633,10 +591,6 @@ igt_main SUSPEND_TEST_DEVICES); } - igt_describe(test_hotplug_for_each_pipe_desc); - connector_subtest("vga-hpd-for-each-pipe", VGA) - test_hotplug_for_each_pipe(&data, port); - igt_fixture { igt_display_fini(&data.display); drm_close_driver(data.drm_fd); -- 2.48.1