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

Kernel+Userland: Provide bytes count for a DisplayConnector framebuffer

This value will be used later on by WindowServer to reject resolutions
that will request a mapping that will overflow the hardware framebuffer
max length.
This commit is contained in:
Liav A 2022-09-24 16:55:46 +03:00 committed by Linus Groh
parent 50ed50752f
commit d5b97eb41e
4 changed files with 5 additions and 0 deletions

View file

@ -301,12 +301,14 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us
return {};
}
case GRAPHICS_IOCTL_GET_PROPERTIES: {
VERIFY(m_shared_framebuffer_vmobject);
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();
properties.refresh_rate_support = refresh_rate_support();
properties.max_buffer_bytes = m_shared_framebuffer_vmobject->size();
return copy_to_user(user_properties, &properties);
}