summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-09-22 17:13:12 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2021-10-27 07:57:44 +0300
commit8554952690e469cc9481ea7bc8d81039a4db55a1 (patch)
tree4fe30bd4af508031d8e61c9a0efdaa9ea9e22219 /Userland/DevTools
parent78e724a899be13b54a08e24184283d2d18ec76bf (diff)
downloadserenity-8554952690e469cc9481ea7bc8d81039a4db55a1.zip
Kernel + WindowServer: Re-define the interface to framebuffer devices
We create a base class called GenericFramebufferDevice, which defines all the virtual functions that must be implemented by a FramebufferDevice. Then, we make the VirtIO FramebufferDevice and other FramebufferDevice implementations inherit from it. The most important consequence of rearranging the classes is that we now have one IOCTL method, so all drivers should be committed to not override the IOCTL method or make their own IOCTLs of FramebufferDevice. All graphical IOCTLs are known to all FramebufferDevices, and it's up to the specific implementation whether to support them or discard them (so we require extensive usage of KResult and KResultOr, together with virtual characteristic functions). As a result, the interface is much cleaner and understandable to read.
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
index 4fd60b2f2c..a3f65e10c0 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
@@ -1155,20 +1155,20 @@ int Emulator::virt$ioctl([[maybe_unused]] int fd, unsigned request, [[maybe_unus
if (request == TIOCNOTTY || request == TIOCSCTTY) {
return syscall(SC_ioctl, fd, request, 0);
}
- if (request == FB_IOCTL_GET_SIZE_IN_BYTES) {
+ if (request == FB_IOCTL_GET_PROPERTIES) {
size_t size = 0;
auto rc = syscall(SC_ioctl, fd, request, &size);
mmu().copy_to_vm(arg, &size, sizeof(size));
return rc;
}
- if (request == FB_IOCTL_SET_RESOLUTION) {
- FBResolution user_resolution;
+ if (request == FB_IOCTL_SET_HEAD_RESOLUTION) {
+ FBHeadResolution user_resolution;
mmu().copy_from_vm(&user_resolution, arg, sizeof(user_resolution));
auto rc = syscall(SC_ioctl, fd, request, &user_resolution);
mmu().copy_to_vm(arg, &user_resolution, sizeof(user_resolution));
return rc;
}
- if (request == FB_IOCTL_SET_BUFFER) {
+ if (request == FB_IOCTL_SET_HEAD_VERTICAL_OFFSET_BUFFER) {
return syscall(SC_ioctl, fd, request, arg);
}
reportln("Unsupported ioctl: {}", request);