Chapter 27. Frame Buffer Library

Table of Contents

Frame Buffer Memory
register_framebuffer — registers a frame buffer device
unregister_framebuffer — releases a frame buffer device
fb_set_suspend — low level driver signals suspend
fb_get_options — get kernel boot parameters
Frame Buffer Colormap
fb_alloc_cmap — allocate a colormap
fb_dealloc_cmap — deallocate a colormap
fb_copy_cmap — copy a colormap
fb_set_cmap — set the colormap
fb_default_cmap — get default colormap
fb_invert_cmaps — invert all defaults colormaps
Frame Buffer Video Mode Database
fb_try_mode — test a video mode
fb_delete_videomode
fb_destroy_modelist
fb_find_mode — finds a valid video mode
fb_var_to_videomode — convert fb_var_screeninfo to fb_videomode
fb_videomode_to_var — convert fb_videomode to fb_var_screeninfo
fb_mode_is_equal — compare 2 videomodes
fb_find_best_mode — find best matching videomode
fb_find_nearest_mode — find closest videomode
fb_match_mode — find a videomode which exactly matches the timings in var
fb_add_videomode
fb_videomode_to_modelist
Frame Buffer Macintosh Video Mode Database
mac_vmode_to_var — converts vmode/cmode pair to var structure
mac_map_monitor_sense — Convert monitor sense to vmode
mac_find_mode — find a video mode
Frame Buffer Fonts

The frame buffer drivers depend heavily on four data structures. These structures are declared in include/linux/fb.h. They are fb_info, fb_var_screeninfo, fb_fix_screeninfo and fb_monospecs. The last three can be made available to and from userland.

fb_info defines the current state of a particular video card. Inside fb_info, there exists a fb_ops structure which is a collection of needed functions to make fbdev and fbcon work. fb_info is only visible to the kernel.

fb_var_screeninfo is used to describe the features of a video card that are user defined. With fb_var_screeninfo, things such as depth and the resolution may be defined.

The next structure is fb_fix_screeninfo. This defines the properties of a card that are created when a mode is set and can't be changed otherwise. A good example of this is the start of the frame buffer memory. This "locks" the address of the frame buffer memory, so that it cannot be changed or moved.

The last structure is fb_monospecs. In the old API, there was little importance for fb_monospecs. This allowed for forbidden things such as setting a mode of 800x600 on a fix frequency monitor. With the new API, fb_monospecs prevents such things, and if used correctly, can prevent a monitor from being cooked. fb_monospecs will not be useful until kernels 2.5.x.