NetBSD/share/man/man4/man4.pmax/fb.4

294 lines
9.2 KiB
Groff

.\" $NetBSD: fb.4,v 1.3 2002/02/13 08:18:02 ross Exp $
.\"
.\" Copyright (c) 2001 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Gregory McGarry.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the NetBSD
.\" Foundation, Inc. and its contributors.
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd September 21, 2001
.Dt FB 4 pmax
.Os
.Sh NAME
.Nm fb
.Nd pmax frame buffer driver
.Sh SYNOPSIS
.Cd "pseudo-device fb N"
.Sh DESCRIPTION
The
.Nm
driver provides a frame buffer driver which is generic driver for all
supported framebuffers on
.Nx Ns /pmax .
The devices to which this applies are the
.Xr cfb 4 ,
.Xr mfb 4 ,
.Xr sfb 4 ,
.Xr pm 4 (colour and mono),
.Xr px 4 , and
.Xr xcfb 4
frame buffers. It provides support for the Ultrix-compatible
pm/QVSS-style interface, mostly so that X consortium Xservers work.
It also provides support for the Sun-style frame buffer interface
which is compatible with exisiting
.Nx
applications.
.Pp
The basic programming of the
.Nm
devices involves opening the device file, mapping the control
registers and frame buffer addresses into user space, and then
manipulating the device as the application requires. The address
mapping is controlled by an
.Xr ioctl 2
call to map the device into user space, and an unmap call when
finished. The pm/QVSS-style ioctls supported by
.Nx
are:
.Bl -tag -width indent
.It Dv QIOCGINFO
Get Graphics Info
.Pp
Get info about the device, setting the entries in the
.Em pm_info
structure, as defined in \*[Lt]pmax/pmioctl.h\*[Gt]:
.Pp
.Bd -literal
typedef struct pm_info {
pmEventQueue qe; /* event \*[Am] motion queues */
short mswitches; /* current value of mouse btns */
pmCursor tablet; /* current tablet position */
short tswitches; /* current tablet buttons NI! */
pmCursor cursor; /* current cursor position */
short row; /* screen row */
short col; /* screen col */
short max_row; /* max character row */
short max_col; /* max character col */
short max_x; /* max x position */
short max_y; /* max y position */
short max_cur_x; /* max cursor x position */
short max_cur_y; /* max cursor y position */
int version; /* version of driver */
char *bitmap; /* bit map position */
short *scanmap; /* scanline map position */
short *cursorbits; /* cursor bit position */
short *pmaddr; /* virtual address */
char *planemask; /* plane mask virtual location */
pmCursor mouse; /* atomic read/write */
pmBox mbox; /* atomic read/write */
short mthreshold; /* mouse motion parameter */
short mscale; /* mouse scale factor */
short min_cur_x; /* min cursor x position */
short min_cur_y; /* min cursor y position */
} PM_Info;
.Ed
.It Dv QIOCPMSTATE
Set Mouse State/Position
.Pp
Set mouse state/position, using the entries in the
.Em pmCursor
structure, as defined in \*[Lt]pmax/pmioctl.h\*[Gt]:
.Pp
.Bd -literal
typedef struct {
short x;
short y;
} pmCursor;
.Ed
.It Dv QIOCINIT
Initialise the Screen
.It Dv QIOCKPCMD
Send Keyboard Command
.Pp
Send keyboard command, using the entries in the
.Em pm_kpcmd
structure, as defined in \*[Lt]pmax/pmioctl.h\*[Gt]:
.Pp
.Bd -literal
typedef struct pm_kpcmd {
char nbytes; /* number of bytes in parameter */
unsigned char cmd; /* command to be sent */
unsigned char par[2]; /* bytes of params to be sent */
} pmKpCmd;
.Ed
.It Dv QIOCADDR
Get address
.Pp
Get address, setting the entries in the
.Em pm_info
structure, as defined in \*[Lt]pmax/pmioctl.h\*[Gt]:
.Pp
.Bd -literal
.Ed
.It Dv QIOWCURSOR
Write Cursor Bitmap
.It Dv QIOWCURSORCOLOR
Background/Foreground RGB colour
.It Dv QIOSETCMAP
Set the Colour Map
.Pp
Set the colour map, using the entries in the
.Em ColourMap
structure, as defined in \*[Lt]pmax/pmioctl.h\*[Gt]:
.Pp
.Bd -literal
typedef struct {
short Map;
unsigned short index;
struct {
unsigned short red;
unsigned short green;
unsigned short blue;
} Entry;
} ColorMap;
.Ed
.It Dv QIOKERNLOOP
Re-route kernel console output
.It Dv QIOKERNUNLOOP
Do not re-route kernel console output
.It Dv QIOVIDEOON
Turn on the video
.It Dv QIOVIDEOOFF
Turn off the video
.El
.Pp
The Sun-style ioctls supported by
.Nx
are:
.Bl -tag -width indent
.It Dv FBIOGTYPE
Get frame buffer type.
.Pp
Get info about the device, setting the entries in the
.Em fbtype
structure,as defined in \*[Lt]pmax/fbio.h\*[Gt]:
.Pp
.Bd -literal
struct fbtype {
int fb_boardtype; /* as defined above */
int fb_height; /* in pixels */
int fb_width; /* in pixels */
int fb_depth; /* bits per pixel */
int fb_cmsize; /* size of color map (entries) */
int fb_size; /* total size in bytes */
};
.Ed
.It Dv FBIOGETCMAP/FBIOPUTCMAP
Colour Map I/O
.Pp
Get or set the colour map, using the entries in the
.Em fbcmap
structure,as defined in \*[Lt]pmax/fbio.h\*[Gt]:
.Pp
.Bd -literal
struct fbcmap {
int index; /* first element (0 origin) */
int count; /* number of elements */
u_char *red; /* red color map elements */
u_char *green; /* green color map elements */
u_char *blue; /* blue color map elements */
};
.Ed
.It Dv FBIOGATTR
Get FB Attribute
.Pp
Get fb attribute, setting the entries in the
.Em fbsatter
structure,as defined in \*[Lt]pmax/fbio.h\*[Gt]:
.Pp
.Bd -literal
struct fbsattr {
int flags; /* flags; see below */
int emu_type; /* emulation (-1 if unused) */
int dev_specific[FB_ATTR_NDEVSPECIFIC];
};
.Ed
.It Dv FBIOGCURSOR/FBIOSCURSOR
Get or Set Cursor Attributes/Shape
.Pp
Get or set the cursor attributes or shape, using the entries in the
.Em fbcursor
structure, as defined in \*[Lt]pmax/fbio.h\*[Gt]:
.Pp
.Bd -literal
struct fbcursor {
short set; /* what to set */
short enable; /* enable/disable cursor */
struct fbcurpos pos; /* cursor's position */
struct fbcurpos hot; /* cursor's hot spot */
struct fbcmap cmap; /* color map info */
struct fbcurpos size; /* cursor's bit map size */
char *image; /* cursor's image bits */
char *mask; /* cursor's mask bits */
};
.Ed
.It Dv FBIOGCURPOS/FBIOSCURPOS
Get or Set Cursor Position
.Pp
Get or set cursor position, using the entries in the
.Em fbcursor
structure.
.It Dv FBIOGCURMAX
Get Maximum Cursor Size
.Pp
Get the maximum cursor size, setting the entries in the
.Em fbcursor
structure.
.It Dv FBIOGVIDEO/FBIOSVIDEO
Video Control
.Pp
Enable or disable the video.
.El
.Pp
For further information about the use of ioctl see the man page.
.Sh FILES
.Bl -tag -width /dev/*crt*? -compact
.It Pa /dev/fb*
generic framebuffer pseudo-device
.El
.Sh ERRORS
.Bl -tag -width [EINVAL]
.It Bq Er ENODEV
no such device.
.It Bq Er EBUSY
Another process has the device open.
.It Bq Er EINVAL
Invalid ioctl specification.
.El
.Sh SEE ALSO
.Xr cfb 4 ,
.Xr mfb 4 ,
.Xr pm 4 ,
.Xr px 4 ,
.Xr rcons 4 ,
.Xr sfb 4 ,
.Xr xcfb 4