public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: Limit cursor size based platform capability.
Date: Tue, 30 Apr 2019 15:07:12 +0530	[thread overview]
Message-ID: <1556617032-2515-2-git-send-email-karthik.b.s@intel.com> (raw)
In-Reply-To: <1556617032-2515-1-git-send-email-karthik.b.s@intel.com>

Limiting the cursor size of subtests to the maximum size listed as per
the platform capability, so that we can avoid skipping of subtests.

Also moving the platform capability fetch outside igt_fixture,
so that all the valid subtests are listed during --list-subtests.

Signed-off-by: Karthik B S <karthik.b.s@intel.com>
---
 tests/kms_cursor_crc.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index fd74fda..6fb33a1 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -642,7 +642,8 @@ static void test_rapid_movement(data_t *data)
 static void run_test_generic(data_t *data)
 {
 	int cursor_size;
-	for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
+	for (cursor_size = 64; cursor_size <= data->cursor_max_w;
+	     cursor_size *= 2) {
 		int w = cursor_size;
 		int h = cursor_size;
 
@@ -719,18 +720,19 @@ igt_main
 
 	igt_skip_on_simulation();
 
-	igt_fixture {
-		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+	data.drm_fd = drm_open_driver_master(DRIVER_ANY);
+
+	ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
+	igt_assert(ret == 0 || errno == EINVAL);
 
-		ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
-		igt_assert(ret == 0 || errno == EINVAL);
-		/* Not making use of cursor_height since it is same as width, still reading */
-		ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_HEIGHT, &cursor_height);
-		igt_assert(ret == 0 || errno == EINVAL);
+	/* Not making use of cursor_height since it is same as width, still reading */
+	ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_HEIGHT, &cursor_height);
+	igt_assert(ret == 0 || errno == EINVAL);
 
-		/* We assume width and height are same so max is assigned width */
-		igt_assert_eq(cursor_width, cursor_height);
+	/* We assume width and height are same so max is assigned width */
+	igt_assert_eq(cursor_width, cursor_height);
 
+	igt_fixture {
 		kmstest_set_vt_graphics_mode();
 
 		igt_require_pipe_crc(data.drm_fd);
-- 
2.7.4

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

  reply	other threads:[~2019-04-30  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  9:37 [igt-dev] [PATCH i-g-t] tests/kms_cursor_crc: Limit cursor size based platform capability Karthik B S
2019-04-30  9:37 ` Karthik B S [this message]
2019-04-30 11:03   ` Petri Latvala
2019-04-30 10:17 ` [igt-dev] ✗ Fi.CI.BAT: failure for " 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=1556617032-2515-2-git-send-email-karthik.b.s@intel.com \
    --to=karthik.b.s@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