FBIO(4S) — SPECIAL FILES
NAME
fbio − general properties of frame buffers
DESCRIPTION
All of the Sun frame buffers support the same general interface. Each responds to a FBIOGTYPE ioctl which returns information in a structure defined in <sun/fbio.h>:
structfbtype {
intfb_type; /∗ as defined below ∗/
intfb_height;/∗ in pixels ∗/
intfb_width;/∗ in pixels ∗/
intfb_depth;/∗ bits per pixel ∗/
intfb_cmsize;/∗ size of color map (entries) ∗/
intfb_size; /∗ total size in bytes ∗/
};
#define FBTYPE_SUN1BW 0
#define FBTYPE_SUN1COLOR1
#define FBTYPE_SUN2BW 2
#define FBTYPE_SUN2COLOR3
#define FBTYPE_SUN2GP4
Each device has an FBTYPE which is used by higher-level software to determine how to perform raster-op and other functions. Each device is used by opening it, doing a FBIOGTYPE ioctl to see which frame buffer type is present, and thereby selecting the appropriate device-management routines.
Full-fledged frame buffers (that is, those that run SunWindows) implement an FBIOGPIXRECT ioctl, which returns a pixrect. This call is made only from inside the kernel. The returned pixrect is used by win(4S) for cursor tracking and colormap loading.
FBIOSVIDEO and FBIOGVIDEO are general-purpose ioctls for controlling possible video features of frame buffers. They are defined in <sun/fbio.h> . These ioctls either set or return the value of a flags integer. At this point, only the FBVIDEO_ON option is available, controlled by FBIOSVIDEO. FBIOGVIDEO returns this current video state.
The FBIOSATTR and FBIOGATTR ioctls allow access to special features of newer frame buffers. They use the following structures as defined in <sun/fbio.h>:
#defineFB_ATTR_NDEVSPECIFIC8/∗ no. of device specific values ∗/
#defineFB_ATTR_NEMUTYPES4/∗ no. of emulation types ∗/
struct fbsattr {
intflags;/∗ misc flags ∗/
#defineFB_ATTR_AUTOINIT1/∗ emulation auto init flag ∗/
#defineFB_ATTR_DEVSPECIFIC2/∗ dev. specific stuff valid flag ∗/
intemu_type;/∗ emulation type (-1 if unused) ∗/
intdev_specific[FB_ATTR_NDEVSPECIFIC];/∗ catchall ∗/
};
struct fbgattr {
intreal_type;/∗ real device type ∗/
intowner;/∗ PID of owner, 0 if myself ∗/
struct fbtype fbtype;/∗ fbtype info for real device ∗/
struct fbsattr sattr;/∗ see above ∗/
intemu_types[FB_ATTR_NEMUTYPES];/∗ possible emulations ∗/
/∗ (-1 if unused) ∗/
};
SEE ALSO
mmap(2), bwone(4S), bwtwo(4S), cgone(4S), cgtwo(4S), cgfour(4S), gpone(4S), fb(4S), win(4S)
BUGS
FBIOSATTR and FBIOGATTR are only supported by the cgfour(4S) frame buffer.
The FBVIDEO_ON flag my be incorrect for the bwone(4S), bwtwo(4S), and cgfour(4S) frame buffers since the drivers for these devices do not test the hardware, but simply report the last state stored by FBIOSVIDEO. The stored state and actual hardware state can get out of sync for several reasons: (1) processes having the same bwone frame buffer mapped can directly enable or disable the video, unknown to the driver; (2) /dev/bwtwo0 and /dev/cgfour0 on a cgfour CPU refer to the same frame buffer hardware; the video state of /dev/bwtwo0 may change, unknown to the cgfour driver; (3) if the hardware is not the default frame buffer /dev/fb, the hardware’s initial state is “video off”, unknown to the driver.
Sun Release 3.2 — Last change: 7 July 1986