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.
This commit is contained in:
Liav A 2021-09-22 17:13:12 +03:00 committed by Idan Horowitz
commit 8554952690
Notes: sideshowbarker 2024-07-18 01:51:07 +09:00
19 changed files with 673 additions and 350 deletions

View file

@ -642,8 +642,9 @@ void IntelNativeGraphicsAdapter::initialize_framebuffer_devices()
VERIFY(m_framebuffer_pitch != 0);
VERIFY(m_framebuffer_height != 0);
VERIFY(m_framebuffer_width != 0);
m_framebuffer_device = FramebufferDevice::create(*this, 0, address, m_framebuffer_width, m_framebuffer_height, m_framebuffer_pitch);
m_framebuffer_device = FramebufferDevice::create(*this, address, m_framebuffer_width, m_framebuffer_height, m_framebuffer_pitch);
// FIXME: Would be nice to be able to return a KResult here.
VERIFY(!m_framebuffer_device->initialize().is_error());
auto framebuffer_result = m_framebuffer_device->try_to_initialize();
VERIFY(!framebuffer_result.is_error());
}
}