Browse Source

Fix for linux framebuffer for RGB555 and BGR555

inmarket 2 years ago
parent
commit
bc336ee15f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      boards/base/Linux-Framebuffer/board_framebuffer.h

+ 5 - 1
boards/base/Linux-Framebuffer/board_framebuffer.h

@@ -96,7 +96,11 @@
96 96
 			fb_var.reserved[2] = 0;
97 97
 			fb_var.xoffset = 0;
98 98
 			fb_var.yoffset = 0;
99
-			fb_var.bits_per_pixel = sizeof(LLDCOLOR_TYPE)*8;
99
+			#if LLDCOLOR_BITS == 15
100
+				fb_var.bits_per_pixel = LLDCOLOR_BITS;				// Handle RGB555 & BGR555
101
+			#else
102
+				fb_var.bits_per_pixel = sizeof(LLDCOLOR_TYPE)*8;
103
+			#endif
100 104
 			fb_var.grayscale = 0;
101 105
 			fb_var.activate = FB_ACTIVATE_NOW;
102 106
 			if (ioctl(fb, FBIOPUT_VSCREENINFO, &fb_var) == -1 || ioctl (fb, FBIOGET_VSCREENINFO, &fb_var) == -1) {