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

display drivers: the layer between the fbdev (/dev/fb0) and a card that can change its mode. More...

#include "common/stdint.h"
#include "kernel/memory/phys.h"

Go to the source code of this file.

Data Structures

struct  display_surface_t
 a framebuffer in a mode: 32 bits per pixel, x8r8g8b8. More...
struct  display_driver_t

Functions

void display_init (void)
 register /dev/display.
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 *driver)
 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_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).

Detailed Description

display drivers: the layer between the fbdev (/dev/fb0) and a card that can change its mode.

without a driver, the screen is the framebuffer the bootloader set up, in one mode. a driver (the Bochs/QEMU VGA, virtio-gpu) can set other sizes at run time, and can know the size the screen wants (the QEMU window). /dev/display tells programs when the mode or that size changes.

Function Documentation

◆ display_init()

void display_init ( void )

register /dev/display.

call once, before the drivers.

◆ 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_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.