All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_plane_lowres: Use lowest mode for testing
@ 2021-05-26 10:18 Mika Kahola
  2021-05-26 11:21 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mika Kahola @ 2021-05-26 10:18 UTC (permalink / raw)
  To: igt-dev

Search and use the lowest possible mode, when switching resolutions
from the default to the lowest mode and back.

While at it, reset display after each subtest run.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 tests/kms_plane_lowres.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index 43cc4250d..b876162b3 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -59,26 +59,21 @@ get_lowres_mode(int drmfd, igt_output_t *output,
 		const drmModeModeInfo *mode_default)
 {
 	const drmModeModeInfo *mode;
-	bool found = false;
-	int limit = mode_default->vdisplay - SIZE;
+	const drmModeModeInfo *min;
 	int j;
 
+        /* search for lowest mode */
+        min = mode_default;
 	for (j = 0; j < output->config.connector->count_modes; j++) {
 		mode = &output->config.connector->modes[j];
-		if (mode->vdisplay < limit) {
-			found = true;
-			break;
-		}
+		if (mode->vdisplay < min->vdisplay)
+			min = mode;
 	}
 
-	if (!found) {
-		igt_require_f(mode_default->vdisplay - SIZE > 768,
-			      "Current mode not tall enough; plane would still be onscreen after switch to 10x7.\n");
+	igt_require_f(mode_default->vdisplay - min->vdisplay > 2 * SIZE,
+		      "Current mode not tall enough; plane would still be onscreen after switching to lowest mode.\n");
 
-		return *igt_std_1024_mode_get();
-	}
-
-	return *mode;
+	return *min;
 }
 
 static igt_plane_t *first_sdr_plane(igt_output_t *output, uint32_t devid)
@@ -250,6 +245,8 @@ test_planes_on_pipe_with_output(data_t *data, igt_plane_t *plane, uint64_t modif
 	igt_remove_fb(data->drm_fd, &data->ref_hires.fb);
 	igt_remove_fb(data->drm_fd, &data->ref_lowres.fb);
 
+	igt_display_reset(&data->display);
+
 	return tested;
 }
 
-- 
2.27.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2021-05-27 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 10:18 [igt-dev] [PATCH i-g-t] tests/kms_plane_lowres: Use lowest mode for testing Mika Kahola
2021-05-26 11:21 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-05-26 16:18 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-05-27  6:02   ` Kahola, Mika
2021-05-27 12:20 ` [igt-dev] [PATCH i-g-t] " Juha-Pekka Heikkila

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.