From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: kunal1.joshi@intel.com, suraj.kandpal@intel.com,
Jeevan B <jeevan.b@intel.com>
Subject: [PATCH i-g-t 6/6] RFC: tests/intel/kms_link_training: Add edp-data-override subtest
Date: Mon, 24 Nov 2025 23:57:56 +0530 [thread overview]
Message-ID: <20251124182804.2095722-7-jeevan.b@intel.com> (raw)
In-Reply-To: <20251124182804.2095722-1-jeevan.b@intel.com>
Add test for eDP data override for 2.43 and 6.75 Gbps which has
some issues. eDP should overide to 2.7 and 8.1 Gbps when supported
by panel.
Signed-off-by: Jeevan B <jeevan.b@intel.com>
Link: https://lore.kernel.org/r/20250821042653.269227-3-suraj.kandpal@intel.com
---
tests/intel/kms_link_training.c | 185 ++++++++++++++++++++++++++++++++
1 file changed, 185 insertions(+)
diff --git a/tests/intel/kms_link_training.c b/tests/intel/kms_link_training.c
index 4ddbd72f8..22c4c9fd3 100644
--- a/tests/intel/kms_link_training.c
+++ b/tests/intel/kms_link_training.c
@@ -19,6 +19,9 @@
*
* SUBTEST: non-uhbr-mst
* Description: Test we can drive non-UHBR rates over MST.
+ *
+ * SUBTEST: edp-data-override
+ * Description: Test eDP data override rates.
*/
#include "igt.h"
@@ -293,6 +296,180 @@ static bool test_link_rate(data_t *data, bool mst, bool uhbr)
return ran_any_output;
}
+static bool test_link_override(data_t *data, int target_rate, const char *rate_name,
+ bool expect_success, int timeout_sec)
+{
+ char rate_str[32];
+ char lane_str[32];
+ int current_rate;
+ bool training_completed;
+
+ igt_info("Testing %s (%d kHz) - expect %s...\n",
+ rate_name, target_rate, expect_success ? "SUCCESS" : "BLOCK/FAIL");
+
+ igt_display_reset(&data->display);
+ igt_reset_link_params(data->drm_fd, data->output);
+ do_modeset(data, false);
+
+ snprintf(rate_str, sizeof(rate_str), "%d", target_rate);
+ snprintf(lane_str, sizeof(lane_str), "4");
+ igt_set_link_params(data->drm_fd, data->output, rate_str, lane_str);
+ igt_force_link_retrain(data->drm_fd, data->output, RETRAIN_COUNT);
+
+ training_completed = (check_condition_with_timeout(data->drm_fd, data->output,
+ igt_get_dp_pending_retrain,
+ 1.0, timeout_sec) == 0);
+
+ if (training_completed) {
+ current_rate = igt_get_current_link_rate(data->drm_fd, data->output);
+ assert_link_status_good(data, false);
+
+ if (expect_success) {
+ if (current_rate == target_rate) {
+ igt_info("%s succeeded at %d kHz\n", rate_name, current_rate);
+ return true;
+ } else {
+ igt_info("%s failed: requested %d kHz, got %d kHz\n",
+ rate_name, target_rate, current_rate);
+ return false;
+ }
+ } else {
+ if (current_rate != target_rate) {
+ igt_info("%s blocked: requested %d kHz, fell back to %d kHz\n",
+ rate_name, target_rate, current_rate);
+ return true;
+ } else {
+ igt_info("%s was NOT blocked: got requested %d kHz\n",
+ rate_name, current_rate);
+ return false;
+ }
+ }
+ } else {
+ if (expect_success) {
+ igt_info("%s failed with timeout\n", rate_name);
+ return false;
+ } else {
+ igt_info("%s completely rejected (timeout)\n", rate_name);
+ return true;
+ }
+ }
+}
+
+static void analyze_supported_rates(int *rates, int num_rates,
+ bool *found_243, bool *found_675,
+ bool *found_270, bool *found_810)
+{
+ int i;
+
+ *found_243 = false;
+ *found_675 = false;
+ *found_270 = false;
+ *found_810 = false;
+
+ for (i = 0; i < num_rates; i++) {
+ igt_info(" %d kHz (%.2f Gbps)",
+ rates[i], rates[i] / 100000.0);
+
+ switch (rates[i]) {
+ case 243000:
+ *found_243 = true;
+ igt_info("Unsupported!");
+ break;
+ case 675000:
+ *found_675 = true;
+ igt_info("Unsupported!");
+ break;
+ case 270000:
+ *found_270 = true;
+ igt_info("Supported");
+ break;
+ case 810000:
+ *found_810 = true;
+ igt_info("Supported");
+ break;
+ }
+ igt_info("\n");
+ }
+}
+
+static bool test_edp_data_override(data_t *data)
+{
+ igt_output_t *edp_output = NULL;
+ int supported_rates[16];
+ int num_rates = 0;
+ bool found_243, found_675, found_270, found_810;
+ bool test_results[4] = {false};
+ bool data_override_works, safe_rates_available;
+ bool all_tests_passed;
+
+ igt_skip_on_f(!is_intel_device(data->drm_fd),
+ "Test supported only on Intel platforms.\n");
+
+ for_each_connected_output(&data->display, edp_output) {
+ if (igt_output_is_dp_family(edp_output) &&
+ strstr(edp_output->name, "eDP")) {
+ data->output = edp_output;
+ break;
+ }
+ }
+
+ igt_require_f(data->output != NULL, "No eDP output found\n");
+ igt_info("Testing eDP data override on: %s\n", data->output->name);
+
+ num_rates = igt_get_supported_link_rates(data->drm_fd, data->output->name,
+ supported_rates, 16);
+ igt_assert_f(num_rates >= 2 && num_rates <= 10,
+ "Unexpected number of rates (%d), data override might be broken\n", num_rates);
+
+ analyze_supported_rates(supported_rates, num_rates,
+ &found_243, &found_675, &found_270, &found_810);
+
+ igt_info("PHASE 1: Testing Unsupported rates (expect override/blocking)\n");
+
+ if (found_243)
+ test_results[0] = test_link_override(data, 243000, "2.43 Gbps Override rate",
+ false, 10);
+
+ if (found_675)
+ test_results[1] = test_link_override(data, 675000, "6.75 Gbps Override rate",
+ false, 10);
+
+ igt_info("PHASE 2: Testing Supported rates\n");
+
+ if (found_270) {
+ test_results[2] = test_link_override(data, 270000, "2.7 Gbps data rate",
+ true, 10);
+ } else {
+ igt_info("Skipping 2.7 Gbps test - not available\n");
+ test_results[2] = true;
+ }
+
+ if (found_810) {
+ test_results[3] = test_link_override(data, 810000, "8.1 Gbps data rate",
+ true, 10);
+ } else {
+ igt_info("Skipping 8.1 Gbps test - not available\n");
+ test_results[3] = true;
+ }
+
+ igt_reset_link_params(data->drm_fd, data->output);
+
+ data_override_works = (!found_243 && !found_675);
+ safe_rates_available = (found_270 || found_810);
+ all_tests_passed = (test_results[0] && test_results[1] &&
+ test_results[2] && test_results[3]);
+
+ igt_info("====================================================\n");
+ igt_info("eDP data override working: %s\n", data_override_works ? "YES" : "NO");
+ igt_info("Safe override rates available: %s\n", safe_rates_available ? "YES" : "NO");
+ igt_info("All rate tests passed: %s\n", all_tests_passed ? "YES" : "NO");
+ igt_info("Overall test result: %s\n",
+ (data_override_works && safe_rates_available && all_tests_passed) ?
+ "SUCCESS" : "FAIL");
+
+ return (data_override_works && safe_rates_available && all_tests_passed);
+}
+
IGT_TEST_DESCRIPTION("Test to validate link training on SST/MST with "
"UHBR/NON_UHBR rates");
@@ -342,6 +519,14 @@ igt_main
"Didn't find any MST output with NON-UHBR rates.\n");
}
+ igt_describe("Test eDP data override correctly");
+ igt_subtest("edp-data-override") {
+ igt_require_f(intel_display_ver(data.devid) > 35,
+ "eDP override not supported on platform\n");
+ igt_require_f(test_edp_data_override(&data),
+ "eDP data override test failed\n");
+ }
+
igt_fixture {
igt_reset_connectors();
igt_display_fini(&data.display);
--
2.43.0
prev parent reply other threads:[~2025-11-24 18:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 18:27 [PATCH i-g-t 0/6] RFC: Add new test for eDP data override Jeevan B
2025-11-24 18:27 ` [PATCH i-g-t 1/6] tests/intel/kms_dp_link_training: rename to tests/intel/kms_link_training Jeevan B
2025-11-24 18:27 ` [PATCH i-g-t 2/6] tests/intel/kms_dp_linktrain_fallback: rename to tests/intel/kms_linktrain_fallback Jeevan B
2025-11-24 18:27 ` [PATCH i-g-t 3/6] lib/igt_kms: add helpers for connector type Jeevan B
2025-11-24 18:27 ` [PATCH i-g-t 4/6] tests/intel/kms_link_training: extend test for eDP connector Jeevan B
2025-11-24 18:27 ` [PATCH i-g-t 5/6] lib/igt_kms: Add helper to get eDP/DP supported link rates Jeevan B
2025-11-24 18:27 ` Jeevan B [this message]
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=20251124182804.2095722-7-jeevan.b@intel.com \
--to=jeevan.b@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kunal1.joshi@intel.com \
--cc=suraj.kandpal@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.