public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 3/4] tests/kms_invalid_mode: Test various bogus timings
Date: Fri, 15 Nov 2019 15:15:19 +0200	[thread overview]
Message-ID: <20191115131520.9872-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20191115131520.9872-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make sure the mode gets rejected when some part of the timings
is bogus.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_invalid_mode.c | 73 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 72 insertions(+), 1 deletion(-)

diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
index 323f965dde77..9b94b9face4a 100644
--- a/tests/kms_invalid_mode.c
+++ b/tests/kms_invalid_mode.c
@@ -68,6 +68,55 @@ adjust_mode_clock_too_high(data_t *data, drmModeModeInfoPtr mode)
 	return true;
 }
 
+static bool
+adjust_mode_bad_clock(data_t *data, drmModeModeInfoPtr mode)
+{
+	mode->clock = 0;
+	return true;
+}
+
+static bool
+adjust_mode_bad_hdisplay(data_t *data, drmModeModeInfoPtr mode)
+{
+	mode->hdisplay = 0;
+	return true;
+}
+
+static bool
+adjust_mode_bad_vdisplay(data_t *data, drmModeModeInfoPtr mode)
+{
+	mode->hdisplay = 0;
+	return true;
+}
+
+static bool
+adjust_mode_bad_hsync(data_t *data, drmModeModeInfoPtr mode)
+{
+	mode->hsync_start = mode->hsync_end + 1;
+	return true;
+}
+
+static bool
+adjust_mode_bad_vsync(data_t *data, drmModeModeInfoPtr mode)
+{
+	mode->vsync_start = mode->vsync_end + 1;
+	return true;
+}
+
+static bool
+adjust_mode_bad_htotal(data_t *data, drmModeModeInfoPtr mode)
+{
+	mode->htotal = mode->hsync_end - 1;
+	return true;
+}
+
+static bool
+adjust_mode_bad_vtotal(data_t *data, drmModeModeInfoPtr mode)
+{
+	mode->vtotal = mode->vsync_end - 1;
+	return true;
+}
+
 static int
 test_output(data_t *data)
 {
@@ -85,7 +134,8 @@ test_output(data_t *data)
 		return 0;
 
 	igt_create_fb(data->drm_fd,
-		      mode.hdisplay, mode.vdisplay,
+		      max(mode.hdisplay, 64),
+		      max(mode.vdisplay, 64),
 		      DRM_FORMAT_XRGB8888,
 		      LOCAL_DRM_FORMAT_MOD_NONE,
 		      &fb);
@@ -143,6 +193,27 @@ static const struct {
 	{ .name = "clock-too-high",
 	  .adjust_mode = adjust_mode_clock_too_high,
 	},
+	{ .name = "bad-clock",
+	  .adjust_mode = adjust_mode_bad_clock,
+	},
+	{ .name = "bad-hdisplay",
+	  .adjust_mode = adjust_mode_bad_hdisplay,
+	},
+	{ .name = "bad-vdisplay",
+	  .adjust_mode = adjust_mode_bad_vdisplay,
+	},
+	{ .name = "bad-hsync",
+	  .adjust_mode = adjust_mode_bad_hsync,
+	},
+	{ .name = "bad-vsync",
+	  .adjust_mode = adjust_mode_bad_vsync,
+	},
+	{ .name = "bad-htotal",
+	  .adjust_mode = adjust_mode_bad_htotal,
+	},
+	{ .name = "bad-vtotal",
+	  .adjust_mode = adjust_mode_bad_vtotal,
+	},
 };
 
 static data_t data;
-- 
2.23.0

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

  parent reply	other threads:[~2019-11-15 13:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 13:15 [igt-dev] [PATCH i-g-t 1/4] tests/kms_invalid_dotclock: Rename to kms_invalid_mode Ville Syrjala
2019-11-15 13:15 ` [igt-dev] [PATCH i-g-t 2/4] tests/kms_invalid_mode: Convert the max dotclock test into a subtest Ville Syrjala
2019-11-15 13:15 ` Ville Syrjala [this message]
2019-11-15 13:15 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_invalid_mode: Allow the test on !i915 Ville Syrjala
2019-11-15 13:41 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [i-g-t,1/4] tests/kms_invalid_dotclock: Rename to kms_invalid_mode Patchwork
2019-11-15 13:52 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-11-16 21:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20191115131520.9872-3-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox