Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jason-JH Lin <jason-jh.lin@mediatek.com>
To: <igt-dev@lists.freedesktop.org>,
	Karthik B S <karthik.b.s@intel.com>,
	Swati Sharma <swati2.sharma@intel.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Ville Syrjala <ville.syrjala@linux.intel.com>,
	Fei Shao <fshao@chromium.org>
Cc: Jani <jani.nikula@intel.com>,
	Jason-JH Lin <jason-jh.lin@mediatek.com>,
	Paul-PL Chen <paul-pl.chen@mediatek.com>,
	Lancelot Wu <Lancelot.Wu@mediatek.com>,
	Manasi Navare <navaremanasi@google.com>,
	Gil Dekel <gildekel@google.com>, Yacoub <markyacoub@chromium.org>,
	<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: [PATCH i-g-t v3 2/2] tests/kms_setmode: Add basic-no-cpu-idle subtest
Date: Fri, 10 Jul 2026 17:52:48 +0800	[thread overview]
Message-ID: <20260710095358.2518446-3-jason-jh.lin@mediatek.com> (raw)
In-Reply-To: <20260710095358.2518446-1-jason-jh.lin@mediatek.com>

Add a new subtest that disables CPU deep sleep to eliminate wakeup
latency interference during vblank timestamp verification.

This allows platforms without get_scanout_position() to verify their
timestamp accuracy is correct, separate from CPU idle interference.

The original "basic" test remains unchanged to detect any timestamp
issues including CPU idle interference, while "basic-no-cpu-idle"
specifically tests timestamp accuracy without external interference.

Once get_scanout_position() is implemented, the vblank timestamp
will be accurately compensated regardless of CPU idle states.

Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
---
 tests/kms_setmode.c | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index ef0082dbf70b..a65ea8b232fc 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -42,6 +42,7 @@
 #include <math.h>
 
 #include "i915/intel_drrs.h"
+#include "igt_pm.h"
 #include "xe/xe_query.h"
 
 /**
@@ -49,6 +50,13 @@
  * Description: Tests the vblank timing by iterating through all valid crtc/connector
  *              combinations
  *
+ * SUBTEST: basic-no-cpu-idle
+ * Description: Tests vblank timing with CPU deep sleep disabled to verify
+ *              timestamp accuracy without CPU idle interference. This test
+ *              is for platforms lacking HW/SW get_scanout_position() support,
+ *              allowing them to verify vblank timestamp correctness without
+ *              external CPU wakeup latency interference.
+ *
  * SUBTEST: basic-clone-single-crtc
  * Description: Test allows the use of a single CRTC for two connectors, such as VGA/HDMI,
  *		VGA/DP, and HDMI/HDMI
@@ -1034,6 +1042,11 @@ static void run_test(const struct test_config *tconf)
 		test_combinations(tconf, connector_num);
 }
 
+static void restore_cpu_deep_sleep_at_exit(int sig)
+{
+	igt_pm_enable_cpu_deep_sleep();
+}
+
 static int opt_handler(int opt, int opt_index, void *data)
 {
 	switch (opt) {
@@ -1105,6 +1118,30 @@ int igt_main_args("det:", NULL, help_str, opt_handler, NULL)
 		}
 	}
 
+	/*
+	 * This subtest disables CPU deep sleep to eliminate wakeup latency
+	 * interference during vblank timestamp verification.
+	 *
+	 * NOTE: This is for platforms that have not yet implemented
+	 * get_scanout_position(). Once get_scanout_position() is properly
+	 * implemented, the vblank timestamp will be accurately compensated
+	 * regardless of CPU idle states, and this test becomes redundant
+	 * with the standard "basic" test.
+	 */
+	igt_describe("Tests vblank timing with CPU deep sleep disabled");
+	igt_subtest_with_dynamic("basic-no-cpu-idle") {
+		struct test_config tconf = {
+			.flags		= TEST_TIMINGS,
+			.name		= "basic-no-cpu-idle",
+			.resources	= drm_resources,
+		};
+
+		igt_require_f(igt_pm_disable_cpu_deep_sleep(),
+			      "Platform does not support CPU idle control\n");
+		igt_install_exit_handler(restore_cpu_deep_sleep_at_exit);
+		run_test(&tconf);
+	}
+
 	igt_fixture() {
 		drmModeFreeResources(drm_resources);
 		drm_close_driver(drm_fd);
-- 
2.43.0


  parent reply	other threads:[~2026-07-10  9:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10  9:52 [PATCH i-g-t v3 0/2] Add CPU idle state control for accurate vblank timing Jason-JH Lin
2026-07-10  9:52 ` [PATCH i-g-t v3 1/2] lib/igt_pm: Add CPU idle state control for vblank timing stability Jason-JH Lin
2026-07-13 12:08   ` Kamil Konieczny
2026-07-14  7:53     ` Jason-JH Lin (林睿祥)
2026-07-14 16:37       ` Kamil Konieczny
2026-07-15  2:50         ` Jason-JH Lin (林睿祥)
2026-07-10  9:52 ` Jason-JH Lin [this message]
2026-07-13 12:11   ` [PATCH i-g-t v3 2/2] tests/kms_setmode: Add basic-no-cpu-idle subtest Kamil Konieczny
2026-07-14  7:55     ` Jason-JH Lin (林睿祥)
2026-07-10 10:37 ` ✓ Xe.CI.BAT: success for Add CPU idle state control for accurate vblank timing Patchwork
2026-07-10 10:49 ` ✓ i915.CI.BAT: " Patchwork
2026-07-10 18:55 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-07-11 13:42 ` ✗ i915.CI.Full: " 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=20260710095358.2518446-3-jason-jh.lin@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Lancelot.Wu@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=fshao@chromium.org \
    --cc=gildekel@google.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=markyacoub@chromium.org \
    --cc=navaremanasi@google.com \
    --cc=paul-pl.chen@mediatek.com \
    --cc=swati2.sharma@intel.com \
    --cc=ville.syrjala@linux.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