summaryrefslogtreecommitdiff
path: root/Kernel/Graphics
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2022-07-16 08:38:18 +0300
committerLinus Groh <mail@linusgroh.de>2022-07-19 11:02:37 +0100
commit412a5999d0683ecf1ca0bea9ee3c917fe56f3edb (patch)
treea7d5cb4f8db7a3399783a07a198cdcc242c7e3e9 /Kernel/Graphics
parentecf015e6ee3e1557f256bf02637ead2734e56191 (diff)
downloadserenity-412a5999d0683ecf1ca0bea9ee3c917fe56f3edb.zip
Kernel+Userland: Remove GRAPHICS_IOCTL_GET_HEAD_EDID ioctl
We are able to read the EDID from SysFS, therefore there's no need to provide this ioctl on a DisplayConnector anymore. Also, now we can simply require the video pledge to be set before doing any ioctl on a DisplayConnector.
Diffstat (limited to 'Kernel/Graphics')
-rw-r--r--Kernel/Graphics/DisplayConnector.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/Kernel/Graphics/DisplayConnector.cpp b/Kernel/Graphics/DisplayConnector.cpp
index 4f117b8490..87070248dc 100644
--- a/Kernel/Graphics/DisplayConnector.cpp
+++ b/Kernel/Graphics/DisplayConnector.cpp
@@ -233,11 +233,7 @@ ErrorOr<ByteBuffer> DisplayConnector::get_edid() const
ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg)
{
- if (request != GRAPHICS_IOCTL_GET_HEAD_EDID) {
- // Allow anyone to query the EDID. Eventually we'll publish the current EDID on /sys
- // so it doesn't really make sense to require the video pledge to query it.
- TRY(Process::current().require_promise(Pledge::video));
- }
+ TRY(Process::current().require_promise(Pledge::video));
// TODO: We really should have ioctls for destroying resources as well
switch (request) {
@@ -272,25 +268,6 @@ ErrorOr<void> DisplayConnector::ioctl(OpenFileDescription&, unsigned request, Us
}
return copy_to_user(user_head_mode_setting, &head_mode_setting);
}
- case GRAPHICS_IOCTL_GET_HEAD_EDID: {
- auto user_head_edid = static_ptr_cast<GraphicsHeadEDID*>(arg);
- GraphicsHeadEDID head_edid {};
- TRY(copy_from_user(&head_edid, user_head_edid));
-
- auto edid_bytes = TRY(get_edid());
- if (head_edid.bytes != nullptr) {
- // Only return the EDID if a buffer was provided. Either way,
- // we'll write back the bytes_size with the actual size
- if (head_edid.bytes_size < edid_bytes.size()) {
- head_edid.bytes_size = edid_bytes.size();
- TRY(copy_to_user(user_head_edid, &head_edid));
- return Error::from_errno(EOVERFLOW);
- }
- TRY(copy_to_user(head_edid.bytes, (void const*)edid_bytes.data(), edid_bytes.size()));
- }
- head_edid.bytes_size = edid_bytes.size();
- return copy_to_user(user_head_edid, &head_edid);
- }
case GRAPHICS_IOCTL_SET_HEAD_MODE_SETTING: {
auto user_mode_setting = static_ptr_cast<GraphicsHeadModeSetting const*>(arg);
auto head_mode_setting = TRY(copy_typed_from_user(user_mode_setting));