Files | |
file | fb.c |
file | fb/fb.h |
Data Structures | |
struct | viewport_t |
struct | animation_t |
struct | pixmap_t |
Defines | |
#define | DEFAULT_BGCOLOR 0xf0f0f0 |
#define | DEFAULT_FGCOLOR 0x0 |
#define | MAX_ANIM_LEN 8 |
#define | MAX_ANIMATIONS 4 |
#define | MAX_PIXMAPS 256 |
#define | MAX_VIEWPORTS 128 |
#define | RED(x, bits) ((x >> (16 + 8 - bits)) & ((1 << bits) - 1)) |
#define | GREEN(x, bits) ((x >> (8 + 8 - bits)) & ((1 << bits) - 1)) |
#define | BLUE(x, bits) ((x >> (8 - bits)) & ((1 << bits) - 1)) |
#define | COL_WIDTH 8 |
#define | ROW_BYTES (screen.scanline * FONT_SCANLINES) |
#define | POINTPOS(x, y) ((y) * screen.scanline + (x) * screen.pixelbytes) |
Typedefs | |
typedef void(* | conv2scr_fn_t )(void *, int) |
typedef int(* | conv2rgb_fn_t )(void *) |
typedef void(* | putpixel_cb_t )(void *, unsigned int, unsigned int, int) |
Functions | |
static void | rgb_4byte (void *dst, int rgb) |
static int | byte4_rgb (void *src) |
static void | rgb_3byte (void *dst, int rgb) |
static int | byte3_rgb (void *src) |
static void | rgb_2byte (void *dst, int rgb) |
static int | byte2_rgb (void *src) |
static void | rgb_1byte (void *dst, int rgb) |
static int | byte1_rgb (void *src) |
static void | putpixel (viewport_t *vport, unsigned int x, unsigned int y, int color) |
static int | getpixel (viewport_t *vport, unsigned int x, unsigned int y) |
static void | putpixel_mem (char *mem, unsigned int x, unsigned int y, int color) |
static void | draw_rectangle (viewport_t *vport, unsigned int sx, unsigned int sy, unsigned int width, unsigned int height, int color) |
static void | clear_port (viewport_t *vport) |
static void | scroll_port_nodb (viewport_t *vport, int lines) |
static void | refresh_viewport_db (viewport_t *vport) |
static void | scroll_port_db (viewport_t *vport, int lines) |
static void | scroll_port (viewport_t *vport, int lines) |
static void | invert_pixel (viewport_t *vport, unsigned int x, unsigned int y) |
static void | draw_glyph (viewport_t *vport, __u8 glyph, unsigned int sx, unsigned int sy, style_t style, int transparent) |
static void | invert_char (viewport_t *vport, unsigned int row, unsigned int col) |
static int | viewport_create (unsigned int x, unsigned int y, unsigned int width, unsigned int height) |
static void | screen_init (void *addr, unsigned int xres, unsigned int yres, unsigned int bpp, unsigned int scan) |
static void | cursor_hide (viewport_t *vport) |
static void | cursor_print (viewport_t *vport) |
static void | cursor_blink (viewport_t *vport) |
static void | draw_char (viewport_t *vport, char c, unsigned int row, unsigned int col, style_t style, int transparent) |
static void | draw_text_data (viewport_t *vport, keyfield_t *data) |
static int | find_free_pixmap (void) |
static void | putpixel_pixmap (int pm, unsigned int x, unsigned int y, int color) |
static int | shm2pixmap (unsigned char *shm, size_t size) |
static int | shm_handle (ipc_callid_t callid, ipc_call_t *call, int vp) |
static void | copy_vp_to_pixmap (viewport_t *vport, pixmap_t *pmap) |
static int | save_vp_to_pixmap (viewport_t *vport) |
static int | draw_pixmap (int vp, int pm) |
static void | anims_tick (void) |
static void | mouse_show (void) |
static void | mouse_hide (void) |
static void | mouse_move (unsigned int x, unsigned int y) |
static int | anim_handle (ipc_callid_t callid, ipc_call_t *call, int vp) |
static int | pixmap_handle (ipc_callid_t callid, ipc_call_t *call, int vp) |
static void | fb_client_connection (ipc_callid_t iid, ipc_call_t *icall) |
int | fb_init (void) |
Variables | |
struct { | |
int phone | |
ipcarg_t rows | |
ipcarg_t cols | |
__u8 * fbaddress | |
unsigned int xres | |
unsigned int yres | |
unsigned int scanline | |
unsigned int pixelbytes | |
conv2scr_fn_t rgb2scr | |
conv2rgb_fn_t scr2rgb | |
volatile sysarg_t seconds1 | |
volatile sysarg_t useconds | |
volatile sysarg_t seconds2 | |
} | screen |
static animation_t | animations [MAX_ANIMATIONS] |
static int | anims_enabled |
static pixmap_t | pixmaps [MAX_PIXMAPS] |
static viewport_t | viewports [128] |
static int | client_connected = 0 |
static int | pointer_x |
static int | pointer_y |
static int | pointer_shown |
static int | pointer_enabled |
static int | pointer_vport = -1 |
static int | pointer_pixmap = -1 |
|
|
|
|
|
|
|
Definition at line 103 of file fb.c. Referenced by anim_handle(), and anims_tick(). |
|
Maximum number of saved pixmaps Pixmap is a saved rectangle Definition at line 119 of file fb.c. Referenced by find_free_pixmap(), and pixmap_handle(). |
|
Definition at line 128 of file fb.c. Referenced by anim_handle(), fb_client_connection(), pixmap_handle(), and viewport_create(). |
|
Definition at line 134 of file fb.c. Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte(). |
|
Definition at line 135 of file fb.c. Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte(). |
|
Definition at line 136 of file fb.c. Referenced by rgb_1byte(), rgb_2byte(), and rgb_3byte(). |
|
Definition at line 138 of file fb.c. Referenced by draw_char(), draw_text_data(), and invert_char(). |
|
|
|
Definition at line 141 of file fb.c. Referenced by draw_rectangle(), getpixel(), putpixel(), putpixel_mem(), refresh_viewport_db(), and scroll_port_nodb(). |
|
|
|
|
|
|
|
Definition at line 144 of file fb.c. Referenced by screen_init(). |
|
Definition at line 149 of file fb.c. Referenced by screen_init(). |
|
Definition at line 154 of file fb.c. References BLUE, GREEN, and RED. Referenced by screen_init(). |
|
Definition at line 170 of file fb.c. Referenced by screen_init(). |
|
16-bit depth (5:6:5) Definition at line 181 of file fb.c. References BLUE, GREEN, and RED. Referenced by screen_init(). |
|
16-bit depth (5:6:5) Definition at line 188 of file fb.c. Referenced by screen_init(). |
|
Put pixel - 8-bit depth (3:2:3) Definition at line 195 of file fb.c. References BLUE, GREEN, and RED. Referenced by screen_init(). |
|
Return pixel color - 8-bit depth (3:2:3) Definition at line 201 of file fb.c. Referenced by screen_init(). |
|
Put pixel into viewport
Definition at line 214 of file fb.c. References viewport_t::dbdata, viewport_t::dboffset, viewport_t::height, viewport_t::paused, POINTPOS, screen, viewport_t::width, viewport_t::x, and viewport_t::y. Referenced by draw_glyph(), invert_pixel(), mouse_show(), and shm_handle(). |
|
Get pixel from viewport Definition at line 230 of file fb.c. References POINTPOS, screen, viewport_t::x, and viewport_t::y. Referenced by invert_pixel(). |
|
Definition at line 238 of file fb.c. References POINTPOS, and screen. Referenced by draw_rectangle(). |
|
Definition at line 244 of file fb.c. References memcpy(), viewport_t::paused, POINTPOS, putpixel_mem(), screen, viewport_t::x, and viewport_t::y. Referenced by clear_port(), scroll_port_db(), and scroll_port_nodb(). Here is the call graph for this function: ![]() |
|
Fill viewport with background color Definition at line 278 of file fb.c. References style_t::bg_color, draw_rectangle(), viewport_t::height, viewport_t::style, and viewport_t::width. Referenced by draw_text_data(), and fb_client_connection(). Here is the call graph for this function: ![]() |
|
Scroll unbuffered viewport up/down
Definition at line 288 of file fb.c. References style_t::bg_color, draw_rectangle(), viewport_t::height, memcpy(), POINTPOS, screen, viewport_t::style, viewport_t::width, viewport_t::x, and viewport_t::y. Referenced by scroll_port(). Here is the call graph for this function: ![]() |
|
Refresh given viewport from double buffer Definition at line 310 of file fb.c. References viewport_t::dbdata, viewport_t::dboffset, viewport_t::height, memcpy(), POINTPOS, screen, viewport_t::width, viewport_t::x, and viewport_t::y. Referenced by scroll_port_db(). Here is the call graph for this function: ![]() |
|
Scroll viewport that has double buffering enabled Definition at line 328 of file fb.c. References style_t::bg_color, viewport_t::dboffset, draw_rectangle(), viewport_t::height, viewport_t::paused, refresh_viewport_db(), viewport_t::style, and viewport_t::width. Referenced by scroll_port(). Here is the call graph for this function: ![]() |
|
Scrolls viewport given number of lines Definition at line 353 of file fb.c. References viewport_t::dbdata, scroll_port_db(), and scroll_port_nodb(). Referenced by fb_client_connection(). Here is the call graph for this function: ![]() |
|
Definition at line 362 of file fb.c. References getpixel(), and putpixel(). Referenced by invert_char(). Here is the call graph for this function: ![]() |
|
Draw character at given position
Definition at line 379 of file fb.c. References style_t::bg_color, fb_font, style_t::fg_color, FONT_SCANLINES, and putpixel(). Referenced by draw_char(), and draw_text_data(). Here is the call graph for this function: ![]() |
|
Invert character at given position Definition at line 398 of file fb.c. References COL_WIDTH, FONT_SCANLINES, and invert_pixel(). Referenced by cursor_hide(), cursor_print(), and draw_char(). Here is the call graph for this function: ![]() |
|
Create new viewport
Definition at line 416 of file fb.c. References MAX_VIEWPORTS, and viewports. Referenced by fb_client_connection(), mouse_show(), and screen_init(). |
|
Initialize framebuffer as a chardev output device
Definition at line 458 of file fb.c. References byte1_rgb(), byte2_rgb(), byte3_rgb(), byte4_rgb(), rgb_1byte(), rgb_2byte(), rgb_3byte(), rgb_4byte(), screen, and viewport_create(). Referenced by fb_init(). Here is the call graph for this function: ![]() |
|
Hide cursor if it is shown Definition at line 494 of file fb.c. References viewport_t::cur_col, viewport_t::cur_row, viewport_t::cursor_active, viewport_t::cursor_shown, and invert_char(). Referenced by cursor_blink(), and fb_client_connection(). Here is the call graph for this function: ![]() |
|
Show cursor if cursor showing is enabled Definition at line 503 of file fb.c. References viewport_t::cur_col, viewport_t::cur_row, viewport_t::cursor_active, viewport_t::cursor_shown, and invert_char(). Referenced by cursor_blink(), draw_char(), and fb_client_connection(). Here is the call graph for this function: ![]() |
|
Invert cursor, if it is enabled Definition at line 513 of file fb.c. References cursor_hide(), cursor_print(), and viewport_t::cursor_shown. Referenced by fb_client_connection(). Here is the call graph for this function: ![]() |
|
Draw character at given position relative to viewport
Definition at line 529 of file fb.c. References COL_WIDTH, viewport_t::cur_col, viewport_t::cur_row, viewport_t::cursor_active, cursor_print(), viewport_t::cursor_shown, draw_glyph(), FONT_SCANLINES, and invert_char(). Referenced by fb_client_connection(). Here is the call graph for this function: ![]() |
|
Draw text data to viewport
Definition at line 557 of file fb.c. References clear_port(), COL_WIDTH, viewport_t::cols, draw_glyph(), FONT_SCANLINES, viewport_t::rows, viewport_t::style, and style_same(). Referenced by shm_handle(). Here is the call graph for this function: ![]() |
|
Return first free pixmap Definition at line 576 of file fb.c. References MAX_PIXMAPS, and pixmaps. Referenced by save_vp_to_pixmap(), and shm2pixmap(). |
|
Definition at line 586 of file fb.c. References pixmap_t::data, pixmaps, screen, and pixmap_t::width. Referenced by shm2pixmap(). |
|
Create a new pixmap and return appropriate ID Definition at line 595 of file fb.c. References pixmap_t::data, find_free_pixmap(), pixmap_t::height, pixmaps, ppm_draw(), ppm_get_data(), putpixel_pixmap(), screen, and pixmap_t::width. Referenced by shm_handle(). Here is the call graph for this function: ![]() |
|
Handle shared memory communication calls Protocol for drawing pixmaps:
Protocol for text drawing
Definition at line 638 of file fb.c. References as_area_destroy(), as_get_mappable_page(), cols, draw_text_data(), FB_DRAW_PPM, FB_DRAW_TEXT_DATA, FB_DROP_SHM, FB_PREPARE_SHM, FB_SHM2PIXMAP, viewport_t::height, interbuffer, ipc_answer_fast(), NULL, ppm_draw(), putpixel(), receive_comm_area(), viewport_t::rows, shm2pixmap(), viewports, and viewport_t::width. Referenced by fb_client_connection(). Here is the call graph for this function: ![]() |
|
Definition at line 728 of file fb.c. References pixmap_t::data, viewport_t::height, memcpy(), screen, viewport_t::width, viewport_t::x, and viewport_t::y. Referenced by mouse_show(), and save_vp_to_pixmap(). Here is the call graph for this function: ![]() |
|
Save viewport to pixmap Definition at line 750 of file fb.c. References copy_vp_to_pixmap(), pixmap_t::data, find_free_pixmap(), pixmap_t::height, viewport_t::height, pixmaps, screen, pixmap_t::width, and viewport_t::width. Referenced by mouse_show(), and pixmap_handle(). Here is the call graph for this function: ![]() |
|
Draw pixmap on screen
Definition at line 777 of file fb.c. References pixmap_t::data, pixmap_t::height, viewport_t::height, memcpy(), pixmaps, screen, viewports, pixmap_t::width, viewport_t::width, viewport_t::x, and viewport_t::y. Here is the call graph for this function: ![]() |
|
Tick animation one step forward Definition at line 809 of file fb.c. References animations, draw_pixmap(), MAX_ANIMATIONS, pixmaps, and animation_t::pos. Referenced by fb_client_connection(). Here is the call graph for this function: ![]() |
|
Definition at line 833 of file fb.c. References copy_vp_to_pixmap(), pixmaps, pointer_enabled, pointer_pixmap, pointer_shown, pointer_vport, pointer_x, pointer_y, putpixel(), save_vp_to_pixmap(), screen, viewport_create(), viewports, viewport_t::x, and viewport_t::y. Referenced by fb_client_connection(), and mouse_move(). Here is the call graph for this function: ![]() |
|
Definition at line 872 of file fb.c. References draw_pixmap(), pointer_pixmap, pointer_shown, and pointer_vport. Referenced by fb_client_connection(), and mouse_move(). Here is the call graph for this function: ![]() |
|
Definition at line 881 of file fb.c. References mouse_hide(), mouse_show(), pointer_x, and pointer_y. Referenced by fb_client_connection(). Here is the call graph for this function: ![]() |
|
Definition at line 889 of file fb.c. References animations, FB_ANIM_CREATE, MAX_ANIMATIONS, MAX_VIEWPORTS, and viewports. Referenced by fb_client_connection(). |
|
Handler for messages concerning pixmap handling Definition at line 982 of file fb.c. References pixmap_t::data, draw_pixmap(), FB_DROP_PIXMAP, FB_VP2PIXMAP, FB_VP_DRAW_PIXMAP, ipc_answer_fast(), MAX_PIXMAPS, MAX_VIEWPORTS, NULL, pixmaps, save_vp_to_pixmap(), and viewports. Referenced by fb_client_connection(). Here is the call graph for this function: ![]() |
|
|
Initialization of framebuffer Definition at line 1213 of file fb.c. References ALIGN_UP, as_get_mappable_page(), async_set_client_connection(), fb_client_connection(), map_physmem(), screen_init(), and sysinfo_value(). Referenced by main(). Here is the call graph for this function: ![]() |
|
|
Framebuffer phone |
|
Framebuffer rows |
|
Framebuffer columns |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 113 of file fb.c. Referenced by anim_handle(), and anims_tick(). |
|
Definition at line 114 of file fb.c. Referenced by fb_client_connection(). |
|
Definition at line 125 of file fb.c. Referenced by anims_tick(), draw_pixmap(), find_free_pixmap(), mouse_show(), pixmap_handle(), putpixel_pixmap(), save_vp_to_pixmap(), and shm2pixmap(). |
|
Definition at line 129 of file fb.c. Referenced by anim_handle(), draw_pixmap(), fb_client_connection(), mouse_show(), pixmap_handle(), shm_handle(), and viewport_create(). |
|
Definition at line 132 of file fb.c. Referenced by fb_client_connection(). |
|
Definition at line 828 of file fb.c. Referenced by mouse_move(), and mouse_show(). |
|
Definition at line 828 of file fb.c. Referenced by mouse_move(), and mouse_show(). |
|
Definition at line 829 of file fb.c. Referenced by mouse_hide(), and mouse_show(). |
|
Definition at line 829 of file fb.c. Referenced by fb_client_connection(), and mouse_show(). |
|
Definition at line 830 of file fb.c. Referenced by mouse_hide(), and mouse_show(). |
|
Definition at line 831 of file fb.c. Referenced by mouse_hide(), and mouse_show(). |