0
0
mirror of https://github.com/openwrt/packages.git synced 2025-02-22 13:06:15 +00:00
packages/libs/serdisplib/patches/002-allow-1bpp-framebuffer.patch
Rosen Penev 9a2f67de84 serdisplib: update to 2.02
Use standard PKG_INSTALL. Added patch to fix compilation with it.

Use PKG_INSTALL_DIR as a result.

Added PKG_BUILD_PARALLEL for faster compilation.

Fixed license information.

Add build depends for libusb as it is needed for compilation.

Various small cleanups.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-15 20:42:05 -08:00

22 lines
917 B
Diff

--- a/src/serdisp_specific_framebuffer.c
+++ b/src/serdisp_specific_framebuffer.c
@@ -312,13 +312,15 @@ serdisp_t* serdisp_framebuffer_setup(con
if (fb_success) {
/* check if colour mode is supported */
- if (! (vinfo.bits_per_pixel == 16 || vinfo.bits_per_pixel == 24 || vinfo.bits_per_pixel == 32) ) {
+ if (! (vinfo.bits_per_pixel == 1 ||vinfo.bits_per_pixel == 16 || vinfo.bits_per_pixel == 24 || vinfo.bits_per_pixel == 32) ) {
sd_error(SERDISP_ERUNTIME, "unsupported colour depth (%d)", vinfo.bits_per_pixel);
fb_success = 0;
}
}
-
- dd->scrbuf_size = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8;
+ if (vinfo.bits_per_pixel == 1)
+ dd->scrbuf_size = (vinfo.xres * vinfo.yres) / 8;
+ else
+ dd->scrbuf_size = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8;
if (fb_success) {
/* map framebuffer device to memory */