summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-08 11:22:11 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-03-08 15:42:47 +0200
commit8a6658873a2a130eec21382a2f5bd4a4eff0da6e (patch)
treee2e5be26ffdaa77fcc61404e0541dcf67a3ef73d /tests
parent38e504709494afa17d1df0d163d9a595ca729801 (diff)
fbtestpat: fix stride
Diffstat (limited to 'tests')
-rw-r--r--tests/fbtestpat.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/fbtestpat.cpp b/tests/fbtestpat.cpp
index 9607757..529a688 100644
--- a/tests/fbtestpat.cpp
+++ b/tests/fbtestpat.cpp
@@ -34,7 +34,7 @@ int main(int argc, char** argv)
r = ioctl(fd, FBIOGET_FSCREENINFO, &fix);
FAIL_IF(r, "FBIOGET_FSCREENINFO failed");
- void* ptr = mmap(NULL,
+ uint8_t* ptr = (uint8_t*)mmap(NULL,
var.yres_virtual * fix.line_length,
PROT_WRITE | PROT_READ,
MAP_SHARED, fd, 0);
@@ -51,7 +51,8 @@ int main(int argc, char** argv)
draw_test_pattern(buf);
- memcpy(ptr, buf.map(0), buf.size(0));
+ for (unsigned y = 0; y < var.yres_virtual; ++y)
+ memcpy(ptr + fix.line_length * y, buf.map(0) + buf.stride(0) * y, buf.stride(0));
close(fd);