mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 09:35:15 +00:00
Kernel: Much improved BochsVGA (BXVGA) support.
Instead of cowboy-calling the VESA BIOS in the bootloader, find the emulator VGA adapter by scanning the PCI bus. Then set up the desired video mode by sending device commands.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <WindowServer/WSMessageLoop.h>
|
||||
#include <WindowServer/WSWindow.h>
|
||||
#include <WindowServer/WSWindowManager.h>
|
||||
#include <Kernel/BochsVGADevice.h>
|
||||
|
||||
//#define LOG_GUI_SYSCALLS
|
||||
|
||||
@@ -271,3 +272,22 @@ void Process::destroy_all_windows()
|
||||
}
|
||||
m_windows.clear();
|
||||
}
|
||||
|
||||
|
||||
DisplayInfo Process::set_video_resolution(int width, int height)
|
||||
{
|
||||
DisplayInfo info;
|
||||
info.width = width;
|
||||
info.height = height;
|
||||
info.bpp = 32;
|
||||
info.pitch = width * 4;
|
||||
size_t framebuffer_size = width * height * 4;
|
||||
if (!m_display_framebuffer_region) {
|
||||
auto framebuffer_vmo = VMObject::create_framebuffer_wrapper(BochsVGADevice::the().framebuffer_address(), framebuffer_size);
|
||||
m_display_framebuffer_region = allocate_region_with_vmo(LinearAddress(0xe0000000), framebuffer_size, move(framebuffer_vmo), 0, "framebuffer", true, true);
|
||||
}
|
||||
info.framebuffer = m_display_framebuffer_region->laddr().as_ptr();
|
||||
|
||||
BochsVGADevice::the().set_resolution(width, height);
|
||||
return info;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user