summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);