mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
Kernel/Graphics: Remove unnecessary derived FramebufferDevice classes
It seems like overly-specific classes were written for no good reason. Instead of making each adapter to have its own unique FramebufferDevice class, let's generalize everything to keep implementation more consistent.
This commit is contained in:
parent
b8fd845885
commit
c1a4dfeffb
17 changed files with 127 additions and 246 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Graphics/Console/FramebufferConsole.h>
|
||||
#include <Kernel/Graphics/FramebufferDevice.h>
|
||||
#include <Kernel/Graphics/GraphicsDevice.h>
|
||||
#include <Kernel/PCI/DeviceController.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
|
@ -28,8 +29,14 @@ public:
|
|||
virtual ~BochsGraphicsAdapter() = default;
|
||||
virtual bool framebuffer_devices_initialized() const override { return !m_framebuffer_device.is_null(); }
|
||||
|
||||
virtual bool modesetting_capable() const override { return true; }
|
||||
virtual bool double_framebuffering_capable() const override { return true; }
|
||||
|
||||
private:
|
||||
// ^GraphicsDevice
|
||||
virtual bool try_to_set_resolution(size_t output_port_index, size_t width, size_t height) override;
|
||||
virtual bool set_y_offset(size_t output_port_index, size_t y) override;
|
||||
|
||||
virtual void initialize_framebuffer_devices() override;
|
||||
virtual Type type() const override;
|
||||
|
||||
|
@ -42,13 +49,11 @@ private:
|
|||
|
||||
bool validate_setup_resolution(size_t width, size_t height);
|
||||
u32 find_framebuffer_address();
|
||||
bool try_to_set_resolution(size_t width, size_t height);
|
||||
bool set_resolution(size_t width, size_t height);
|
||||
void set_resolution_registers(size_t width, size_t height);
|
||||
void set_y_offset(size_t);
|
||||
|
||||
PhysicalAddress m_mmio_registers;
|
||||
RefPtr<BochsFramebufferDevice> m_framebuffer_device;
|
||||
RefPtr<FramebufferDevice> m_framebuffer_device;
|
||||
RefPtr<Graphics::FramebufferConsole> m_framebuffer_console;
|
||||
SpinLock<u8> m_console_mode_switch_lock;
|
||||
bool m_console_enabled { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue