mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 20:02:12 +00:00
Kernel/Graphics: Simplify the feature level of the Graphics subsystem
Instead of letting the user to determine whether framebuffer devices will be created (which is useless because they are gone by now), let's simplify the flow by allowing the user to choose between full, limited or disabled functionality. The determination happens only once, so, if the user decided to disable graphics support, the initialize method exits immediately. If limited functionality is chosen, then a generic DisplayConnector is initialized with the preset framebuffer resolution, if present, and then the initialize method exits. As a default, the code proceeds to initialize all drivers as usual.
This commit is contained in:
parent
e301af8352
commit
d49a35df31
5 changed files with 35 additions and 50 deletions
|
@ -282,14 +282,16 @@ PanicMode CommandLine::panic_mode(Validate should_validate) const
|
|||
return PanicMode::Halt;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT auto CommandLine::are_framebuffer_devices_enabled() const -> FrameBufferDevices
|
||||
UNMAP_AFTER_INIT CommandLine::GraphicsSubsystemMode CommandLine::graphics_subsystem_mode() const
|
||||
{
|
||||
auto const fbdev_value = lookup("fbdev"sv).value_or("on"sv);
|
||||
if (fbdev_value == "on"sv)
|
||||
return FrameBufferDevices::Enabled;
|
||||
if (fbdev_value == "bootloader"sv)
|
||||
return FrameBufferDevices::BootloaderOnly;
|
||||
return FrameBufferDevices::ConsoleOnly;
|
||||
auto const graphics_subsystem_mode_value = lookup("graphics_subsystem_mode"sv).value_or("on"sv);
|
||||
if (graphics_subsystem_mode_value == "on"sv)
|
||||
return GraphicsSubsystemMode::Enabled;
|
||||
if (graphics_subsystem_mode_value == "limited"sv)
|
||||
return GraphicsSubsystemMode::Limited;
|
||||
if (graphics_subsystem_mode_value == "off"sv)
|
||||
return GraphicsSubsystemMode::Disabled;
|
||||
PANIC("Invalid graphics_subsystem_mode value: {}", graphics_subsystem_mode_value);
|
||||
}
|
||||
|
||||
StringView CommandLine::userspace_init() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue