Kernel/Graphics: Use boot console if the subsystem is disabled

This lets us actually to initialize VirtualConsoles later on.
This commit is contained in:
Liav A 2022-05-06 01:03:18 +03:00 committed by Linus Groh
parent 7ab51b6df2
commit a0a1ac0656
Notes: sideshowbarker 2024-07-17 11:15:08 +09:00

View file

@ -250,8 +250,16 @@ UNMAP_AFTER_INIT bool GraphicsManagement::initialize()
*/
auto graphics_subsystem_mode = kernel_command_line().graphics_subsystem_mode();
if (graphics_subsystem_mode == CommandLine::GraphicsSubsystemMode::Disabled)
if (graphics_subsystem_mode == CommandLine::GraphicsSubsystemMode::Disabled) {
VERIFY(!m_console);
// If no graphics driver was instantiated and we had a bootloader provided
// framebuffer console we can simply re-use it.
if (auto* boot_console = g_boot_console.load()) {
m_console = *boot_console;
boot_console->unref(); // Drop the leaked reference from Kernel::init()
}
return true;
}
if (graphics_subsystem_mode == CommandLine::GraphicsSubsystemMode::Limited && !multiboot_framebuffer_addr.is_null() && multiboot_framebuffer_type != MULTIBOOT_FRAMEBUFFER_TYPE_RGB) {
dmesgln("Graphics: Using a preset resolution from the bootloader, without knowing the PCI device");