mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
Kernel: Add ioctl to get the EDID from a framebuffer
This commit is contained in:
parent
8184870f93
commit
03c45b1865
20 changed files with 265 additions and 84 deletions
|
@ -276,4 +276,15 @@ void BochsGraphicsAdapter::disable_consoles()
|
|||
m_framebuffer_device->activate_writes();
|
||||
}
|
||||
|
||||
ErrorOr<ByteBuffer> BochsGraphicsAdapter::get_edid(size_t output_port_index) const
|
||||
{
|
||||
if (output_port_index != 0)
|
||||
return Error::from_errno(ENODEV);
|
||||
|
||||
auto bytes = ByteBuffer::copy(const_cast<u8 const*>(m_registers->edid_data), sizeof(m_registers->edid_data));
|
||||
if (!bytes.has_value())
|
||||
return Error::from_errno(ENOMEM);
|
||||
return bytes.release_value();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ public:
|
|||
|
||||
virtual bool vga_compatible() const override;
|
||||
|
||||
ErrorOr<ByteBuffer> get_edid(size_t output_port_index) const override;
|
||||
|
||||
private:
|
||||
// ^GenericGraphicsAdapter
|
||||
virtual bool try_to_set_resolution(size_t output_port_index, size_t width, size_t height) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue