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] tests/kms_force_connector_basic: re-baseline connector state before comparing
Date: Mon, 13 Jul 2026 13:32:28 +0530 [thread overview]
Message-ID: <20260713080227.3989038-1-suraj.kandpal@intel.com> (raw)
force_connector_state and force_edid compare against a snapshot of
the connector taken once in igt_fixture(). When a later probe
enumerates a different connection state or mode set than that
snapshot (e.g. a DP-to-HDMI adaptor still initializing, or HPD
disturbed by display power transitions), the subtests fail even
though the force paths under test work correctly.
Re-sample the connector inside each subtest after its own setup
has settled, and compare against that baseline.
Assisted-by: GitHub Copilot:Claude Opus 4.7
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
tests/kms_force_connector_basic.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/tests/kms_force_connector_basic.c b/tests/kms_force_connector_basic.c
index 4ea6b0e8c..5bb3b870c 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,9 @@ static void force_connector_state(int drm_fd, drmModeConnectorPtr connector)
igt_display_reset(&display);
igt_display_commit(&display);
+ 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,15 +210,16 @@ 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);
}
static void force_edid(int drm_fd, drmModeConnectorPtr connector)
{
- drmModeConnector *temp;
+ drmModeConnector *baseline, *temp;
kmstest_force_connector(drm_fd, connector,
FORCE_CONNECTOR_ON);
@@ -223,6 +227,9 @@ static void force_edid(int drm_fd, drmModeConnectorPtr connector)
connector->connector_id);
drmModeFreeConnector(temp);
+ baseline = drmModeGetConnector(drm_fd, connector->connector_id);
+ igt_assert(baseline);
+
/* Test edid forcing. */
kmstest_force_edid(drm_fd, connector,
igt_kms_get_base_edid());
@@ -249,9 +256,10 @@ static void force_edid(int drm_fd, drmModeConnectorPtr connector)
* The connector should now have the same number of modes that
* it started with.
*/
- igt_assert_eq(temp->count_modes, connector->count_modes);
+ igt_assert_eq(temp->count_modes, baseline->count_modes);
drmModeFreeConnector(temp);
+ drmModeFreeConnector(baseline);
}
static void prune_stale_modes(int drm_fd, drmModeConnectorPtr connector)
--
2.34.1
next reply other threads:[~2026-07-13 8:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 8:02 Suraj Kandpal [this message]
2026-07-13 8:49 ` ✗ Xe.CI.BAT: failure for tests/kms_force_connector_basic: re-baseline connector state before comparing Patchwork
2026-07-13 9:02 ` ✗ i915.CI.BAT: " Patchwork
2026-07-13 9:58 ` [PATCH i-g-t v2] tests/kms_force_connector_basic: re-baseline connection " Suraj Kandpal
2026-07-14 3:57 ` 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=20260713080227.3989038-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