All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_plane_lowres: Use lowest mode for testing
Date: Wed, 26 May 2021 13:18:44 +0300	[thread overview]
Message-ID: <20210526101844.1033711-1-mika.kahola@intel.com> (raw)

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

             reply	other threads:[~2021-05-26 10:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 10:18 Mika Kahola [this message]
2021-05-26 11:21 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_plane_lowres: Use lowest mode for testing 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

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=20210526101844.1033711-1-mika.kahola@intel.com \
    --to=mika.kahola@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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.