mirror of
https://github.com/RGBCube/serenity
synced 2025-05-26 01:35:08 +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:
parent
50ed50752f
commit
d5b97eb41e
4 changed files with 5 additions and 0 deletions
|
@ -301,12 +301,14 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case GRAPHICS_IOCTL_GET_PROPERTIES: {
|
case GRAPHICS_IOCTL_GET_PROPERTIES: {
|
||||||
|
VERIFY(m_shared_framebuffer_vmobject);
|
||||||
auto user_properties = static_ptr_cast<GraphicsConnectorProperties*>(arg);
|
auto user_properties = static_ptr_cast<GraphicsConnectorProperties*>(arg);
|
||||||
GraphicsConnectorProperties properties {};
|
GraphicsConnectorProperties properties {};
|
||||||
properties.flushing_support = flush_support();
|
properties.flushing_support = flush_support();
|
||||||
properties.doublebuffer_support = double_framebuffering_capable();
|
properties.doublebuffer_support = double_framebuffering_capable();
|
||||||
properties.partial_flushing_support = partial_flush_support();
|
properties.partial_flushing_support = partial_flush_support();
|
||||||
properties.refresh_rate_support = refresh_rate_support();
|
properties.refresh_rate_support = refresh_rate_support();
|
||||||
|
properties.max_buffer_bytes = m_shared_framebuffer_vmobject->size();
|
||||||
|
|
||||||
return copy_to_user(user_properties, &properties);
|
return copy_to_user(user_properties, &properties);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ struct GraphicsConnectorProperties {
|
||||||
unsigned char flushing_support;
|
unsigned char flushing_support;
|
||||||
unsigned char partial_flushing_support;
|
unsigned char partial_flushing_support;
|
||||||
unsigned char refresh_rate_support;
|
unsigned char refresh_rate_support;
|
||||||
|
unsigned max_buffer_bytes;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GraphicsHeadModeSetting {
|
struct GraphicsHeadModeSetting {
|
||||||
|
|
|
@ -33,6 +33,7 @@ ErrorOr<void> HardwareScreenBackend::open()
|
||||||
m_can_device_flush_buffers = (properties.partial_flushing_support != 0);
|
m_can_device_flush_buffers = (properties.partial_flushing_support != 0);
|
||||||
m_can_device_flush_entire_framebuffer = (properties.flushing_support != 0);
|
m_can_device_flush_entire_framebuffer = (properties.flushing_support != 0);
|
||||||
m_can_set_head_buffer = (properties.doublebuffer_support != 0);
|
m_can_set_head_buffer = (properties.doublebuffer_support != 0);
|
||||||
|
m_max_size_in_bytes = properties.max_buffer_bytes;
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
|
|
||||||
Gfx::ARGB32* m_framebuffer { nullptr };
|
Gfx::ARGB32* m_framebuffer { nullptr };
|
||||||
size_t m_size_in_bytes { 0 };
|
size_t m_size_in_bytes { 0 };
|
||||||
|
size_t m_max_size_in_bytes { 0 };
|
||||||
size_t m_back_buffer_offset { 0 };
|
size_t m_back_buffer_offset { 0 };
|
||||||
|
|
||||||
int m_pitch { 0 };
|
int m_pitch { 0 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue