diff options
author | Liav A <liavalb@gmail.com> | 2022-04-29 12:44:46 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-05-05 20:55:57 +0200 |
commit | 912b8ab9650a2019065192c4e4866d6dfbd7cf1e (patch) | |
tree | bed9803dd432915a678274857a271b897de3fff3 /Kernel/Graphics/GraphicsManagement.h | |
parent | ebf7225728e2c50a6f05c618114c32d7a69a0b64 (diff) | |
download | serenity-912b8ab9650a2019065192c4e4866d6dfbd7cf1e.zip |
Kernel/Graphics: Introduce the DisplayConnector class
The DisplayConnector class is meant to replace the FramebufferDevice
class. The advantage of this class over the FramebufferDevice class is:
1. It removes the mmap interface entirely. This interface is unsafe, as
multiple processes could try to use it, and when switching to and from
text console mode, there's no "good" way to revoke a memory mapping from
this interface, let alone when there are multiple processes that call
this interface. Therefore, in the DisplayConnector class there's no
implementation for this method at all.
2. The class uses a new real-world structure called ModeSetting, which
takes into account the fact that real hardware requires more than width,
height and pitch settings to mode-set the display resolution.
3. The class assumes all instances should supply some sort of EDID,
so it facilitates such mechanism to do so. Even if a given driver does
not know what is the actual EDID, it will ask to create default-generic
EDID blob.
3. This class shifts the responsibilies of switching between console
mode and graphical mode from a GraphicsAdapter to the DisplayConnector
class, so when doing the switch, the GraphicsManagement code actually
asks each DisplayConnector object to do the switch and doesn't rely on
the GraphicsAdapter objects at all.
Diffstat (limited to 'Kernel/Graphics/GraphicsManagement.h')
-rw-r--r-- | Kernel/Graphics/GraphicsManagement.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Kernel/Graphics/GraphicsManagement.h b/Kernel/Graphics/GraphicsManagement.h index 428ac52b0d..b730d4012a 100644 --- a/Kernel/Graphics/GraphicsManagement.h +++ b/Kernel/Graphics/GraphicsManagement.h @@ -12,6 +12,7 @@ #include <AK/Types.h> #include <Kernel/Bus/PCI/Definitions.h> #include <Kernel/Graphics/Console/Console.h> +#include <Kernel/Graphics/DisplayConnector.h> #include <Kernel/Graphics/GenericGraphicsAdapter.h> #include <Kernel/Graphics/VGACompatibleAdapter.h> #include <Kernel/Graphics/VirtIOGPU/GraphicsAdapter.h> @@ -29,6 +30,9 @@ public: unsigned allocate_minor_device_number() { return m_current_minor_number++; }; GraphicsManagement(); + void attach_new_display_connector(Badge<DisplayConnector>, DisplayConnector&); + void detach_display_connector(Badge<DisplayConnector>, DisplayConnector&); + bool framebuffer_devices_console_only() const; bool framebuffer_devices_use_bootloader_framebuffer() const; bool framebuffer_devices_exist() const; @@ -55,6 +59,8 @@ private: RefPtr<VGACompatibleAdapter> m_vga_adapter; unsigned m_current_minor_number { 0 }; + IntrusiveList<&DisplayConnector::m_list_node> m_display_connector_nodes; + RecursiveSpinlock m_main_vga_lock; bool m_vga_access_is_disabled { false }; }; |