mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
Kernel: Simplify graphics initialization somewhat
We use a switch-case statements to ensure we try to find the best suitable driver for a specific graphics card. In case we don't find such, we use the default statement to initialize the graphics card as a generic VGA adapter, if the adapter is VGA compatible. If we couldn't initialize the driver, we don't touch this adapter anymore. Also, GraphicsDevice should not be tied to a PCI::Address member, as it can be theortically be used with other buses (e.g. ISA cards).
This commit is contained in:
parent
27fe2b45e5
commit
053a832fac
7 changed files with 94 additions and 84 deletions
|
@ -24,7 +24,6 @@ public:
|
|||
virtual ~GraphicsDevice() = default;
|
||||
virtual void initialize_framebuffer_devices() = 0;
|
||||
virtual Type type() const = 0;
|
||||
PCI::Address device_pci_address() const { return m_pci_address; }
|
||||
virtual void enable_consoles() = 0;
|
||||
virtual void disable_consoles() = 0;
|
||||
bool consoles_enabled() const { return m_consoles_enabled; }
|
||||
|
@ -37,12 +36,8 @@ public:
|
|||
virtual bool set_y_offset(size_t output_port_index, size_t y) = 0;
|
||||
|
||||
protected:
|
||||
GraphicsDevice(PCI::Address pci_address)
|
||||
: m_pci_address(pci_address)
|
||||
{
|
||||
}
|
||||
GraphicsDevice() = default;
|
||||
|
||||
const PCI::Address m_pci_address;
|
||||
bool m_consoles_enabled { false };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue