PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
Framebuffer Abstraction

Framebuffer abstraction. More...

Collaboration diagram for Framebuffer Abstraction:

Detailed Description

Framebuffer abstraction.

Framebuffer devices are exposed as a /dev/fb/[id]/ directory, containing the below files.

name

A read-only file that contains the driver defined name of the framebuffer device.

info

A read-only file that contains information about the framebuffer in the format

static char format[MAX_NAME]
Definition screen.c:17
static uint64_t height
Definition screen.c:14
static uint64_t pitch
Definition screen.c:15
static uint64_t width
Definition screen.c:13

where width and height are the integer dimensions of the framebuffer in pixels, pitch is the integer number of bytes per row, and format is the pixel format presented as a series of letter number pairs in little-endian order (starting from the lowest memory address).

For example, 1920 1080 7680 B8G8R8A8 represents a 1920x1080 framebuffer with a pitch of 7680 bytes in 32-bit ARGB format.

data

A readable, writable and mappable file that represents the actual framebuffer memory. Writing to this file updates the pixels on the screen and reading from it retrieves the current pixel data.

Data Structures

struct  fb_info_t
 Framebuffer information. More...
 
struct  fb_ops_t
 Framebuffer operations. More...
 
struct  fb_t
 Framebuffer structure. More...
 

Functions

fb_tfb_new (const char *name, const fb_ops_t *ops, void *data)
 Allocate and initialize a new framebuffer.
 
void fb_free (fb_t *fb)
 Frees a framebuffer.
 

Function Documentation

◆ fb_new()

fb_t * fb_new ( const char *  name,
const fb_ops_t ops,
void *  data 
)

Allocate and initialize a new framebuffer.

Parameters
nameThe driver specified name of the framebuffer.
opsThe operations for the framebuffer.
privatePrivate data for the framebuffer.
Returns
On success, the new framebuffer. On failure, NULL and errno is set.

Definition at line 134 of file fb.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_free()

void fb_free ( fb_t fb)

Frees a framebuffer.

Parameters
fbThe framebuffer to free.

Definition at line 214 of file fb.c.

Here is the call graph for this function: