summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorConrad Pankoff <deoxxa@fknsrs.biz>2019-08-18 12:25:22 +1000
committerAndreas Kling <awesomekling@gmail.com>2019-08-18 07:40:02 +0200
commit5e46122a821344e0c3377e5d7d7ea0ebd6bfd267 (patch)
tree6bb7e837f439e133f294198020f563337522c881 /Kernel
parent1868523e007fea21d74f282eef2e9252d84411d9 (diff)
downloadserenity-5e46122a821344e0c3377e5d7d7ea0ebd6bfd267.zip
Kernel: Add framebuffer ioctls; wrap raw ioctls with a C API
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/FB.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/Kernel/FB.h b/Kernel/FB.h
new file mode 100644
index 0000000000..66b234f842
--- /dev/null
+++ b/Kernel/FB.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <sys/cdefs.h>
+#include <sys/ioctl.h>
+
+__BEGIN_DECLS
+
+int fb_get_size_in_bytes(int fd, size_t* out)
+{
+ return ioctl(fd, FB_IOCTL_GET_SIZE_IN_BYTES, out);
+}
+
+int fb_get_resolution(int fd, FBResolution* info)
+{
+ return ioctl(fd, FB_IOCTL_GET_RESOLUTION, info);
+}
+
+int fb_set_resolution(int fd, FBResolution* info)
+{
+ return ioctl(fd, FB_IOCTL_SET_RESOLUTION, info);
+}
+
+int fb_get_buffer(int fd, int* index)
+{
+ return ioctl(fd, FB_IOCTL_GET_BUFFER, index);
+}
+
+int fb_set_buffer(int fd, int index)
+{
+ return ioctl(fd, FB_IOCTL_SET_BUFFER, index);
+}
+
+__END_DECLS