diff --git a/src/os/bios/vbe.rs b/src/os/bios/vbe.rs index 78e0547128967ce8c85672e3f3f0c801dcbf7a1e..ca1e9425455e01164f374f970578ee4567e4e5a9 100644 --- a/src/os/bios/vbe.rs +++ b/src/os/bios/vbe.rs @@ -131,8 +131,8 @@ impl Iterator for VideoModeIter { let width = mode_info.xresolution as u32; let height = mode_info.yresolution as u32; - //TODO: support resolutions that are not perfect multiples of 4 - if width % 4 != 0 { + // We do not support framebuffers which have padding on each line + if width * 4 != mode_info.bytesperscanline as u32 { continue; } diff --git a/src/os/uefi/mod.rs b/src/os/uefi/mod.rs index 04c26b5c45c337d01a9dc1cd39ff3459a49fbdd4..87c3a67fc3e407e01cbcd7db19ba53fa06c212c0 100644 --- a/src/os/uefi/mod.rs +++ b/src/os/uefi/mod.rs @@ -112,7 +112,9 @@ impl Os< (output.0.SetMode)(output.0, mode.id) ).unwrap(); - // Update frame buffer base + // Update with actual mode information + mode.width = output.0.Mode.Info.HorizontalResolution; + mode.height = output.0.Mode.Info.VerticalResolution; mode.base = output.0.Mode.FrameBufferBase as u64; } diff --git a/src/os/uefi/video_mode.rs b/src/os/uefi/video_mode.rs index 38bb1bb9212293195004216b3baf2ae1d3c0f19a..d61410cddf3ea8fcb49887eb58db70ed7ba10378 100644 --- a/src/os/uefi/video_mode.rs +++ b/src/os/uefi/video_mode.rs @@ -43,8 +43,8 @@ impl Iterator for VideoModeIter { let width = mode.HorizontalResolution; let height = mode.VerticalResolution; - //TODO: support resolutions that are not perfect multiples of 4 - if width % 4 != 0 { + // We do not support framebuffers which have padding on each line + if width != mode.PixelsPerScanLine { continue; }