blob: ada4281e9607dbef7503e4fab8a1cba787e8c55d [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001--- a/src/serdisp_specific_framebuffer.c
2+++ b/src/serdisp_specific_framebuffer.c
3@@ -312,13 +312,15 @@ serdisp_t* serdisp_framebuffer_setup(con
4
5 if (fb_success) {
6 /* check if colour mode is supported */
7- if (! (vinfo.bits_per_pixel == 16 || vinfo.bits_per_pixel == 24 || vinfo.bits_per_pixel == 32) ) {
8+ if (! (vinfo.bits_per_pixel == 1 ||vinfo.bits_per_pixel == 16 || vinfo.bits_per_pixel == 24 || vinfo.bits_per_pixel == 32) ) {
9 sd_error(SERDISP_ERUNTIME, "unsupported colour depth (%d)", vinfo.bits_per_pixel);
10 fb_success = 0;
11 }
12 }
13-
14- dd->scrbuf_size = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8;
15+ if (vinfo.bits_per_pixel == 1)
16+ dd->scrbuf_size = (vinfo.xres * vinfo.yres) / 8;
17+ else
18+ dd->scrbuf_size = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8;
19
20 if (fb_success) {
21 /* map framebuffer device to memory */