Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Suraj Kandpal <suraj.kandpal@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, sowmiya.s@intel.com,
	swati2.sharma@intel.com, Suraj Kandpal <suraj.kandpal@intel.com>
Subject: [PATCH i-g-t v2] tests/kms_force_connector_basic: re-baseline connection state before comparing
Date: Mon, 13 Jul 2026 15:28:19 +0530	[thread overview]
Message-ID: <20260713095819.4020111-1-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20260713080227.3989038-1-suraj.kandpal@intel.com>

force_connector_state compares the end-of-subtest connection state
against a snapshot taken once in igt_fixture(). That snapshot can be
stale (e.g. adaptor still initializing, HPD disturbed by earlier
power transitions) or reflect a leftover force flag from a previous
subtest or from igt_handle_spurious_hpd(), causing spurious failures.

Take a fresh baseline inside the subtest, after clearing any
leftover force with FORCE_CONNECTOR_UNSPECIFIED, and compare against
that.

Assisted-by: GitHub Copilot:Claude Opus 4.7
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 tests/kms_force_connector_basic.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index 4ea6b0e8c..c4252ea02 100644
--- a/tests/kms_force_connector_basic.c
+++ b/tests/kms_force_connector_basic.c
@@ -177,7 +177,7 @@ static void force_load_detect(int drm_fd, drmModeConnectorPtr connector, drmMode
 static void force_connector_state(int drm_fd, drmModeConnectorPtr connector)
 {
 	igt_display_t display;
-	drmModeConnector *temp;
+	drmModeConnector *baseline, *temp;
 
 	igt_display_require(&display, drm_fd);
 
@@ -185,6 +185,10 @@ static void force_connector_state(int drm_fd, drmModeConnectorPtr connector)
 	igt_display_reset(&display);
 	igt_display_commit(&display);
 
+	kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_UNSPECIFIED);
+	baseline = drmModeGetConnector(drm_fd, connector->connector_id);
+	igt_assert(baseline);
+
 	/* Force the connector on and check the reported values. */
 	kmstest_force_connector(drm_fd, connector, FORCE_CONNECTOR_ON);
 	temp = drmModeGetConnectorCurrent(drm_fd,
@@ -207,9 +211,10 @@ static void force_connector_state(int drm_fd, drmModeConnectorPtr connector)
 				FORCE_CONNECTOR_UNSPECIFIED);
 	temp = drmModeGetConnectorCurrent(drm_fd,
 					  connector->connector_id);
-	igt_assert_eq(temp->connection, connector->connection);
+	igt_assert_eq(temp->connection, baseline->connection);
 	drmModeFreeConnector(temp);
 
+	drmModeFreeConnector(baseline);
 	igt_display_fini(&display);
 }
 
-- 
2.34.1


  parent reply	other threads:[~2026-07-13  9:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  8:02 [PATCH i-g-t] tests/kms_force_connector_basic: re-baseline connector state before comparing Suraj Kandpal
2026-07-13  8:49 ` ✗ Xe.CI.BAT: failure for " Patchwork
2026-07-13  9:02 ` ✗ i915.CI.BAT: " Patchwork
2026-07-13  9:58 ` Suraj Kandpal [this message]
2026-07-14  3:57   ` [PATCH i-g-t v2] tests/kms_force_connector_basic: re-baseline connection " S, Sowmiya
2026-07-13 10:31 ` ✗ Xe.CI.FULL: failure for tests/kms_force_connector_basic: re-baseline connector " Patchwork
2026-07-13 12:39 ` ✓ Xe.CI.BAT: success for tests/kms_force_connector_basic: re-baseline connector state before comparing (rev2) Patchwork
2026-07-13 12:52 ` ✓ i915.CI.BAT: " Patchwork
2026-07-13 15:28 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-13 17:51 ` ✗ i915.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260713095819.4020111-1-suraj.kandpal@intel.com \
    --to=suraj.kandpal@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=sowmiya.s@intel.com \
    --cc=swati2.sharma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox