From 8a6658873a2a130eec21382a2f5bd4a4eff0da6e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 8 Mar 2016 11:22:11 +0200 Subject: fbtestpat: fix stride --- tests/fbtestpat.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/fbtestpat.cpp') 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); -- cgit v1.2.3