Skip to contentSkip to conversation

Test cases for fbdev

PATCH Superseded Thomas Zimmermann 3 participants 11 messages Nov 6, 2020

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover Test cases for fbdev

This patchset adds read and write tests for fbdev. It compares the content of the framebuffer and reference buffer. A number of the special cases near the EOF are also tested.

Depending on the implementation (sys, cfb), fbdev read/write changes its semantics. Together with a kernel patches [1] these test cases intend to provide a reference.

v2:
* move tests into subtest groups
* do setup in igt_fixtures (Daniel, Chris, Petri)
* add additional tests for unaligned access and NULL-pointer buffers (Daniel)

[1] https://patchwork.freedesktop.org/series/80038/

Thomas Zimmermann (8):
tests/fbdev: Move existing tests into separate subgroups tests/fbdev: Map framebuffer in igt_fixture tests/fbdev: Add tests for read operations on framebuffer tests/fbdev: Add tests for unaligned reads on framebuffer memory tests/fbdev: Add tests for write operations on framebuffer tests/fbdev: Add tests for unaligned writes on framebuffer memory tests/fbdev: Add tests for accessing framebuffer near EOF tests/fbdev: Add tests for read/writing with NULL-pointer buffers

 tests/fbdev.c | 228 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 213 insertions(+), 15 deletions(-)

--
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#1 lore raw

PATCH v2 1/8 tests/fbdev: Move existing tests into separate subgroups

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

---
 tests/fbdev.c | 55 +++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 42 insertions(+), 13 deletions(-)
tests/fbdev.c +42 -13
index e5efeb93..b61e1cea 100644
@@ -37,24 +37,12 @@
 
 #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);
 	}
