mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
Everywhere: Rename fb prefix function names => graphics_connector
This commit is contained in:
parent
10adc27eda
commit
aad968cc5e
4 changed files with 16 additions and 16 deletions
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
ALWAYS_INLINE int fb_get_properties(int fd, GraphicsConnectorProperties* info)
|
ALWAYS_INLINE int graphics_connector_get_properties(int fd, GraphicsConnectorProperties* info)
|
||||||
{
|
{
|
||||||
return ioctl(fd, GRAPHICS_IOCTL_GET_PROPERTIES, info);
|
return ioctl(fd, GRAPHICS_IOCTL_GET_PROPERTIES, info);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ ALWAYS_INLINE int fb_set_resolution(int fd, FBHeadResolution* info)
|
||||||
return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_RESOLUTION, info);
|
return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_RESOLUTION, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE int fb_get_head_edid(int fd, GraphicsHeadEDID* info)
|
ALWAYS_INLINE int graphics_connector_get_head_edid(int fd, GraphicsHeadEDID* info)
|
||||||
{
|
{
|
||||||
return ioctl(fd, GRAPHICS_IOCTL_GET_HEAD_EDID, info);
|
return ioctl(fd, GRAPHICS_IOCTL_GET_HEAD_EDID, info);
|
||||||
}
|
}
|
||||||
|
@ -59,17 +59,17 @@ ALWAYS_INLINE int fb_set_head_vertical_offset_buffer(int fd, GraphicsHeadVertica
|
||||||
return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_VERTICAL_OFFSET_BUFFER, vertical_offset);
|
return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_VERTICAL_OFFSET_BUFFER, vertical_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE int fb_set_head_mode_setting(int fd, GraphicsHeadModeSetting* mode_setting)
|
ALWAYS_INLINE int graphics_connector_set_head_mode_setting(int fd, GraphicsHeadModeSetting* mode_setting)
|
||||||
{
|
{
|
||||||
return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING, mode_setting);
|
return ioctl(fd, GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING, mode_setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE int fb_set_safe_head_mode_setting(int fd)
|
ALWAYS_INLINE int graphics_connector_set_safe_head_mode_setting(int fd)
|
||||||
{
|
{
|
||||||
return ioctl(fd, GRAPHICS_IOCTL_SET_SAFE_HEAD_MODE_SETTING, nullptr);
|
return ioctl(fd, GRAPHICS_IOCTL_SET_SAFE_HEAD_MODE_SETTING, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ALWAYS_INLINE int fb_get_head_mode_setting(int fd, GraphicsHeadModeSetting* mode_setting)
|
ALWAYS_INLINE int graphics_connector_get_head_mode_setting(int fd, GraphicsHeadModeSetting* mode_setting)
|
||||||
{
|
{
|
||||||
GraphicsHeadModeSetting head_mode_setting;
|
GraphicsHeadModeSetting head_mode_setting;
|
||||||
if (auto rc = ioctl(fd, GRAPHICS_IOCTL_GET_HEAD_MODE_SETTING, &head_mode_setting); rc < 0)
|
if (auto rc = ioctl(fd, GRAPHICS_IOCTL_GET_HEAD_MODE_SETTING, &head_mode_setting); rc < 0)
|
||||||
|
|
|
@ -208,13 +208,13 @@ ErrorOr<Parser> Parser::from_framebuffer_device(int framebuffer_fd, size_t head)
|
||||||
edid_info.head_index = head;
|
edid_info.head_index = head;
|
||||||
edid_info.bytes = &edid_bytes[0];
|
edid_info.bytes = &edid_bytes[0];
|
||||||
edid_info.bytes_size = sizeof(edid_bytes);
|
edid_info.bytes_size = sizeof(edid_bytes);
|
||||||
if (fb_get_head_edid(framebuffer_fd, &edid_info) < 0) {
|
if (graphics_connector_get_head_edid(framebuffer_fd, &edid_info) < 0) {
|
||||||
int err = errno;
|
int err = errno;
|
||||||
if (err == EOVERFLOW) {
|
if (err == EOVERFLOW) {
|
||||||
// We need a bigger buffer with at least bytes_size bytes
|
// We need a bigger buffer with at least bytes_size bytes
|
||||||
auto edid_byte_buffer = TRY(ByteBuffer::create_zeroed(edid_info.bytes_size));
|
auto edid_byte_buffer = TRY(ByteBuffer::create_zeroed(edid_info.bytes_size));
|
||||||
edid_info.bytes = edid_byte_buffer.data();
|
edid_info.bytes = edid_byte_buffer.data();
|
||||||
if (fb_get_head_edid(framebuffer_fd, &edid_info) < 0) {
|
if (graphics_connector_get_head_edid(framebuffer_fd, &edid_info) < 0) {
|
||||||
err = errno;
|
err = errno;
|
||||||
return Error::from_errno(err);
|
return Error::from_errno(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ ErrorOr<void> HardwareScreenBackend::open()
|
||||||
m_framebuffer_fd = TRY(Core::System::open(m_device.characters(), O_RDWR | O_CLOEXEC));
|
m_framebuffer_fd = TRY(Core::System::open(m_device.characters(), O_RDWR | O_CLOEXEC));
|
||||||
|
|
||||||
GraphicsConnectorProperties properties;
|
GraphicsConnectorProperties properties;
|
||||||
if (fb_get_properties(m_framebuffer_fd, &properties) < 0)
|
if (graphics_connector_get_properties(m_framebuffer_fd, &properties) < 0)
|
||||||
return Error::from_syscall(String::formatted("failed to ioctl {}", m_device), errno);
|
return Error::from_syscall(String::formatted("failed to ioctl {}", m_device), errno);
|
||||||
|
|
||||||
m_can_device_flush_buffers = (properties.partial_flushing_support != 0);
|
m_can_device_flush_buffers = (properties.partial_flushing_support != 0);
|
||||||
|
@ -66,13 +66,13 @@ ErrorOr<void> HardwareScreenBackend::set_head_resolution(FBHeadResolution resolu
|
||||||
mode_setting.horizontal_active = resolution.width;
|
mode_setting.horizontal_active = resolution.width;
|
||||||
mode_setting.vertical_active = resolution.height;
|
mode_setting.vertical_active = resolution.height;
|
||||||
mode_setting.horizontal_stride = resolution.pitch;
|
mode_setting.horizontal_stride = resolution.pitch;
|
||||||
auto rc = fb_set_head_mode_setting(m_framebuffer_fd, &mode_setting);
|
auto rc = graphics_connector_set_head_mode_setting(m_framebuffer_fd, &mode_setting);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
dbgln("Failed to set backend mode setting: falling back to safe resolution");
|
dbgln("Failed to set backend mode setting: falling back to safe resolution");
|
||||||
rc = fb_set_safe_head_mode_setting(m_framebuffer_fd);
|
rc = graphics_connector_set_safe_head_mode_setting(m_framebuffer_fd);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
dbgln("Failed to set backend safe mode setting: aborting");
|
dbgln("Failed to set backend safe mode setting: aborting");
|
||||||
return Error::from_syscall("fb_set_safe_head_mode_setting", rc);
|
return Error::from_syscall("graphics_connector_set_safe_head_mode_setting", rc);
|
||||||
}
|
}
|
||||||
dbgln("Failed to set backend mode setting: falling back to safe resolution - success.");
|
dbgln("Failed to set backend mode setting: falling back to safe resolution - success.");
|
||||||
}
|
}
|
||||||
|
@ -136,9 +136,9 @@ ErrorOr<void> HardwareScreenBackend::map_framebuffer()
|
||||||
} else {
|
} else {
|
||||||
GraphicsHeadModeSetting mode_setting {};
|
GraphicsHeadModeSetting mode_setting {};
|
||||||
memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting));
|
memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting));
|
||||||
int rc = fb_get_head_mode_setting(m_framebuffer_fd, &mode_setting);
|
int rc = graphics_connector_get_head_mode_setting(m_framebuffer_fd, &mode_setting);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
return Error::from_syscall("fb_get_head_mode_setting", rc);
|
return Error::from_syscall("graphics_connector_get_head_mode_setting", rc);
|
||||||
}
|
}
|
||||||
m_size_in_bytes = mode_setting.horizontal_stride * mode_setting.vertical_active * 2;
|
m_size_in_bytes = mode_setting.horizontal_stride * mode_setting.vertical_active * 2;
|
||||||
m_framebuffer = (Gfx::ARGB32*)malloc(m_size_in_bytes);
|
m_framebuffer = (Gfx::ARGB32*)malloc(m_size_in_bytes);
|
||||||
|
@ -170,9 +170,9 @@ ErrorOr<FBHeadProperties> HardwareScreenBackend::get_head_properties()
|
||||||
} else {
|
} else {
|
||||||
GraphicsHeadModeSetting mode_setting {};
|
GraphicsHeadModeSetting mode_setting {};
|
||||||
memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting));
|
memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting));
|
||||||
int rc = fb_get_head_mode_setting(m_framebuffer_fd, &mode_setting);
|
int rc = graphics_connector_get_head_mode_setting(m_framebuffer_fd, &mode_setting);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
return Error::from_syscall("fb_get_head_mode_setting", rc);
|
return Error::from_syscall("graphics_connector_get_head_mode_setting", rc);
|
||||||
}
|
}
|
||||||
m_pitch = mode_setting.horizontal_stride;
|
m_pitch = mode_setting.horizontal_stride;
|
||||||
// Note: We translate (for now, until Framebuffer devices are removed) the GraphicsHeadModeSetting
|
// Note: We translate (for now, until Framebuffer devices are removed) the GraphicsHeadModeSetting
|
||||||
|
|
|
@ -323,7 +323,7 @@ bool ScreenLayout::try_auto_add_display_connector(String const& device_path)
|
||||||
|
|
||||||
GraphicsHeadModeSetting mode_setting {};
|
GraphicsHeadModeSetting mode_setting {};
|
||||||
memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting));
|
memset(&mode_setting, 0, sizeof(GraphicsHeadModeSetting));
|
||||||
if (fb_get_head_mode_setting(display_connector_fd, &mode_setting) < 0) {
|
if (graphics_connector_get_head_mode_setting(display_connector_fd, &mode_setting) < 0) {
|
||||||
int err = errno;
|
int err = errno;
|
||||||
dbgln("Error ({}) querying resolution from display connector device {}", err, device_path);
|
dbgln("Error ({}) querying resolution from display connector device {}", err, device_path);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue