summaryrefslogtreecommitdiff
path: root/tests/kms_setmode.c
diff options
context:
space:
mode:
authorBhanuprakash Modem <bhanuprakash.modem@intel.com>2022-03-18 16:34:55 +0530
committerBhanuprakash Modem <bhanuprakash.modem@intel.com>2022-03-24 14:55:38 +0530
commita578a32e00c30bcaacbd772a68e76ea2eed9e120 (patch)
tree6e7a5fcca562f45f307f93cca7d55ae641dcc853 /tests/kms_setmode.c
parent974c11553e9e0f0931b597a6f64044bd7afe5168 (diff)
tests/kms_setmode: Add support to handle displays having 5k+ modes
As single crtc can handle max of 5k resolution, and we need one more crtc to handle > 5k modes. This patch will skip the scenarios where those crtc/mode combinations won't fit. Example: Consider two 8K panels connected via DP-1 & DP-2 resp, and we have four pipes (A-D) got enabled. So, below are the combos for basic subtest. pipe-A-DP-1 pipe-B-DP-1 pipe-C-DP-1 pipe-D-DP-1 is not possible pipe-A-DP-2 pipe-B-DP-2 pipe-C-DP-2 pipe-D-DP-2 is not possible pipe-A-DP-1-pipe-B-DP-2 is not possible pipe-A-DP-1-pipe-C-DP-2 pipe-A-DP-1-pipe-D-DP-2 is not possible pipe-B-DP-1-pipe-A-DP-2 is not possible pipe-B-DP-1-pipe-C-DP-2 is not possible pipe-B-DP-1-pipe-D-DP-2 is not possible pipe-C-DP-1-pipe-A-DP-2 pipe-C-DP-1-pipe-B-DP-2 is not possible pipe-C-DP-1-pipe-D-DP-2 is not possible pipe-D-DP-1-pipe-A-DP-2 is not possible pipe-D-DP-1-pipe-B-DP-2 is not possible pipe-D-DP-1-pipe-C-DP-2 is not possible Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Cc: Imre Deak <imre.deak@intel.com> Cc: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Karthik B S <karthik.b.s@intel.com>
Diffstat (limited to 'tests/kms_setmode.c')
-rw-r--r--tests/kms_setmode.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index d5cb45d4..4ea1986a 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -37,6 +37,8 @@
/* max combinations with repetitions */
#define MAX_COMBINATION_ELEMS MAX_CRTCS
+#define MAX_HDISPLAY_PER_CRTC 5120
+
static int drm_fd;
static drmModeRes *drm_resources;
static int filter_test_id;
@@ -663,10 +665,27 @@ static void test_one_combination(const struct test_config *tconf,
pos += get_test_name_str(&crtcs[i], &test_name[pos], ARRAY_SIZE(test_name) - pos);
}
+ for (i = 0; i < crtc_count; i++) {
+ struct crtc_config *crtc = &crtcs[i];
+
+ /*
+ * if mode.hdisplay > 5120, then ignore
+ * - last crtc in single/multi-connector config
+ * - consecutive crtcs in multi-connector config
+ */
+ if ((crtc->mode.hdisplay > MAX_HDISPLAY_PER_CRTC) &&
+ ((crtc->crtc_idx >= (tconf->resources->count_crtcs - 1)) ||
+ (i < (crtc_count - 1) && abs(crtcs[i + 1].crtc_idx - crtc->crtc_idx) <= 1))) {
+ igt_info("Combo: %s is not possible with selected mode(s).\n", test_name);
+ goto out;
+ }
+ }
+
igt_dynamic_f("%s", test_name)
test_crtc_config(tconf, crtcs, crtc_count);
}
+out:
cleanup_crtcs(crtcs, crtc_count);
}