All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel.vetter@ffwll.ch, chris@chris-wilson.co.uk,
	petri.latvala@intel.com
Cc: igt-dev@lists.freedesktop.org, Thomas Zimmermann <tzimmermann@suse.de>
Subject: [igt-dev] [PATCH v3 1/8] tests/fbdev: Move existing tests into separate subgroups
Date: Tue, 10 Nov 2020 08:50:55 +0100	[thread overview]
Message-ID: <20201110075102.5033-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20201110075102.5033-1-tzimmermann@suse.de>

Move the existing tests into subgroups for testing modesetting and
accessing the framebuffer.

v3:
	* put igt_describe() before igt_subtest() and igt_subtest_group()
	  (Petri)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 tests/fbdev.c | 53 ++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 40 insertions(+), 13 deletions(-)

diff --git a/tests/fbdev.c b/tests/fbdev.c
index e5efeb93..46641fea 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -37,28 +37,17 @@
 
 #include "igt.h"
 
-igt_main
+static void mode_tests(int fd)
 {
 	struct fb_var_screeninfo var_info;
 	struct fb_fix_screeninfo fix_info;
-	int fd = -1;
 
-	/*
-	 * Should this test focus on the fbdev independent of any drm driver,
-	 * or should it look for fbdev of a particular device?
-	 */
 	igt_fixture {
-		fd = open("/dev/fb0", O_RDWR);
-		if (fd < 0) {
-			drm_load_module(DRIVER_ANY);
-			fd = open("/dev/fb0", O_RDWR);
-		}
-		igt_require_f(fd != -1, "/dev/fb0\n");
-
 		igt_require(ioctl(fd, FBIOGET_VSCREENINFO, &var_info) == 0);
 		igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
 	}
 
+	igt_describe("Check if screeninfo is valid");
 	igt_subtest("info") {
 		unsigned long size;
 
@@ -69,7 +58,17 @@ igt_main
 			     fix_info.line_length,
 			     fix_info.smem_len);
 	}
+}
+
+static void framebuffer_tests(int fd)
+{
+	struct fb_fix_screeninfo fix_info;
 
+	igt_fixture {
+		igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
+	}
+
+	igt_describe("Check mmap operations on framebuffer memory");
 	igt_subtest("mmap") {
 		void *map;
 
@@ -82,6 +81,34 @@ igt_main
 		memset(map, 0, fix_info.smem_len);
 		munmap(map, fix_info.smem_len);
 	}
+}
+
+igt_main
+{
+	int fd = -1;
+
+	/*
+	 * Should this test focus on the fbdev independent of any drm driver,
+	 * or should it look for fbdev of a particular device?
+	 */
+	igt_fixture {
+		fd = open("/dev/fb0", O_RDWR);
+		if (fd < 0) {
+			drm_load_module(DRIVER_ANY);
+			fd = open("/dev/fb0", O_RDWR);
+		}
+		igt_require_f(fd != -1, "/dev/fb0\n");
+	}
+
+	igt_describe("Check modesetting");
+	igt_subtest_group {
+		mode_tests(fd);
+	}
+
+	igt_describe("Check framebuffer access");
+	igt_subtest_group {
+		framebuffer_tests(fd);
+	}
 
 	igt_fixture {
 		close(fd);
-- 
2.29.2

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

  reply	other threads:[~2020-11-10  7:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10  7:50 [igt-dev] [PATCH v3 0/8] Test cases for fbdev Thomas Zimmermann
2020-11-10  7:50 ` Thomas Zimmermann [this message]
2020-11-10  7:50 ` [igt-dev] [PATCH v3 2/8] tests/fbdev: Map framebuffer in igt_fixture Thomas Zimmermann
2020-11-11  9:49   ` Petri Latvala
2020-11-11 10:21     ` Thomas Zimmermann
2020-11-11 10:36       ` Petri Latvala
2020-11-10  7:50 ` [igt-dev] [PATCH v3 3/8] tests/fbdev: Add tests for read operations on framebuffer Thomas Zimmermann
2020-11-11  9:54   ` Petri Latvala
2020-11-10  7:50 ` [igt-dev] [PATCH v3 4/8] tests/fbdev: Add tests for unaligned reads on framebuffer memory Thomas Zimmermann
2020-11-11  9:56   ` Petri Latvala
2020-11-10  7:50 ` [igt-dev] [PATCH v3 5/8] tests/fbdev: Add tests for write operations on framebuffer Thomas Zimmermann
2020-11-11 10:17   ` Petri Latvala
2020-11-10  7:51 ` [igt-dev] [PATCH v3 6/8] tests/fbdev: Add tests for unaligned writes on framebuffer memory Thomas Zimmermann
2020-11-11 10:18   ` Petri Latvala
2020-11-10  7:51 ` [igt-dev] [PATCH v3 7/8] tests/fbdev: Add tests for accessing framebuffer near EOF Thomas Zimmermann
2020-11-11 10:19   ` Petri Latvala
2020-11-10  7:51 ` [igt-dev] [PATCH v3 8/8] tests/fbdev: Add tests for read/writing with NULL-pointer buffers Thomas Zimmermann
2020-11-11 10:20   ` Petri Latvala
2020-11-10 15:45 ` [igt-dev] ✗ Fi.CI.BAT: failure for Test cases for fbdev Patchwork
2020-11-11  9:11   ` Thomas Zimmermann
2020-11-11 10:22     ` Petri Latvala
2020-11-11 10:59       ` [igt-dev] =?unknown-8bit?b?4pyX?= " Chris Wilson

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=20201110075102.5033-2-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /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.