summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2020-11-20 11:52:14 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-11-23 12:30:17 +0000
commitb3b32e10057a05a6e0b0845453179e25228bd018 (patch)
treef37d0862c6b091f13b8442b8b0cf5bad2c8dcc38 /tests
parent50064ff65fb7ce5ea0facd143b76aa34d5ff53e2 (diff)
tests/fbdev: Add tests for write operations on framebuffer
The write tests check the written buffer against the content of the mapped framebuffer. v4: * replace igt_require() by iqt_assert() in "write" (Petri) * add write test to CI v3: * put igt_describe() before igt_subtest() (Petri) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/fbdev.c16
-rw-r--r--tests/intel-ci/fast-feedback.testlist1
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/fbdev.c b/tests/fbdev.c
index d6bc70e0..f6e2a091 100644
--- a/tests/fbdev.c
+++ b/tests/fbdev.c
@@ -144,6 +144,22 @@ static void framebuffer_tests(int fd)
pos - buf);
}
+ igt_describe("Check write operations on framebuffer memory");
+ igt_subtest("write") {
+ ssize_t ret;
+
+ /* write to framebuffer and compare */
+ for (int i = 0; i < ARRAY_SIZE(values); i++) {
+ memset(buf, values[i], fix_info.smem_len);
+ ret = pwrite(fd, buf, fix_info.smem_len, 0);
+ igt_assert_f(ret == (ssize_t)fix_info.smem_len,
+ "pwrite failed, ret=%zd\n", ret);
+ igt_assert_f(!memcmp(map, buf, fix_info.smem_len),
+ "write differs from mapped framebuffer for %x\n",
+ values[i]);
+ }
+ }
+
igt_fixture {
free(buf);
/* don't leave garbage on the screen */
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index fc8a605f..58e2ac1c 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -4,6 +4,7 @@ igt@core_auth@basic-auth
igt@debugfs_test@read_all_entries
igt@fbdev@info
igt@fbdev@read
+igt@fbdev@write
igt@gem_basic@bad-close
igt@gem_basic@create-close
igt@gem_basic@create-fd-close