Skip to content

Commit

Permalink
Support 16/32 bit color depth
Browse files Browse the repository at this point in the history
Mado currently uses 32-bit bpp, supporting display devices on
desktop/laptop computers, while Raspberry Pi devices use 16-bit
bpp. To improve mado’s compatibility across various Linux
framebuffer environments, testing showed that
tx->fb_var.bits_per_pixel automatically sets the appropriate bpp
without requiring manual configuration.
  • Loading branch information
huaxinliao committed Nov 7, 2024
1 parent efe7d49 commit b6a91e5
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions backend/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ static bool twin_fbdev_apply_config(twin_fbdev_t *tx)
/* Set the virtual screen size to be the same as the physical screen */
tx->fb_var.xres_virtual = tx->fb_var.xres;
tx->fb_var.yres_virtual = tx->fb_var.yres;
tx->fb_var.bits_per_pixel = 32;
if (ioctl(tx->fb_fd, FBIOPUT_VSCREENINFO, &tx->fb_var) < 0) {
log_error("Failed to set framebuffer mode");
return false;
Expand All @@ -111,12 +110,6 @@ static bool twin_fbdev_apply_config(twin_fbdev_t *tx)
return false;
}

/* Check bits per pixel */
if (tx->fb_var.bits_per_pixel != 32) {
log_error("Failed to set framebuffer bpp to 32");
return false;
}

/* Read unchangable information of the framebuffer */
ioctl(tx->fb_fd, FBIOGET_FSCREENINFO, &tx->fb_fix);

Expand Down

0 comments on commit b6a91e5

Please sign in to comment.