mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-20 11:38:25 -06:00
Fix the remapping of the screen frame buffer.
The size of the region to be mapped is determined by the buffer stride, not the pixel width.
This commit is contained in:
parent
84a54ca083
commit
9f92ecf761
@ -195,11 +195,16 @@ void screen_init(void)
|
||||
|
||||
// Clip the framebuffer size to make sure we can map it into the 0.5GB device region.
|
||||
// This will produce a garbled display, but that's better than nothing.
|
||||
if (lfb_width > 8192) lfb_width = 8192;
|
||||
if (lfb_stride > 32768) {
|
||||
lfb_stride = 32768;
|
||||
if (lfb_width > (lfb_stride / lfb_bytes_per_pixel)) {
|
||||
lfb_width = (lfb_stride / lfb_bytes_per_pixel);
|
||||
}
|
||||
}
|
||||
if (lfb_height > 8192) lfb_height = 8192;
|
||||
|
||||
// The above clipping should guarantee the mapping never fails.
|
||||
lfb_base = map_region(lfb_base, lfb_height * lfb_width * lfb_bytes_per_pixel, false);
|
||||
lfb_base = map_region(lfb_base, lfb_height * lfb_stride, false);
|
||||
|
||||
// Blank the whole framebuffer.
|
||||
int pixels_per_word = sizeof(uint32_t) / lfb_bytes_per_pixel;
|
||||
|
Loading…
Reference in New Issue
Block a user