summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-04-29 12:44:46 +0300
committerAndreas Kling <kling@serenityos.org>2022-05-05 20:55:57 +0200
commit912b8ab9650a2019065192c4e4866d6dfbd7cf1e (patch)
treebed9803dd432915a678274857a271b897de3fff3 /Userland/Libraries/LibC
parentebf7225728e2c50a6f05c618114c32d7a69a0b64 (diff)
downloadserenity-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 'Userland/Libraries/LibC')
-rw-r--r--Userland/Libraries/LibC/sys/ioctl_numbers.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/sys/ioctl_numbers.h b/Userland/Libraries/LibC/sys/ioctl_numbers.h
index a1a314e378..95e8b74742 100644
--- a/Userland/Libraries/LibC/sys/ioctl_numbers.h
+++ b/Userland/Libraries/LibC/sys/ioctl_numbers.h
@@ -23,6 +23,7 @@ struct FBProperties {
unsigned char doublebuffer_support;
unsigned char flushing_support;
unsigned char partial_flushing_support;
+ unsigned char refresh_rate_support;
};
struct FBHeadProperties {
@@ -36,6 +37,21 @@ struct FBHeadProperties {
unsigned buffer_length;
};
+struct FBHeadModeSetting {
+ int horizontal_stride;
+ int pixel_clock_in_khz;
+ int horizontal_active;
+ int horizontal_front_porch_pixels;
+ int horizontal_sync_time_pixels;
+ int horizontal_blank_pixels;
+ int vertical_active;
+ int vertical_front_porch_lines;
+ int vertical_sync_time_lines;
+ int vertical_blank_lines;
+ int horizontal_offset;
+ int vertical_offset;
+};
+
struct FBHeadResolution {
int head_index;
int pitch;
@@ -103,6 +119,9 @@ enum IOCtlNumber {
FB_IOCTL_GET_HEAD_VERTICAL_OFFSET_BUFFER,
FB_IOCTL_FLUSH_HEAD_BUFFERS,
FB_IOCTL_FLUSH_HEAD,
+ FB_IOCTL_SET_HEAD_MODE_SETTING,
+ FB_IOCTL_GET_HEAD_MODE_SETTING,
+ FB_IOCTL_SET_SAFE_HEAD_MODE_SETTING,
KEYBOARD_IOCTL_GET_NUM_LOCK,
KEYBOARD_IOCTL_SET_NUM_LOCK,
KEYBOARD_IOCTL_GET_CAPS_LOCK,