The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
fb.h File Reference

framebuffer device interface (userspace). More...

Go to the source code of this file.

Data Structures

struct  fb_bitfield_t
struct  fb_fix_screeninfo_t
struct  fb_var_screeninfo_t
struct  fb_mode_t
 FBIOGET_MODE: one video mode. More...
struct  fb_rect_t
 FBIO_FLUSH: arg is an fb_rect_t of pixels that changed. More...
struct  fb_cursor_t
struct  fb_point_t
struct  fb_event_t
 FBIOPUT_VSCREENINFO sets the mode to xres x yres at 32 bits per pixel when a display driver can (EINVAL if it cannot). More...

Macros

#define FB_TYPE_PACKED_PIXELS   0
#define FB_VISUAL_TRUECOLOR   2
#define FBIOGET_VSCREENINFO   0x4600
#define FBIOPUT_VSCREENINFO   0x4601
#define FBIOGET_FSCREENINFO   0x4602
#define FBIOGET_MODE   0x46F0
#define FBIO_GRAPHICS   0x46F1
 FBIO_GRAPHICS: int arg 1 takes the screen for this process, 0 gives it back.
#define FBIO_FLUSH   0x46F2
#define FB_CURSOR_SIZE   64
 FBIO_CURSOR: arg is an fb_cursor_t.
#define FBIO_CURSOR   0x46F3
#define FBIO_CURSOR_MOVE   0x46F4
#define FB_EVENT_MODE   1
#define FB_EVENT_PREFERRED   2

Functions

int fb_open (void)
 open the framebuffer device (/dev/fb0).

Detailed Description

framebuffer device interface (userspace).

the fbdev model: open "/dev/fb0", ioctl for geometry, mmap for pixels. the screeninfo structs and FBIO* codes are ABI and must match the kernel in src/common/fb/fb_ioctl.h exactly.

Macro Definition Documentation

◆ FB_TYPE_PACKED_PIXELS

#define FB_TYPE_PACKED_PIXELS   0

◆ FB_VISUAL_TRUECOLOR

#define FB_VISUAL_TRUECOLOR   2

◆ FBIOGET_VSCREENINFO

#define FBIOGET_VSCREENINFO   0x4600

◆ FBIOPUT_VSCREENINFO

#define FBIOPUT_VSCREENINFO   0x4601

◆ FBIOGET_FSCREENINFO

#define FBIOGET_FSCREENINFO   0x4602

◆ FBIOGET_MODE

#define FBIOGET_MODE   0x46F0

◆ FBIO_GRAPHICS

#define FBIO_GRAPHICS   0x46F1

FBIO_GRAPHICS: int arg 1 takes the screen for this process, 0 gives it back.

while a process has the screen, the text console does not draw on it (its text is kept, and comes back when the screen is given back). the screen comes back by itself when the process ends, and on a kernel panic. EBUSY if another live process has it.

◆ FBIO_FLUSH

#define FBIO_FLUSH   0x46F2

◆ FB_CURSOR_SIZE

#define FB_CURSOR_SIZE   64

FBIO_CURSOR: arg is an fb_cursor_t.

a display that has a pointer of its own (virtio-gpu) shows pixels over the screen, with their top left corner at x, y; shown 0 hides it. only the owner of the screen (FBIO_GRAPHICS) can use it, and the pointer goes when the owner gives the screen back or ends. ENOTTY when the display has no pointer: draw it in the picture then.

FBIO_CURSOR_MOVE: arg is an fb_point_t, the new top left corner.

◆ FBIO_CURSOR

#define FBIO_CURSOR   0x46F3

◆ FBIO_CURSOR_MOVE

#define FBIO_CURSOR_MOVE   0x46F4

◆ FB_EVENT_MODE

#define FB_EVENT_MODE   1

◆ FB_EVENT_PREFERRED

#define FB_EVENT_PREFERRED   2

Function Documentation

◆ fb_open()

int fb_open ( void )

open the framebuffer device (/dev/fb0).

Returns
an open fd on success, or -1 on error (errno set).