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

the display layer (see display.h) and /dev/display. More...

Macros

#define MAX_READERS   4
#define RING_EVENTS   8

Functions

void display_event (uint32_t type, uint32_t width, uint32_t height)
 tell the readers of /dev/display about a change.
void display_preferred_changed (void)
 the size the screen wants may have changed (a driver's interrupt calls it).
const display_driver_t * display_driver (void)
 the driver in use, or NULL (the bootloader's framebuffer only).
void display_attach (const display_driver_t *d)
 use a driver from now on, and set the size the screen wants if it knows one.
bool display_mode_at (uint32_t index, uint32_t *width, uint32_t *height, bool *preferred)
 a mode by index for FBIOGET_MODE: the preferred size first, then common sizes the driver can set.
void display_init (void)
 register /dev/display.

Detailed Description

the display layer (see display.h) and /dev/display.

each open of /dev/display is a reader with a small ring of fb_event_t. a driver's interrupt only marks that the size the screen wants may have changed; the driver is asked for it in process context (a read or a poll), as asking can wait for the device.

Macro Definition Documentation

◆ MAX_READERS

#define MAX_READERS   4

◆ RING_EVENTS

#define RING_EVENTS   8

Function Documentation

◆ display_event()

void display_event ( uint32_t type,
uint32_t width,
uint32_t height )

tell the readers of /dev/display about a change.

Parameters
typeFB_EVENT_MODE or FB_EVENT_PREFERRED.

◆ display_preferred_changed()

void display_preferred_changed ( void )

the size the screen wants may have changed (a driver's interrupt calls it).

the driver is asked again in process context, when /dev/display is read or polled.

◆ display_driver()

const display_driver_t * display_driver ( void )

the driver in use, or NULL (the bootloader's framebuffer only).

◆ display_attach()

void display_attach ( const display_driver_t * driver)

use a driver from now on, and set the size the screen wants if it knows one.

call after fb_init.

◆ display_mode_at()

bool display_mode_at ( uint32_t index,
uint32_t * width,
uint32_t * height,
bool * preferred )

a mode by index for FBIOGET_MODE: the preferred size first, then common sizes the driver can set.

Returns
false past the last one.

◆ display_init()

void display_init ( void )

register /dev/display.

call once, before the drivers.