diff options
-rw-r--r-- | Kernel/API/FB.h | 14 | ||||
-rw-r--r-- | Kernel/Graphics/DisplayConnector.cpp | 20 | ||||
-rw-r--r-- | Kernel/Graphics/GenericFramebufferDevice.cpp | 14 | ||||
-rw-r--r-- | Userland/Libraries/LibC/sys/ioctl_numbers.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibEDID/EDID.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/WindowServer/HardwareScreenBackend.cpp | 18 | ||||
-rw-r--r-- | Userland/Services/WindowServer/ScreenLayout.ipp | 4 |
7 files changed, 40 insertions, 40 deletions
diff --git a/Kernel/API/FB.h b/Kernel/API/FB.h index 9d2798bc31..6027d904a8 100644 --- a/Kernel/API/FB.h +++ b/Kernel/API/FB.h @@ -13,7 +13,7 @@ __BEGIN_DECLS -ALWAYS_INLINE int fb_get_properties(int fd, FBProperties* info) +ALWAYS_INLINE int fb_get_properties(int fd, GraphicsConnectorProperties* info) { return ioctl(fd, GRAPHICS_IOCTL_GET_PROPERTIES, info); } @@ -44,22 +44,22 @@ ALWAYS_INLINE int fb_set_resolution(int fd, FBHeadResolution* info) return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_RESOLUTION, info); } -ALWAYS_INLINE int fb_get_head_edid(int fd, FBHeadEDID* info) +ALWAYS_INLINE int fb_get_head_edid(int fd, GraphicsHeadEDID* info) { return ioctl(fd, GRAPHICS_IOCTL_GET_HEAD_EDID, info); } -ALWAYS_INLINE int fb_get_head_vertical_offset_buffer(int fd, FBHeadVerticalOffset* vertical_offset) +ALWAYS_INLINE int fb_get_head_vertical_offset_buffer(int fd, GraphicsHeadVerticalOffset* vertical_offset) { return ioctl(fd, GRAPHICS_IOCTL_GET_HEAD_VERTICAL_OFFSET_BUFFER, vertical_offset); } -ALWAYS_INLINE int fb_set_head_vertical_offset_buffer(int fd, FBHeadVerticalOffset* vertical_offset) +ALWAYS_INLINE int fb_set_head_vertical_offset_buffer(int fd, GraphicsHeadVerticalOffset* vertical_offset) { return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_VERTICAL_OFFSET_BUFFER, vertical_offset); } -ALWAYS_INLINE int fb_set_head_mode_setting(int fd, FBHeadModeSetting* mode_setting) +ALWAYS_INLINE int fb_set_head_mode_setting(int fd, GraphicsHeadModeSetting* mode_setting) { return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING, mode_setting); } @@ -69,9 +69,9 @@ ALWAYS_INLINE int fb_set_safe_head_mode_setting(int fd) return ioctl(fd, GRAPHICS_IOCTL_SET_SAFE_HEAD_MODE_SETTING, nullptr); } -ALWAYS_INLINE int fb_get_head_mode_setting(int fd, FBHeadModeSetting* mode_setting) +ALWAYS_INLINE int fb_get_head_mode_setting(int fd, GraphicsHeadModeSetting* mode_setting) { - FBHeadModeSetting head_mode_setting; + GraphicsHeadModeSetting head_mode_setting; if (auto rc = ioctl(fd, GRAPHICS_IOCTL_GET_HEAD_MODE_SETTING, &head_mode_setting); rc < 0) return rc; mode_setting->horizontal_stride = head_mode_setting.horizontal_stride; diff --git a/Kernel/Graphics/DisplayConnector.cpp b/Kernel/Graphics/DisplayConnector.cpp index 9eb4fdca5f..939b563d59 100644 --- a/Kernel/Graphics/DisplayConnector.cpp +++ b/Kernel/Graphics/DisplayConnector.cpp @@ -158,8 +158,8 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us // TODO: We really should have ioctls for destroying resources as well switch (request) { case GRAPHICS_IOCTL_GET_PROPERTIES: { - auto user_properties = static_ptr_cast<FBProperties*>(arg); - FBProperties properties {}; + auto user_properties = static_ptr_cast<GraphicsConnectorProperties*>(arg); + GraphicsConnectorProperties properties {}; properties.flushing_support = flush_support(); properties.doublebuffer_support = double_framebuffering_capable(); properties.partial_flushing_support = partial_flush_support(); @@ -168,8 +168,8 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us return copy_to_user(user_properties, &properties); } case GRAPHICS_IOCTL_GET_HEAD_MODE_SETTING: { - auto user_head_mode_setting = static_ptr_cast<FBHeadModeSetting*>(arg); - FBHeadModeSetting head_mode_setting {}; + auto user_head_mode_setting = static_ptr_cast<GraphicsHeadModeSetting*>(arg); + GraphicsHeadModeSetting head_mode_setting {}; TRY(copy_from_user(&head_mode_setting, user_head_mode_setting)); { SpinlockLocker control_locker(m_control_lock); @@ -189,8 +189,8 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us return copy_to_user(user_head_mode_setting, &head_mode_setting); } case GRAPHICS_IOCTL_GET_HEAD_EDID: { - auto user_head_edid = static_ptr_cast<FBHeadEDID*>(arg); - FBHeadEDID head_edid {}; + auto user_head_edid = static_ptr_cast<GraphicsHeadEDID*>(arg); + GraphicsHeadEDID head_edid {}; TRY(copy_from_user(&head_edid, user_head_edid)); auto edid_bytes = TRY(get_edid()); @@ -208,7 +208,7 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us return copy_to_user(user_head_edid, &head_edid); } case GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING: { - auto user_mode_setting = static_ptr_cast<FBHeadModeSetting const*>(arg); + auto user_mode_setting = static_ptr_cast<GraphicsHeadModeSetting const*>(arg); auto head_mode_setting = TRY(copy_typed_from_user(user_mode_setting)); if (head_mode_setting.horizontal_stride < 0) @@ -270,7 +270,7 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us return {}; } - auto user_head_vertical_buffer_offset = static_ptr_cast<FBHeadVerticalOffset const*>(arg); + auto user_head_vertical_buffer_offset = static_ptr_cast<GraphicsHeadVerticalOffset const*>(arg); auto head_vertical_buffer_offset = TRY(copy_typed_from_user(user_head_vertical_buffer_offset)); SpinlockLocker locker(m_modeset_lock); @@ -285,8 +285,8 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us return {}; } case GRAPHICS_IOCTL_GET_HEAD_VERTICAL_OFFSET_BUFFER: { - auto user_head_vertical_buffer_offset = static_ptr_cast<FBHeadVerticalOffset*>(arg); - FBHeadVerticalOffset head_vertical_buffer_offset {}; + auto user_head_vertical_buffer_offset = static_ptr_cast<GraphicsHeadVerticalOffset*>(arg); + GraphicsHeadVerticalOffset head_vertical_buffer_offset {}; TRY(copy_from_user(&head_vertical_buffer_offset, user_head_vertical_buffer_offset)); head_vertical_buffer_offset.offsetted = m_vertical_offsetted; diff --git a/Kernel/Graphics/GenericFramebufferDevice.cpp b/Kernel/Graphics/GenericFramebufferDevice.cpp index 645466bdf0..73b0aa0ee1 100644 --- a/Kernel/Graphics/GenericFramebufferDevice.cpp +++ b/Kernel/Graphics/GenericFramebufferDevice.cpp @@ -40,8 +40,8 @@ ErrorOr<void> GenericFramebufferDevice::ioctl(OpenFileDescription&, unsigned req } switch (request) { case GRAPHICS_IOCTL_GET_PROPERTIES: { - auto user_properties = static_ptr_cast<FBProperties*>(arg); - FBProperties properties {}; + auto user_properties = static_ptr_cast<GraphicsConnectorProperties*>(arg); + GraphicsConnectorProperties properties {}; auto adapter = m_graphics_adapter.strong_ref(); if (!adapter) return Error::from_errno(EIO); @@ -65,8 +65,8 @@ ErrorOr<void> GenericFramebufferDevice::ioctl(OpenFileDescription&, unsigned req return copy_to_user(user_head_properties, &head_properties); } case GRAPHICS_IOCTL_GET_HEAD_EDID: { - auto user_head_edid = static_ptr_cast<FBHeadEDID*>(arg); - FBHeadEDID head_edid {}; + auto user_head_edid = static_ptr_cast<GraphicsHeadEDID*>(arg); + GraphicsHeadEDID head_edid {}; TRY(copy_from_user(&head_edid, user_head_edid)); TRY(verify_head_index(head_edid.head_index)); @@ -99,7 +99,7 @@ ErrorOr<void> GenericFramebufferDevice::ioctl(OpenFileDescription&, unsigned req return {}; } case GRAPHICS_IOCTL_SET_HEAD_VERTICAL_OFFSET_BUFFER: { - auto user_head_vertical_buffer_offset = static_ptr_cast<FBHeadVerticalOffset const*>(arg); + auto user_head_vertical_buffer_offset = static_ptr_cast<GraphicsHeadVerticalOffset const*>(arg); auto head_vertical_buffer_offset = TRY(copy_typed_from_user(user_head_vertical_buffer_offset)); TRY(verify_head_index(head_vertical_buffer_offset.head_index)); @@ -109,8 +109,8 @@ ErrorOr<void> GenericFramebufferDevice::ioctl(OpenFileDescription&, unsigned req return {}; } case GRAPHICS_IOCTL_GET_HEAD_VERTICAL_OFFSET_BUFFER: { - auto user_head_vertical_buffer_offset = static_ptr_cast<FBHeadVerticalOffset*>(arg); - FBHeadVerticalOffset head_vertical_buffer_offset {}; + auto user_head_vertical_buffer_offset = static_ptr_cast<GraphicsHeadVerticalOffset*>(arg); + GraphicsHeadVerticalOffset head_vertical_buffer_offset {}; TRY(copy_from_user(&head_vertical_buffer_offset, user_head_vertical_buffer_offset)); TRY(verify_head_index(head_vertical_buffer_offset.head_index)); diff --git a/Userland/Libraries/LibC/sys/ioctl_numbers.h b/Userland/Libraries/LibC/sys/ioctl_numbers.h index 7ca34756b8..294576590e 100644 --- a/Userland/Libraries/LibC/sys/ioctl_numbers.h +++ b/Userland/Libraries/LibC/sys/ioctl_numbers.h @@ -18,7 +18,7 @@ struct winsize { unsigned short ws_ypixel; }; -struct FBProperties { +struct GraphicsConnectorProperties { unsigned char multihead_support; unsigned char doublebuffer_support; unsigned char flushing_support; @@ -38,7 +38,7 @@ struct FBHeadProperties { unsigned buffer_length; }; -struct FBHeadModeSetting { +struct GraphicsHeadModeSetting { int horizontal_stride; int pixel_clock_in_khz; int horizontal_active; @@ -61,14 +61,14 @@ struct FBHeadResolution { int height; }; -struct FBHeadEDID { +struct GraphicsHeadEDID { int head_index; unsigned char* bytes; unsigned bytes_size; }; -struct FBHeadVerticalOffset { +struct GraphicsHeadVerticalOffset { int head_index; int offsetted; }; diff --git a/Userland/Libraries/LibEDID/EDID.cpp b/Userland/Libraries/LibEDID/EDID.cpp index d1f8f3b5a0..19fca38dd0 100644 --- a/Userland/Libraries/LibEDID/EDID.cpp +++ b/Userland/Libraries/LibEDID/EDID.cpp @@ -204,7 +204,7 @@ ErrorOr<Parser> Parser::from_bytes(ByteBuffer&& bytes) ErrorOr<Parser> Parser::from_framebuffer_device(int framebuffer_fd, size_t head) { RawBytes edid_bytes; - FBHeadEDID edid_info {}; + GraphicsHeadEDID edid_info {}; edid_info.head_index = head; edid_info.bytes = &edid_bytes[0]; edid_info.bytes_size = sizeof(edid_bytes); diff --git a/Userland/Services/WindowServer/HardwareScreenBackend.cpp b/Userland/Services/WindowServer/HardwareScreenBackend.cpp index 4784658ccb..ac2b736a34 100644 --- a/Userland/Services/WindowServer/HardwareScreenBackend.cpp +++ b/Userland/Services/WindowServer/HardwareScreenBackend.cpp @@ -27,7 +27,7 @@ ErrorOr<void> HardwareScreenBackend::open() { m_framebuffer_fd = TRY(Core::System::open(m_device.characters(), O_RDWR | O_CLOEXEC)); - FBProperties properties; + GraphicsConnectorProperties properties; if (fb_get_properties(m_framebuffer_fd, &properties) < 0) return Error::from_syscall(String::formatted("failed to ioctl {}", m_device), errno); @@ -61,8 +61,8 @@ ErrorOr<void> HardwareScreenBackend::set_head_resolution(FBHeadResolution resolu if (rc != 0) return Error::from_syscall("fb_set_resolution", rc); } else { - FBHeadModeSetting mode_setting; - memset(&mode_setting, 0, sizeof(FBHeadModeSetting)); + GraphicsHeadModeSetting mode_setting; + memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting)); mode_setting.horizontal_active = resolution.width; mode_setting.vertical_active = resolution.height; mode_setting.horizontal_stride = resolution.pitch; @@ -134,8 +134,8 @@ ErrorOr<void> HardwareScreenBackend::map_framebuffer() m_back_buffer_offset = 0; } } else { - FBHeadModeSetting mode_setting {}; - memset(&mode_setting, 0, sizeof(FBHeadModeSetting)); + GraphicsHeadModeSetting mode_setting {}; + memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting)); int rc = fb_get_head_mode_setting(m_framebuffer_fd, &mode_setting); if (rc != 0) { return Error::from_syscall("fb_get_head_mode_setting", rc); @@ -168,14 +168,14 @@ ErrorOr<FBHeadProperties> HardwareScreenBackend::get_head_properties() m_pitch = static_cast<int>(properties.pitch); return properties; } else { - FBHeadModeSetting mode_setting {}; - memset(&mode_setting, 0, sizeof(FBHeadModeSetting)); + GraphicsHeadModeSetting mode_setting {}; + memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting)); int rc = fb_get_head_mode_setting(m_framebuffer_fd, &mode_setting); if (rc != 0) { return Error::from_syscall("fb_get_head_mode_setting", rc); } m_pitch = mode_setting.horizontal_stride; - // Note: We translate (for now, until Framebuffer devices are removed) the FBHeadModeSetting + // Note: We translate (for now, until Framebuffer devices are removed) the GraphicsHeadModeSetting // structure to FBHeadProperties. FBHeadProperties properties; properties.head_index = 0; @@ -193,7 +193,7 @@ void HardwareScreenBackend::set_head_buffer(int head_index) { VERIFY(m_can_set_head_buffer); VERIFY(head_index <= 1 && head_index >= 0); - FBHeadVerticalOffset offset { 0, 0 }; + GraphicsHeadVerticalOffset offset { 0, 0 }; if (head_index == 1) offset.offsetted = 1; int rc = fb_set_head_vertical_offset_buffer(m_framebuffer_fd, &offset); diff --git a/Userland/Services/WindowServer/ScreenLayout.ipp b/Userland/Services/WindowServer/ScreenLayout.ipp index f52a4096f2..0b665d7d49 100644 --- a/Userland/Services/WindowServer/ScreenLayout.ipp +++ b/Userland/Services/WindowServer/ScreenLayout.ipp @@ -321,8 +321,8 @@ bool ScreenLayout::try_auto_add_display_connector(String const& device_path) close(display_connector_fd); }); - FBHeadModeSetting mode_setting {}; - memset(&mode_setting, 0, sizeof(FBHeadModeSetting)); + GraphicsHeadModeSetting mode_setting {}; + memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting)); if (fb_get_head_mode_setting(display_connector_fd, &mode_setting) < 0) { int err = errno; dbgln("Error ({}) querying resolution from display connector device {}", err, device_path); |