public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/kms_invalid_mode: Allow clock-too-high test on non-Intel platforms
@ 2026-04-14 10:10 Jason-JH Lin
  2026-04-14 10:44 ` Jani Nikula
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jason-JH Lin @ 2026-04-14 10:10 UTC (permalink / raw)
  To: igt-dev, Karthik B S, Swati Sharma, Kamil Konieczny,
	Juha-Pekka Heikkila, Bhanuprakash Modem, Fei Shao
  Cc: Jani, Jason-JH Lin, Paul-PL Chen, Nancy Lin, Singo Chang,
	Gil Dekel, Yacoub, Project_Global_Chrome_Upstream_Group

The clock-too-high subtest was being skipped on non-Intel platforms
because igt_get_max_dotclock() returns 0 when reading from
Intel-specific debugfs fails.

This change allows the test to run on all platforms by:
- Using a clearly invalid clock value (10 GHz) when max_dotclock is
  unavailable, which any reasonable driver should reject
- Restricting bigjoiner/ultrajoiner logic to Intel devices only

This prevents the test from being marked as IGNORED/SKIP on non-Intel
platforms while maintaining the original test intent of verifying that
drivers properly reject modes with excessively high clock rates.

Tested on MTK platforms where the test now properly executes and
verifies invalid clock validation.

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

diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
index 5edffb649ef4..18d79e59c736 100644
--- a/tests/kms_invalid_mode.c
+++ b/tests/kms_invalid_mode.c
@@ -126,7 +126,13 @@ adjust_mode_clock_too_high(data_t *data, drmModeModeInfoPtr mode)
 {
 	int max_dotclock = data->max_dotclock;
 
-	igt_require(max_dotclock != 0);
+	/*
+	 * If max_dotclock is unavailable (e.g., non-Intel platforms),
+	 * use an obviously invalid value that any driver should reject.
+	 * 10 GHz is well beyond any reasonable hardware capability.
+	 */
+	if (max_dotclock == 0)
+		max_dotclock = 10000000;  /* 10 GHz in kHz */
 
 	/*
 	 * FIXME When we have a fixed mode, the kernel will ignore
@@ -139,21 +145,23 @@ adjust_mode_clock_too_high(data_t *data, drmModeModeInfoPtr mode)
 	if (has_scaling_mode_prop(data))
 		return false;
 
-	/*
-	 * Newer platforms can support modes higher than the maximum dot clock
-	 * by using pipe joiner, so set the mode clock twice that of maximum
-	 * dot clock;
-	 */
-	if (can_bigjoiner(data)) {
-		igt_info("Platform supports bigjoiner with %s\n",
-			 data->output->name);
-		max_dotclock *= 2;
-	}
+	if (is_intel_device(data->drm_fd)) {
+		/*
+		 * Newer platforms can support modes higher than the maximum dot clock
+		 * by using pipe joiner, so set the mode clock twice that of maximum
+		 * dot clock;
+		 */
+		if (can_bigjoiner(data)) {
+			igt_info("Platform supports bigjoiner with %s\n",
+				 data->output->name);
+			max_dotclock *= 2;
+		}
 
-	if (can_ultrajoiner(data)) {
-		igt_info("Platform supports ultrajoiner with %s\n",
-			 data->output->name);
-		max_dotclock *= 4;
+		if (can_ultrajoiner(data)) {
+			igt_info("Platform supports ultrajoiner with %s\n",
+				 data->output->name);
+			max_dotclock *= 4;
+		}
 	}
 
 	mode->clock = max_dotclock + 1;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-04-15  1:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14 10:10 [PATCH i-g-t] tests/kms_invalid_mode: Allow clock-too-high test on non-Intel platforms Jason-JH Lin
2026-04-14 10:44 ` Jani Nikula
2026-04-15  1:26   ` Jason-JH Lin (林睿祥)
2026-04-14 13:11 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-04-14 13:34 ` ✓ i915.CI.BAT: " Patchwork
2026-04-14 14:23 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-14 20:58 ` ✓ i915.CI.Full: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox