diff options
| author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2022-12-07 10:20:16 +0200 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2022-12-18 15:45:10 +0200 |
| commit | 46dc37c7a5a13cfd7777628676fd590c155abb24 (patch) | |
| tree | f393c7fb52f026a58d96048387f45bfa0e62cf1e /utils | |
| parent | 74ff7361c38c4f8620b68c72fd2263c1f2d6a5a2 (diff) | |
fbtest: fix for 16 bpp
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/fbtest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/fbtest.cpp b/utils/fbtest.cpp index fba7ba7..913d773 100644 --- a/utils/fbtest.cpp +++ b/utils/fbtest.cpp @@ -40,7 +40,9 @@ int main(int argc, char** argv) FAIL_IF(ptr == MAP_FAILED, "mmap failed"); - ExtCPUFramebuffer buf(var.xres, var.yres, PixelFormat::XRGB8888, + PixelFormat fmt = var.bits_per_pixel == 16 ? PixelFormat::RGB565 : PixelFormat::XRGB8888; + + ExtCPUFramebuffer buf(var.xres, var.yres, fmt, ptr, var.yres_virtual * fix.line_length, fix.line_length, 0); printf("%s: res %dx%d, virtual %dx%d, line_len %d\n", @@ -50,6 +52,7 @@ int main(int argc, char** argv) fix.line_length); draw_test_pattern(buf); + // XXX this may draw over the edge for narrow displays draw_text(buf, buf.width() / 2, 0, fbdev, RGB(255, 255, 255)); close(fd); |
