2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2019-08-18 05:25:22 +03:00
|
|
|
#pragma once
|
|
|
|
|
2020-08-11 00:59:06 +03:00
|
|
|
#include <AK/Platform.h>
|
|
|
|
#include <stddef.h>
|
2019-08-18 05:25:22 +03:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
2020-08-11 00:59:06 +03:00
|
|
|
ALWAYS_INLINE int fb_get_size_in_bytes(int fd, size_t* out)
|
2019-08-18 05:25:22 +03:00
|
|
|
{
|
|
|
|
return ioctl(fd, FB_IOCTL_GET_SIZE_IN_BYTES, out);
|
|
|
|
}
|
|
|
|
|
2020-08-11 00:59:06 +03:00
|
|
|
ALWAYS_INLINE int fb_get_resolution(int fd, FBResolution* info)
|
2019-08-18 05:25:22 +03:00
|
|
|
{
|
|
|
|
return ioctl(fd, FB_IOCTL_GET_RESOLUTION, info);
|
|
|
|
}
|
|
|
|
|
2020-08-11 00:59:06 +03:00
|
|
|
ALWAYS_INLINE int fb_set_resolution(int fd, FBResolution* info)
|
2019-08-18 05:25:22 +03:00
|
|
|
{
|
|
|
|
return ioctl(fd, FB_IOCTL_SET_RESOLUTION, info);
|
|
|
|
}
|
|
|
|
|
2020-08-11 00:59:06 +03:00
|
|
|
ALWAYS_INLINE int fb_get_buffer(int fd, int* index)
|
2019-08-18 05:25:22 +03:00
|
|
|
{
|
|
|
|
return ioctl(fd, FB_IOCTL_GET_BUFFER, index);
|
|
|
|
}
|
|
|
|
|
2020-08-11 00:59:06 +03:00
|
|
|
ALWAYS_INLINE int fb_set_buffer(int fd, int index)
|
2019-08-18 05:25:22 +03:00
|
|
|
{
|
|
|
|
return ioctl(fd, FB_IOCTL_SET_BUFFER, index);
|
|
|
|
}
|
|
|
|
|
2021-06-12 15:46:54 +03:00
|
|
|
ALWAYS_INLINE int fb_flush_buffer(int fd, FBRect* rect)
|
|
|
|
{
|
|
|
|
return ioctl(fd, FB_IOCTL_FLUSH_BUFFER, rect);
|
|
|
|
}
|
|
|
|
|
2019-08-18 05:25:22 +03:00
|
|
|
__END_DECLS
|