RASOPS(9) | Kernel Developer's Manual | RASOPS(9) |
int
rasops_init(struct rasops_info *ri, int wantrows, int wantcols);
int
rasops_reconfig(struct rasops_info *ri, int wantrows, int wantcols);
The primary data type for using the raster operations is the rasops_info structure in dev/rasops/rasops.h:
struct rasops_info { /* * These must be filled in by the caller */ int ri_depth; /* depth in bits */ u_char *ri_bits; /* ptr to bits */ int ri_width; /* width (pels) */ int ri_height; /* height (pels) */ int ri_stride; /* stride in bytes */ /* * If you want shadow framebuffer support, point ri_hwbits * to the real framebuffer, and ri_bits to the shadow framebuffer */ u_char *ri_hwbits; /* * These can optionally be left zeroed out. If you fill ri_font, * but aren't using wsfont, set ri_wsfcookie to -1. */ struct wsdisplay_font *ri_font; int ri_wsfcookie; /* wsfont cookie */ void *ri_hw; /* driver private data */ int ri_crow; /* cursor row */ int ri_ccol; /* cursor column */ int ri_flg; /* various operational flags */ /* * These are optional and will default if zero. Meaningless * on depths other than 15, 16, 24 and 32 bits per pel. On * 24 bit displays, ri_{r,g,b}num must be 8. */ u_char ri_rnum; /* number of bits for red */ u_char ri_gnum; /* number of bits for green */ u_char ri_bnum; /* number of bits for blue */ u_char ri_rpos; /* which bit red starts at */ u_char ri_gpos; /* which bit green starts at */ u_char ri_bpos; /* which bit blue starts at */ /* * These are filled in by rasops_init() */ int ri_emuwidth; /* width we actually care about */ int ri_emuheight; /* height we actually care about */ int ri_emustride; /* bytes per row we actually care about */ int ri_rows; /* number of rows (characters) */ int ri_cols; /* number of columns (characters) */ int ri_delta; /* row delta in bytes */ int ri_pelbytes; /* bytes per pel (may be zero) */ int ri_fontscale; /* fontheight * fontstride */ int ri_xscale; /* fontwidth * pelbytes */ int ri_yscale; /* fontheight * stride */ u_char *ri_origbits; /* where screen bits actually start */ int ri_xorigin; /* where ri_bits begins (x) */ int ri_yorigin; /* where ri_bits begins (y) */ int32_t ri_devcmap[16]; /* color -> framebuffer data */ /* * The emulops you need to use, and the screen caps for wscons */ struct wsdisplay_emulops ri_ops; int ri_caps; /* * Callbacks so we can share some code */ void (*ri_do_cursor)(struct rasops_info *); };
Valid values for the ri_flg member are:
options RASOPS_DEFAULT_WIDTH=80 options RASOPS_DEFAULT_HEIGHT=25If calling rasops_reconfig() to change the font and ri_wsfcookie ≥ 0, you must call wsfont_unlock() on it, and reset it to -1 (or a new, valid cookie).
January 13, 2012 | NetBSD 6.1 |