1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:57:42 +00:00

WindowServer: Use FB_IOCTL_FLUSH_HEAD to flush a framebuffer if possible

This ioctl is more appropriate when the hardware supports flushing of
the entire framebuffer, so we use that instead of the previous default
FB_IOCTL_FLUSH_HEAD_BUFFERS ioctl.
This commit is contained in:
Liav A 2022-04-30 13:55:00 +03:00 committed by Andreas Kling
parent 41283a2de6
commit 4ff6150f1b
8 changed files with 45 additions and 5 deletions

View file

@ -32,6 +32,7 @@ ErrorOr<void> HardwareScreenBackend::open()
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_entire_framebuffer = (properties.flushing_support != 0);
m_can_set_head_buffer = (properties.doublebuffer_support != 0);
return {};
}
@ -209,4 +210,13 @@ ErrorOr<void> HardwareScreenBackend::flush_framebuffer_rects(int buffer_index, S
return {};
}
ErrorOr<void> HardwareScreenBackend::flush_framebuffer()
{
int rc = fb_flush_head(m_framebuffer_fd);
if (rc == -ENOTSUP)
m_can_device_flush_entire_framebuffer = false;
else
return Error::from_syscall("fb_flush_head", rc);
return {};
}
}