kernel+libc: Add framebuffer ioctls
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
841fc25137
commit
4f6e020196
@ -1,5 +1,6 @@
|
|||||||
#include "fs/devices/FramebufferDevice.h"
|
#include "fs/devices/FramebufferDevice.h"
|
||||||
#include "video/Framebuffer.h"
|
#include "video/Framebuffer.h"
|
||||||
|
#include <bits/ioctl-defs.h>
|
||||||
#include <luna/CString.h>
|
#include <luna/CString.h>
|
||||||
|
|
||||||
Result<SharedPtr<Device>> FramebufferDevice::create()
|
Result<SharedPtr<Device>> FramebufferDevice::create()
|
||||||
@ -31,7 +32,13 @@ bool FramebufferDevice::blocking() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<u64> FramebufferDevice::ioctl(int, void*)
|
Result<u64> FramebufferDevice::ioctl(int request, void*)
|
||||||
{
|
{
|
||||||
return err(EINVAL);
|
switch (request)
|
||||||
|
{
|
||||||
|
case FB_GET_WIDTH: return (u64)Framebuffer::width();
|
||||||
|
case FB_GET_HEIGHT: return (u64)Framebuffer::height();
|
||||||
|
case FB_GET_SCANLINE: return (u64)Framebuffer::scanline();
|
||||||
|
default: return err(EINVAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
11
libc/include/bits/ioctl-defs.h
Normal file
11
libc/include/bits/ioctl-defs.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/* bits/ioctl-defs.h: IO device control requests. */
|
||||||
|
|
||||||
|
#ifndef _BITS_IOCTL_DEFS_H
|
||||||
|
#define _BITS_IOCTL_DEFS_H
|
||||||
|
|
||||||
|
/* Framebuffer requests. */
|
||||||
|
#define FB_GET_WIDTH 0
|
||||||
|
#define FB_GET_HEIGHT 1
|
||||||
|
#define FB_GET_SCANLINE 2
|
||||||
|
|
||||||
|
#endif
|
@ -3,6 +3,8 @@
|
|||||||
#ifndef _SYS_IOCTL_H
|
#ifndef _SYS_IOCTL_H
|
||||||
#define _SYS_IOCTL_H
|
#define _SYS_IOCTL_H
|
||||||
|
|
||||||
|
#include <bits/ioctl-defs.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user