diff options
author | Liav A <liavalb@gmail.com> | 2021-09-22 17:13:12 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-27 07:57:44 +0300 |
commit | 8554952690e469cc9481ea7bc8d81039a4db55a1 (patch) | |
tree | 4fe30bd4af508031d8e61c9a0efdaa9ea9e22219 /Kernel/Graphics/Bochs | |
parent | 78e724a899be13b54a08e24184283d2d18ec76bf (diff) | |
download | serenity-8554952690e469cc9481ea7bc8d81039a4db55a1.zip |
Kernel + WindowServer: Re-define the interface to framebuffer devices
We create a base class called GenericFramebufferDevice, which defines
all the virtual functions that must be implemented by a
FramebufferDevice. Then, we make the VirtIO FramebufferDevice and other
FramebufferDevice implementations inherit from it.
The most important consequence of rearranging the classes is that we now
have one IOCTL method, so all drivers should be committed to not
override the IOCTL method or make their own IOCTLs of FramebufferDevice.
All graphical IOCTLs are known to all FramebufferDevices, and it's up to
the specific implementation whether to support them or discard them (so
we require extensive usage of KResult and KResultOr, together with
virtual characteristic functions).
As a result, the interface is much cleaner and understandable to read.
Diffstat (limited to 'Kernel/Graphics/Bochs')
-rw-r--r-- | Kernel/Graphics/Bochs/GraphicsAdapter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Graphics/Bochs/GraphicsAdapter.cpp b/Kernel/Graphics/Bochs/GraphicsAdapter.cpp index 479be5ba1d..5bca91d48f 100644 --- a/Kernel/Graphics/Bochs/GraphicsAdapter.cpp +++ b/Kernel/Graphics/Bochs/GraphicsAdapter.cpp @@ -127,9 +127,9 @@ UNMAP_AFTER_INIT BochsGraphicsAdapter::BochsGraphicsAdapter(PCI::DeviceIdentifie UNMAP_AFTER_INIT void BochsGraphicsAdapter::initialize_framebuffer_devices() { // FIXME: Find a better way to determine default resolution... - m_framebuffer_device = FramebufferDevice::create(*this, 0, PhysicalAddress(PCI::get_BAR0(pci_address()) & 0xfffffff0), 1024, 768, 1024 * sizeof(u32)); + m_framebuffer_device = FramebufferDevice::create(*this, PhysicalAddress(PCI::get_BAR0(pci_address()) & 0xfffffff0), 1024, 768, 1024 * sizeof(u32)); // FIXME: Would be nice to be able to return a KResult here. - VERIFY(!m_framebuffer_device->initialize().is_error()); + VERIFY(!m_framebuffer_device->try_to_initialize().is_error()); } bool BochsGraphicsAdapter::vga_compatible() const |