Handle cases where __vesa_info.mi.bpp is not a multiple of 8, e.g. 15.
Remove totally redundant switch statement in vesacon_update_characters().
pixel_offset = ((row*height+VIDEO_BORDER)*VIDEO_X_SIZE)+
(col*width+VIDEO_BORDER);
- switch (__vesacon_pixel_format) {
- case PXF_BGR24:
- bytes_per_pixel = 3;
- break;
- case PXF_BGRA32:
- bytes_per_pixel = 4;
- break;
- case PXF_LE_RGB16_565:
- bytes_per_pixel = 2;
- break;
- default:
- bytes_per_pixel = 0;
- break;
- }
-
fbrowptr = ((uint8_t *)__vesa_info.mi.lfb_ptr) +
(row*height+VIDEO_BORDER) * __vesa_info.mi.logical_scan +
(col*width+VIDEO_BORDER) * bytes_per_pixel;
mi = &__vesa_info.mi;
mode = bestmode;
- __vesacon_bytes_per_pixel = mi->bpp >> 3;
+ __vesacon_bytes_per_pixel = (mi->bpp+7) >> 3;
/* Download the SYSLINUX- or BIOS-provided font */
rm.eax.w[0] = 0x0018; /* Query custom font */