@@ -62,6 +50,8 @@ igt_main
 	igt_subtest("info") {
 		unsigned long size;
 
+		igt_describe("Check if screeninfo is valid");
+
 		size = var_info.yres * fix_info.line_length;
 		igt_assert_f(size <= fix_info.smem_len,
 			     "screen size (%d x %d) of pitch %d does not fit within mappable area of size %u\n",
@@ -69,10 +59,21 @@ 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_subtest("mmap") {
 		void *map;
 
+		igt_describe("Check mmap operations on framebuffer memory");
+
 		igt_require(fix_info.smem_len);
 
 		map = mmap(NULL, fix_info.smem_len,
@@ -82,6 +83,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_subtest_group {
+		igt_describe("Check modesetting");
+		mode_tests(fd);
+	}
+
+	igt_subtest_group {
+		igt_describe("Check framebuffer access");
+		framebuffer_tests(fd);
+	}
 
 	igt_fixture {
 		close(fd);
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

Re: [igt-dev] [PATCH v2 1/8] tests/fbdev: Move existing tests into separate subgroups

Quoted 39 lines · Thomas Zimmermann

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

---
 tests/fbdev.c | 55 +++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 42 insertions(+), 13 deletions(-)
tests/fbdev.c +1 -13
index e5efeb93..b61e1cea 100644
@@ -37,24 +37,12 @@
 
 #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);
 	}

tests/fbdev.c igt_main · line 54

Quoted 5 lines
tests/fbdev.c +2 -0
@@ -62,6 +50,8 @@ igt_main
 	igt_subtest("info") {
 		unsigned long size;
 
+		igt_describe("Check if screeninfo is valid");
+

igt_describe needs to be called before the thing it documents (igt_subtest_group or igt_subtest), can't call it from inside an igt_subtest.

Quoted 12 lines
tests/fbdev.c +5 -0
 		size = var_info.yres * fix_info.line_length;
 		igt_assert_f(size <= fix_info.smem_len,
 			     "screen size (%d x %d) of pitch %d does not fit within mappable area of size %u\n",
@@ -69,10 +59,21 @@ igt_main
 			     fix_info.line_length,
 			     fix_info.smem_len);
 	}
+}
+
+static void framebuffer_tests(int fd)
+{
+	struct fb_fix_screeninfo fix_info;

tests/fbdev.c igt_main · line 76

Quoted 10 lines
tests/fbdev.c +6 -0
+
+	igt_fixture {
+		igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
+	}
 
 	igt_subtest("mmap") {
 		void *map;
 
+		igt_describe("Check mmap operations on framebuffer memory");
+

Same here.

Quoted 18 lines
tests/fbdev.c +11 -0
 		igt_require(fix_info.smem_len);
 
 		map = mmap(NULL, fix_info.smem_len,
@@ -82,6 +83,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 {

tests/fbdev.c igt_main · line 106

Quoted 10 lines
tests/fbdev.c +10 -0
+		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_subtest_group {
+		igt_describe("Check modesetting");

Same here for this subtest_group, call igt_describe before the igt_subtest_group block.

tests/fbdev.c igt_main · line 111

Quoted 5 lines
tests/fbdev.c +5 -0
+		mode_tests(fd);
+	}
+
+	igt_subtest_group {
+		igt_describe("Check framebuffer access");

Same.

Signature · 5 lines
Petri Latvala
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

PATCH v2 2/8 tests/fbdev: Map framebuffer in igt_fixture

In reply to Thomas Zimmermann

The mapping of the framebuffer memory will be useful for read/write tests. Move it into an igt_fixture block.

---
 tests/fbdev.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
tests/fbdev.c +4 -7
index b61e1cea..078aa880 100644
@@ -64,16 +64,10 @@ static void mode_tests(int fd)
 static void framebuffer_tests(int fd)
 {
 	struct fb_fix_screeninfo fix_info;
+	void *map;
 
 	igt_fixture {
 		igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
-	}
-
-	igt_subtest("mmap") {
-		void *map;
-
-		igt_describe("Check mmap operations on framebuffer memory");
-
 		igt_require(fix_info.smem_len);
 
 		map = mmap(NULL, fix_info.smem_len,
@@ -81,6 +75,9 @@ static void framebuffer_tests(int fd)
 		igt_assert(map != MAP_FAILED);
 
 		memset(map, 0, fix_info.smem_len);
+	}
+
+	igt_fixture {
 		munmap(map, fix_info.smem_len);
 	}
 }
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#4 lore raw

PATCH v2 3/8 tests/fbdev: Add tests for read operations on framebuffer

In reply to Thomas Zimmermann

The read tests check the read buffer against the content of the mapped framebuffer.

---
 tests/fbdev.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
tests/fbdev.c +26 -0
index 078aa880..e060e3c3 100644
@@ -25,6 +25,7 @@
 
 #include "igt.h"
 
+#include <errno.h>
 #include <fcntl.h>
 #include <string.h>
 #include <sys/ioctl.h>
@@ -65,6 +66,7 @@ static void framebuffer_tests(int fd)
 {
 	struct fb_fix_screeninfo fix_info;
 	void *map;
+	void *buf;
 
 	igt_fixture {
 		igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
@@ -74,10 +76,34 @@ static void framebuffer_tests(int fd)
 			   PROT_WRITE, MAP_SHARED, fd, 0);
 		igt_assert(map != MAP_FAILED);
 
+		buf = malloc(fix_info.smem_len);
+		igt_assert(buf);
+	}
+
+	igt_subtest("read") {
+		ssize_t ret;
+		int cmp;
+
+		igt_describe("Check read operations on framebuffer memory");
+
+		/* fill framebuffer with 0 and compare */
 		memset(map, 0, fix_info.smem_len);
+		ret = pread(fd, buf, fix_info.smem_len, 0);
+		igt_require_f(ret == (ssize_t)fix_info.smem_len, "pread failed, ret=%zd\n", ret);
+		cmp = memcmp(map, buf, fix_info.smem_len);
+		igt_require_f(!cmp, "read buffer differs from mapped framebuffer for 0\n");
+
+		/* fill framebuffer with 0x55 and compare */
+		memset(map, 0x55, fix_info.smem_len);
+		ret = pread(fd, buf, fix_info.smem_len, 0);
+		igt_require_f(ret == (ssize_t)fix_info.smem_len, "pread failed, ret=%zd\n", ret);
+		cmp = memcmp(map, buf, fix_info.smem_len);
+		igt_require_f(!cmp, "read buffer differs from mapped framebuffer for 0x55\n");
 	}
 
 	igt_fixture {
+		free(buf);
+		memset(map, 0, fix_info.smem_len); // don't leave garbage on the screen
 		munmap(map, fix_info.smem_len);
 	}
 }
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#5 lore raw

PATCH v2 4/8 tests/fbdev: Add tests for unaligned reads on framebuffer memory

In reply to Thomas Zimmermann

The tests for unaligned reads start and stop reading within pages.

---
 tests/fbdev.c | 41 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)
tests/fbdev.c +39 -2
index e060e3c3..48ffbbf5 100644
@@ -65,10 +65,13 @@ static void mode_tests(int fd)
 static void framebuffer_tests(int fd)
 {
 	struct fb_fix_screeninfo fix_info;
-	void *map;
-	void *buf;
+	unsigned char *map;
+	unsigned char *buf;
+	size_t pagesize;
 
 	igt_fixture {
+		long ret;
+
 		igt_require(ioctl(fd, FBIOGET_FSCREENINFO, &fix_info) == 0);
 		igt_require(fix_info.smem_len);
 
@@ -78,6 +81,10 @@ static void framebuffer_tests(int fd)
 
 		buf = malloc(fix_info.smem_len);
 		igt_assert(buf);
+
+		ret = sysconf(_SC_PAGESIZE);
+		igt_assert(ret != -1);
+		pagesize = ret;
 	}
 
 	igt_subtest("read") {
@@ -101,6 +108,36 @@ static void framebuffer_tests(int fd)
 		igt_require_f(!cmp, "read buffer differs from mapped framebuffer for 0x55\n");
 	}
 
+	igt_subtest("unaligned-read") {
+		off_t off;
+		size_t len;
+		ssize_t ret;
+		const unsigned char *pos;
+
+		igt_describe("Check read operations on unaligned locations in framebuffer memory");
+
+		off = pagesize + (pagesize >> 2); // 1.25 * pagesize
+		len = (pagesize << 2) + (pagesize >> 1); // 4.5 * pagesize
+		igt_require_f((off + len) < fix_info.smem_len, "framebuffer too small\n");
+
+		/* read at unaligned location and compare */
+		memset(map, 0, fix_info.smem_len);
+		memset(&map[off], 0x55, len);
+		memset(buf, 0xff, fix_info.smem_len);
+		ret = pread(fd, &buf[off], len, off);
+		igt_require_f(ret == (ssize_t)len, "pread failed, ret=%zd\n", ret);
+		pos = memchr(buf, 0x55, fix_info.smem_len);
+		igt_require_f(pos, "0x55 not found within read buffer\n");
+		igt_require_f(pos == &buf[off], "0x55 found at pos %zu, expected %lld\n",
+			     pos - buf, (long long)off);
+		pos = memchr(&buf[off], 0xff, fix_info.smem_len - off);
+		igt_require_f(pos, "0xff not found within read buffer\n");
+		igt_require_f(pos == &buf[off + len], "0xff found at pos %zu, expected %lld\n",
+			     pos - buf, (long long)(off + len));
+		pos = memchr(&buf[off + len], 0x55, fix_info.smem_len - off + len);
+		igt_require_f(pos, "found 0x55 at pos %zu, none expected\n", pos - buf);
+	}
+
 	igt_fixture {
 		free(buf);
 		memset(map, 0, fix_info.smem_len); // don't leave garbage on the screen
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#6 lore raw

PATCH v2 5/8 tests/fbdev: Add tests for write operations on framebuffer

In reply to Thomas Zimmermann

The write tests check the written buffer against the content of the mapped framebuffer.

---
 tests/fbdev.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
tests/fbdev.c +21 -0
index 48ffbbf5..f40a9ee1 100644
@@ -138,6 +138,27 @@ static void framebuffer_tests(int fd)
 		igt_require_f(pos, "found 0x55 at pos %zu, none expected\n", pos - buf);
 	}
 
+	igt_subtest("write") {
+		ssize_t ret;
+		int cmp;
+
+		igt_describe("Check write operations on framebuffer memory");
+
+		/* write 0 to framebuffer and compare */
+		memset(buf, 0, fix_info.smem_len);
+		ret = pwrite(fd, buf, fix_info.smem_len, 0);
+		igt_require_f(ret == (ssize_t)fix_info.smem_len, "pwrite failed, ret=%zd\n", ret);
+		cmp = memcmp(map, buf, fix_info.smem_len);
+		igt_require_f(!cmp, "write buffer differs from mapped framebuffer for 0\n");
+
+		/* write 0x55 to framebuffer and compare */
+		memset(buf, 0x55, fix_info.smem_len);
+		ret = pwrite(fd, buf, fix_info.smem_len, 0);
+		igt_require_f(ret == (ssize_t)fix_info.smem_len, "pwrite failed, ret=%zd\n", ret);
+		cmp = memcmp(map, buf, fix_info.smem_len);
+		igt_require_f(!cmp, "write buffer differs from mapped framebuffer for 0\n");
+	}
+
 	igt_fixture {
 		free(buf);
 		memset(map, 0, fix_info.smem_len); // don't leave garbage on the screen
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#7 lore raw

PATCH v2 6/8 tests/fbdev: Add tests for unaligned writes on framebuffer memory

In reply to Thomas Zimmermann

The tests for unaligned writes start and stop writing within pages.

---
 tests/fbdev.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
tests/fbdev.c +30 -0
index f40a9ee1..d9f2e664 100644
@@ -159,6 +159,36 @@ static void framebuffer_tests(int fd)
 		igt_require_f(!cmp, "write buffer differs from mapped framebuffer for 0\n");
 	}
 
+	igt_subtest("unaligned-write") {
+		off_t off;
+		size_t len;
+		ssize_t ret;
+		const unsigned char *pos;
+
+		igt_describe("Check write operations on unaligned locations in framebuffer memory");
+
+		off = pagesize + (pagesize >> 2); // 1.25 * pagesize
+		len = (pagesize << 2) + (pagesize >> 1); // 4.5 * pagesize
+		igt_require_f((off + len) < fix_info.smem_len, "framebuffer too small\n");
+
+		/* read at unaligned location and compare */
+		memset(map, 0xff, fix_info.smem_len);
+		memset(buf, 0, fix_info.smem_len);
+		memset(&buf[off], 0x55, len);
+		ret = pwrite(fd, &buf[off], len, off);
+		igt_require_f(ret == (ssize_t)len, "pwrite failed, ret=%zd\n", ret);
+		pos = memchr(map, 0x55, fix_info.smem_len);
+		igt_require_f(pos, "0x55 not found within framebuffer\n");
+		igt_require_f(pos == &map[off], "0x55 found at pos %zu, expected %lld\n",
+			     pos - map, (long long)off);
+		pos = memchr(&map[off], 0xff, fix_info.smem_len - off);
+		igt_require_f(pos, "0xff not found within framebuffer\n");
+		igt_require_f(pos == &map[off + len], "0xff found at pos %zu, expected %lld\n",
+			     pos - map, (long long)(off + len));
+		pos = memchr(&map[off + len], 0x55, fix_info.smem_len - off + len);
+		igt_require_f(pos, "found 0x55 at pos %zu, none expected\n", pos - map);
+	}
+
 	igt_fixture {
 		free(buf);
 		memset(map, 0, fix_info.smem_len); // don't leave garbage on the screen
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#8 lore raw

PATCH v2 7/8 tests/fbdev: Add tests for accessing framebuffer near EOF

In reply to Thomas Zimmermann

Fbdev has some specific behavior when reading/writing near the EOF, which the eof test checks. If at least one bytes has been written, the number of bytes has to be returned, otherwise an error code (if any) has to be returned, or otherwise 0 has to returned. Not all drivers get this right.

---
 tests/fbdev.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)
tests/fbdev.c +47 -1
index d9f2e664..5b7086d1 100644
@@ -79,7 +79,8 @@ static void framebuffer_tests(int fd)
 			   PROT_WRITE, MAP_SHARED, fd, 0);
 		igt_assert(map != MAP_FAILED);
 
-		buf = malloc(fix_info.smem_len);
+		/* allocate two additional bytes for eof test */
+		buf = malloc(fix_info.smem_len + 2);
 		igt_assert(buf);
 
 		ret = sysconf(_SC_PAGESIZE);
@@ -189,6 +190,51 @@ static void framebuffer_tests(int fd)
 		igt_require_f(pos, "found 0x55 at pos %zu, none expected\n", pos - map);
 	}
 
+	igt_subtest("eof") {
+		unsigned long lastindex = fix_info.smem_len - 1;
+		unsigned char *maplast = &((unsigned char *)map)[lastindex];
+		unsigned char *buflast = &((unsigned char *)buf)[lastindex];
+		ssize_t ret;
+
+		igt_describe("Check framebuffer access near EOF");
+
+		*buflast = 0x55;
+
+		/* write across EOF; set remaining bytes */
+		ret = pwrite(fd, buflast, 2, lastindex);
+		igt_require_f(ret == 1, "write crossed EOF, ret=%zd\n", ret);
+		igt_require_f(*maplast == *buflast, "write buffer differs from mapped framebuffer at final byte, "
+		                                    "maplast=%u buflast=%u\n", *maplast, *buflast);
+
+		/* write at EOF; get ENOSPC */
+		ret = pwrite(fd, &buflast[1], 1, lastindex + 1);
+		igt_require_f((ret == -1) && (errno == ENOSPC), "write at EOF, ret=%zd\n", ret);
+
+		*maplast = 0;
+
+		/* write final byte */
+		ret = pwrite(fd, buflast, 1, lastindex);
+		igt_require_f(ret == 1, "write before EOF, ret=%zd\n", ret);
+		igt_require_f(*maplast == *buflast, "write buffer differs from mapped framebuffer at final byte, "
+		                                    "maplast=%u buflast=%u\n", *maplast, *buflast);
+
+		/* write after EOF; get EFBIG */
+		ret = pwrite(fd, &buflast[2], 1, lastindex + 2);
+		igt_require_f((ret == -1) && (errno == EFBIG), "write after EOF, ret=%zd\n", ret);
+
+		*maplast = 0;
+
+		/* read across the EOF; get remaining bytes */
+		ret = pread(fd, buflast, 2, lastindex);
+		igt_require_f(ret == 1, "read before EOF, ret=%zd\n", ret);
+		igt_require_f(*maplast == *buflast, "read buffer differs from mapped framebuffer at final byte, "
+		                                    "maplast=%u buflast=%u\n", *maplast, *buflast);
+
+		/* read after EOF; get 0 */
+		ret = pread(fd, &buflast[1], 1, lastindex + 1);
+		igt_require_f(ret == 0, "read at EOF, ret=%zd\n", ret);
+	}
+
 	igt_fixture {
 		free(buf);
 		memset(map, 0, fix_info.smem_len); // don't leave garbage on the screen
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#9 lore raw

PATCH v2 8/8 tests/fbdev: Add tests for read/writing with NULL-pointer buffers

In reply to Thomas Zimmermann

Trying to read and write with a NULL-pointer buffer should fail and report EFAULT.

---
 tests/fbdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
tests/fbdev.c +12 -0
index 5b7086d1..6e279415 100644
@@ -235,6 +235,18 @@ static void framebuffer_tests(int fd)
 		igt_require_f(ret == 0, "read at EOF, ret=%zd\n", ret);
 	}
 
+	igt_subtest("nullptr") {
+		ssize_t ret;
+
+		igt_describe("Check framebuffer access with NULL");
+
+		ret = pread(fd, NULL, fix_info.smem_len, 0);
+		igt_require_f((ret == -1) && (errno == EFAULT), "reading into NULL did not return EFAULT, ret=%zd\n", ret);
+
+		ret = pwrite(fd, NULL, fix_info.smem_len, 0);
+		igt_require_f((ret == -1) && (errno == EFAULT), "writing from NULL did not return EFAULT, ret=%zd\n", ret);
+	}
+
 	igt_fixture {
 		free(buf);
 		memset(map, 0, fix_info.smem_len); // don't leave garbage on the screen
Signature · 6 lines
2.29.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#10 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for Test cases for fbdev (rev2)

In reply to Thomas Zimmermann
== Series Details ==

== Series Details ==

Series: Test cases for fbdev (rev2)
URL : https://patchwork.freedesktop.org/series/83424/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_9278 -> IGTPW_5138
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_5138 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_5138, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_5138:

### IGT changes ###

#### Possible regressions ####

* igt@fbdev@mmap:
- fi-tgl-u2: [PASS][1] -> [SKIP][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-tgl-u2/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-tgl-u2/igt@[email protected]
- fi-tgl-y: [PASS][3] -> [SKIP][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-tgl-y/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-tgl-y/igt@[email protected]
- fi-cml-s: [PASS][5] -> [SKIP][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-cml-s/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-cml-s/igt@[email protected]
- fi-icl-y: [PASS][7] -> [SKIP][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-icl-y/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-icl-y/igt@[email protected]
- fi-icl-u2: [PASS][9] -> [SKIP][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-icl-u2/igt@[email protected]
- fi-cml-u2: [PASS][11] -> [SKIP][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-cml-u2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-cml-u2/igt@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@fbdev@mmap:
- {fi-ehl-1}: [PASS][13] -> [SKIP][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-ehl-1/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-ehl-1/igt@[email protected]

Known issues
------------

Here are the changes found in IGTPW_5138 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@fbdev@mmap:
- fi-skl-lmem: [PASS][15] -> [SKIP][16] ([fdo#109271])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-skl-lmem/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-skl-lmem/igt@[email protected]
- fi-ivb-3770: [PASS][17] -> [SKIP][18] ([fdo#109271])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-ivb-3770/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-ivb-3770/igt@[email protected]
- fi-ilk-650: [PASS][19] -> [SKIP][20] ([fdo#109271])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-ilk-650/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-ilk-650/igt@[email protected]
- fi-bsw-n3050: [PASS][21] -> [SKIP][22] ([fdo#109271])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-bsw-n3050/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-bsw-n3050/igt@[email protected]
- fi-cfl-guc: [PASS][23] -> [SKIP][24] ([fdo#109271])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-cfl-guc/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-cfl-guc/igt@[email protected]
- fi-snb-2600: [PASS][25] -> [SKIP][26] ([fdo#109271])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-snb-2600/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-snb-2600/igt@[email protected]
- fi-kbl-x1275: [PASS][27] -> [SKIP][28] ([fdo#109271])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-kbl-x1275/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-kbl-x1275/igt@[email protected]
- fi-kbl-soraka: [PASS][29] -> [SKIP][30] ([fdo#109271])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-kbl-soraka/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-kbl-soraka/igt@[email protected]
- fi-glk-dsi: [PASS][31] -> [SKIP][32] ([fdo#109271])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-glk-dsi/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-glk-dsi/igt@[email protected]
- fi-bsw-kefka: [PASS][33] -> [SKIP][34] ([fdo#109271])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-bsw-kefka/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-bsw-kefka/igt@[email protected]
- fi-kbl-r: [PASS][35] -> [SKIP][36] ([fdo#109271])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-kbl-r/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-kbl-r/igt@[email protected]
- fi-blb-e6850: [PASS][37] -> [SKIP][38] ([fdo#109271])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-blb-e6850/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-blb-e6850/igt@[email protected]
- fi-kbl-7500u: [PASS][39] -> [SKIP][40] ([fdo#109271])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-kbl-7500u/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-kbl-7500u/igt@[email protected]
- fi-cfl-8109u: [PASS][41] -> [SKIP][42] ([fdo#109271])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-cfl-8109u/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-cfl-8109u/igt@[email protected]
- fi-gdg-551: [PASS][43] -> [SKIP][44] ([fdo#109271])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-gdg-551/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-gdg-551/igt@[email protected]
- fi-bwr-2160: [PASS][45] -> [SKIP][46] ([fdo#109271])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-bwr-2160/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-bwr-2160/igt@[email protected]
- fi-skl-guc: [PASS][47] -> [SKIP][48] ([fdo#109271])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-skl-guc/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-skl-guc/igt@[email protected]
- fi-skl-6600u: [PASS][49] -> [SKIP][50] ([fdo#109271])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-skl-6600u/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-skl-6600u/igt@[email protected]
- fi-pnv-d510: [PASS][51] -> [SKIP][52] ([fdo#109271])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-pnv-d510/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-pnv-d510/igt@[email protected]
- fi-bdw-5557u: [PASS][53] -> [SKIP][54] ([fdo#109271])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-bdw-5557u/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-bdw-5557u/igt@[email protected]
- fi-snb-2520m: [PASS][55] -> [SKIP][56] ([fdo#109271])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-snb-2520m/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-snb-2520m/igt@[email protected]
- fi-apl-guc: [PASS][57] -> [SKIP][58] ([fdo#109271] / [i915#1635])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-apl-guc/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-apl-guc/igt@[email protected]
- fi-hsw-4770: [PASS][59] -> [SKIP][60] ([fdo#109271])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-hsw-4770/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-hsw-4770/igt@[email protected]
- fi-cfl-8700k: [PASS][61] -> [SKIP][62] ([fdo#109271])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-cfl-8700k/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-cfl-8700k/igt@[email protected]
- fi-bxt-dsi: [PASS][63] -> [SKIP][64] ([fdo#109271] / [i915#1635])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-bxt-dsi/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-bxt-dsi/igt@[email protected]
- fi-skl-6700k2: [PASS][65] -> [SKIP][66] ([fdo#109271])
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-skl-6700k2/igt@[email protected]
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-skl-6700k2/igt@[email protected]
- fi-elk-e7500: [PASS][67] -> [SKIP][68] ([fdo#109271])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-elk-e7500/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-elk-e7500/igt@[email protected]
- fi-byt-j1900: [PASS][69] -> [SKIP][70] ([fdo#109271])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-byt-j1900/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-byt-j1900/igt@[email protected]

* igt@gem_exec_create@basic:
- fi-tgl-y: [PASS][71] -> [DMESG-WARN][72] ([i915#402]) +2 similar issues
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-tgl-y/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-tgl-y/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-bsw-kefka: [PASS][73] -> [DMESG-WARN][74] ([i915#1982]) +1 similar issue
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-bsw-kefka/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-bsw-kefka/igt@[email protected]
- fi-apl-guc: [PASS][75] -> [DMESG-WARN][76] ([i915#1635] / [i915#1982])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-apl-guc/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-apl-guc/igt@[email protected]

* igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
- fi-icl-u2: [PASS][77] -> [DMESG-WARN][78] ([i915#1982]) +1 similar issue
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-icl-u2/igt@kms_flip@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-icl-u2/igt@kms_flip@[email protected]

#### Possible fixes ####

* igt@core_hotunplug@unbind-rebind:
- fi-blb-e6850: [INCOMPLETE][79] ([i915#2540]) -> [PASS][80]
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-blb-e6850/igt@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-blb-e6850/igt@[email protected]

* igt@i915_module_load@reload:
- fi-tgl-u2: [DMESG-WARN][81] ([i915#1982] / [k.org#205379]) -> [PASS][82]
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-tgl-u2/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-tgl-u2/igt@[email protected]
- fi-tgl-y: [DMESG-WARN][83] ([i915#1982] / [k.org#205379]) -> [PASS][84]
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-tgl-y/igt@[email protected]
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-tgl-y/igt@[email protected]

* igt@i915_pm_rpm@module-reload:
- fi-kbl-guc: [SKIP][85] ([fdo#109271]) -> [PASS][86]
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-kbl-guc/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-kbl-guc/igt@[email protected]

* igt@i915_selftest@live@execlists:
- fi-cfl-8109u: [INCOMPLETE][87] ([i915#2089]) -> [PASS][88]
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-cfl-8109u/igt@i915_selftest@[email protected]
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-cfl-8109u/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@gt_timelines:
- fi-apl-guc: [INCOMPLETE][89] ([i915#1635]) -> [PASS][90]
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-apl-guc/igt@i915_selftest@live@gt_timelines.html
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-apl-guc/igt@i915_selftest@live@gt_timelines.html

* igt@kms_busy@basic@flip:
- fi-kbl-soraka: [DMESG-WARN][91] ([i915#1982]) -> [PASS][92]
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-kbl-soraka/igt@kms_busy@[email protected]
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-kbl-soraka/igt@kms_busy@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-byt-j1900: [DMESG-WARN][93] ([i915#1982]) -> [PASS][94]
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-byt-j1900/igt@[email protected]
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-byt-j1900/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-icl-u2: [DMESG-WARN][95] ([i915#1982]) -> [PASS][96]
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-icl-u2/igt@[email protected]
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-icl-u2/igt@[email protected]

* igt@prime_self_import@basic-with_one_bo:
- fi-tgl-y: [DMESG-WARN][97] ([i915#402]) -> [PASS][98]
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9278/fi-tgl-y/igt@prime_self_import@basic-with_one_bo.html
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/fi-tgl-y/igt@prime_self_import@basic-with_one_bo.html

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2089]: https://gitlab.freedesktop.org/drm/intel/issues/2089
[i915#2540]: https://gitlab.freedesktop.org/drm/intel/issues/2540
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[k.org#205379]: https://bugzilla.kernel.org/show_bug.cgi?id=205379

Participating hosts (43 -> 40)
------------------------------

Missing (3): fi-bsw-cyan fi-bdw-samus fi-hsw-4200u

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5836 -> IGTPW_5138

CI-20190529: 20190529
CI_DRM_9278: 4004b239e7a4a8c1bfba86208e71021a74be2a57 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5138: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/index.html
IGT_5836: 4c2ec0ad123b82f42f9fe2297e1a41fec73c9229 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

+igt@fbdev@eof
+igt@fbdev@nullptr
+igt@fbdev@read
+igt@fbdev@unaligned-read
+igt@fbdev@unaligned-write
+igt@fbdev@write
-igt@fbdev@mmap

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5138/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev