Home | History | Annotate | Line # | Download | only in sun
      1  1.13  macallan /*	$NetBSD: fbio.h,v 1.13 2016/05/07 15:28:57 macallan Exp $ */
      2   1.1        pk 
      3   1.1        pk /*
      4   1.1        pk  * Copyright (c) 1992 Regents of the University of California.
      5   1.1        pk  * All rights reserved.
      6   1.1        pk  *
      7   1.1        pk  * This code is derived from software developed by the Computer Systems
      8   1.1        pk  * Engineering group at Lawrence Berkeley Laboratory under DARPA
      9   1.1        pk  * contract BG 91-66 and contributed to Berkeley.
     10   1.1        pk  *
     11   1.1        pk  * Redistribution and use in source and binary forms, with or without
     12   1.1        pk  * modification, are permitted provided that the following conditions
     13   1.1        pk  * are met:
     14   1.1        pk  * 1. Redistributions of source code must retain the above copyright
     15   1.1        pk  *    notice, this list of conditions and the following disclaimer.
     16   1.1        pk  * 2. Redistributions in binary form must reproduce the above copyright
     17   1.1        pk  *    notice, this list of conditions and the following disclaimer in the
     18   1.1        pk  *    documentation and/or other materials provided with the distribution.
     19   1.4       agc  * 3. Neither the name of the University nor the names of its contributors
     20   1.1        pk  *    may be used to endorse or promote products derived from this software
     21   1.1        pk  *    without specific prior written permission.
     22   1.1        pk  *
     23   1.1        pk  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24   1.1        pk  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25   1.1        pk  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26   1.1        pk  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27   1.1        pk  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28   1.1        pk  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29   1.1        pk  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30   1.1        pk  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31   1.1        pk  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32   1.1        pk  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33   1.1        pk  * SUCH DAMAGE.
     34   1.1        pk  *
     35   1.1        pk  * 	@(#)fbio.h	7.2 (Berkeley) 4/1/92
     36   1.1        pk  */
     37   1.1        pk 
     38   1.6  macallan #ifndef FBIO_H
     39   1.6  macallan #define FBIO_H
     40   1.6  macallan 
     41  1.12  dholland #include <sys/ioccom.h>
     42  1.12  dholland 
     43   1.1        pk /*
     44   1.1        pk  * Frame buffer ioctls (from Sprite, trimmed to essentials for X11).
     45   1.1        pk  */
     46   1.1        pk 
     47   1.1        pk /*
     48   1.1        pk  * Frame buffer type codes.
     49   1.1        pk  */
     50   1.1        pk #define	FBTYPE_SUN1BW		0	/* multibus mono */
     51   1.1        pk #define	FBTYPE_SUN1COLOR	1	/* multibus color */
     52   1.1        pk #define	FBTYPE_SUN2BW		2	/* memory mono */
     53   1.1        pk #define	FBTYPE_SUN2COLOR	3	/* color w/rasterop chips */
     54   1.1        pk #define	FBTYPE_SUN2GP		4	/* GP1/GP2 */
     55   1.1        pk #define	FBTYPE_SUN5COLOR	5	/* RoadRunner accelerator */
     56   1.1        pk #define	FBTYPE_SUN3COLOR	6	/* memory color */
     57   1.1        pk #define	FBTYPE_MEMCOLOR		7	/* memory 24-bit */
     58   1.1        pk #define	FBTYPE_SUN4COLOR	8	/* memory color w/overlay */
     59   1.1        pk 
     60   1.1        pk #define	FBTYPE_NOTSUN1		9	/* reserved for customer */
     61   1.1        pk #define	FBTYPE_NOTSUN2		10	/* reserved for customer */
     62   1.1        pk #define	FBTYPE_NOTSUN3		11	/* reserved for customer */
     63   1.1        pk 
     64   1.1        pk #define	FBTYPE_SUNFAST_COLOR	12	/* accelerated 8bit */
     65   1.1        pk #define	FBTYPE_SUNROP_COLOR	13	/* MEMCOLOR with rop h/w */
     66   1.1        pk #define	FBTYPE_SUNFB_VIDEO	14	/* Simple video mixing */
     67   1.1        pk #define	FBTYPE_RESERVED5	15	/* reserved, do not use */
     68   1.1        pk #define	FBTYPE_RESERVED4	16	/* reserved, do not use */
     69   1.1        pk #define	FBTYPE_RESERVED3	17	/* reserved, do not use */
     70   1.1        pk #define FBTYPE_SUNGP3           17      /* cg12 running gpsi microcode */
     71   1.1        pk #define FBTYPE_SUNGT            18      /* gt graphics accelerator */
     72   1.1        pk #define FBTYPE_SUNLEO           19      /* zx graphics accelerator */
     73   1.1        pk #define FBTYPE_MDICOLOR         20      /* cgfourteen framebuffer */
     74   1.1        pk #define	FBTYPE_P9100		21	/* tadpole 3gx p9100 controller */
     75   1.5    martin #define FBTYPE_CREATOR		22	/* ffb creator or elite */
     76   1.8  macallan #define FBTYPE_GENERIC_PCI	23	/* machfb, ofb and so on */
     77   1.9  macallan #define FBTYPE_AG10E		24	/* Fujitsu AG-10e */
     78  1.11  macallan #define FBTYPE_TCXCOLOR		25	/* Sun TCX, S24  */
     79  1.13  macallan #define FBTYPE_MGX		26	/* Southland Media MGX  */
     80   1.1        pk 
     81  1.13  macallan #define	FBTYPE_LASTPLUSONE	27	/* max number of fbs (change as add) */
     82   1.3   thorpej 
     83   1.3   thorpej /*
     84   1.3   thorpej  * XXX These really shouldn't be here, but this is what the pmax
     85   1.3   thorpej  * XXX port did ages ago.
     86   1.3   thorpej  */
     87   1.3   thorpej #define	PMAX_FBTYPE_PM_MONO	1
     88   1.3   thorpej #define	PMAX_FBTYPE_PM_COLOR	2
     89   1.3   thorpej #define	PMAX_FBTYPE_CFB		3
     90   1.3   thorpej #define	PMAX_FBTYPE_XCFB	4
     91   1.3   thorpej #define	PMAX_FBTYPE_MFB		5
     92   1.3   thorpej #define	PMAX_FBTYPE_SFB		6
     93   1.3   thorpej #define	PMAX_FBTYPE_PX		7
     94   1.3   thorpej 
     95   1.3   thorpej #define	PMAX_FBTYPE_LASTPLUSONE	8
     96   1.1        pk 
     97   1.1        pk /*
     98   1.1        pk  * Frame buffer descriptor as returned by FBIOGTYPE.
     99   1.1        pk  */
    100   1.1        pk struct fbtype {
    101   1.1        pk 	int	fb_type;	/* as defined above */
    102   1.1        pk 	int	fb_height;	/* in pixels */
    103   1.1        pk 	int	fb_width;	/* in pixels */
    104   1.1        pk 	int	fb_depth;	/* bits per pixel */
    105   1.1        pk 	int	fb_cmsize;	/* size of color map (entries) */
    106   1.1        pk 	int	fb_size;	/* total size in bytes */
    107   1.1        pk };
    108   1.1        pk #define	FBIOGTYPE	_IOR('F', 0, struct fbtype)
    109   1.1        pk 
    110   1.1        pk #ifdef notdef
    111   1.1        pk /*
    112   1.1        pk  * General purpose structure for passing info in and out of frame buffers
    113   1.1        pk  * (used for gp1) -- unsupported.
    114   1.1        pk  */
    115   1.1        pk struct fbinfo {
    116   1.1        pk 	int	fb_physaddr;	/* physical frame buffer address */
    117   1.1        pk 	int	fb_hwwidth;	/* fb board width */
    118   1.1        pk 	int	fb_hwheight;	/* fb board height */
    119   1.1        pk 	int	fb_addrdelta;	/* phys addr diff between boards */
    120   1.1        pk 	u_char	*fb_ropaddr;	/* fb virtual addr */
    121   1.1        pk 	int	fb_unit;	/* minor devnum of fb */
    122   1.1        pk };
    123   1.1        pk #define	FBIOGINFO	_IOR('F', 2, struct fbinfo)
    124   1.1        pk #endif
    125   1.1        pk 
    126   1.1        pk /*
    127   1.1        pk  * Color map I/O.
    128   1.1        pk  */
    129   1.1        pk struct fbcmap {
    130   1.2  jdolecek 	u_int	index;		/* first element (0 origin) */
    131   1.2  jdolecek 	u_int	count;		/* number of elements */
    132   1.1        pk 	u_char	*red;		/* red color map elements */
    133   1.1        pk 	u_char	*green;		/* green color map elements */
    134   1.1        pk 	u_char	*blue;		/* blue color map elements */
    135   1.1        pk };
    136   1.1        pk #define	FBIOPUTCMAP	_IOW('F', 3, struct fbcmap)
    137   1.1        pk #define	FBIOGETCMAP	_IOW('F', 4, struct fbcmap)
    138   1.1        pk 
    139   1.1        pk /*
    140   1.1        pk  * Set/get attributes.
    141   1.1        pk  */
    142   1.1        pk #define	FB_ATTR_NDEVSPECIFIC	8	/* no. of device specific values */
    143   1.1        pk #define	FB_ATTR_NEMUTYPES	4	/* no. of emulation types */
    144   1.1        pk 
    145   1.1        pk struct fbsattr {
    146   1.1        pk 	int	flags;			/* flags; see below */
    147   1.1        pk 	int	emu_type;		/* emulation type (-1 if unused) */
    148   1.1        pk 	int	dev_specific[FB_ATTR_NDEVSPECIFIC];	/* catchall */
    149   1.1        pk };
    150   1.1        pk #define	FB_ATTR_AUTOINIT	1	/* emulation auto init flag */
    151   1.1        pk #define	FB_ATTR_DEVSPECIFIC	2	/* dev. specific stuff valid flag */
    152   1.1        pk 
    153   1.1        pk struct fbgattr {
    154   1.1        pk 	int	real_type;		/* real device type */
    155   1.1        pk 	int	owner;			/* PID of owner, 0 if myself */
    156   1.1        pk 	struct	fbtype fbtype;		/* fbtype info for real device */
    157   1.1        pk 	struct	fbsattr sattr;		/* see above */
    158   1.1        pk 	int	emu_types[FB_ATTR_NEMUTYPES];	/* possible emulations */
    159   1.1        pk 						/* (-1 if unused) */
    160   1.1        pk };
    161   1.1        pk /*	FBIOSATTR	_IOW('F', 5, struct fbsattr) -- unsupported */
    162   1.1        pk #define	FBIOGATTR	_IOR('F', 6, struct fbgattr)
    163   1.1        pk 
    164   1.1        pk /*
    165   1.1        pk  * Video control.
    166   1.1        pk  */
    167   1.1        pk #define	FBVIDEO_OFF		0
    168   1.1        pk #define	FBVIDEO_ON		1
    169   1.1        pk 
    170   1.1        pk #define	FBIOSVIDEO	_IOW('F', 7, int)
    171   1.1        pk #define	FBIOGVIDEO	_IOR('F', 8, int)
    172   1.1        pk 
    173   1.1        pk /*
    174   1.1        pk  * hardware cursor control
    175   1.1        pk  */
    176   1.1        pk struct fbcurpos {
    177   1.1        pk 	short x;
    178   1.1        pk 	short y;
    179   1.1        pk };
    180   1.1        pk 
    181   1.1        pk #define FB_CUR_SETCUR   0x01
    182   1.1        pk #define FB_CUR_SETPOS   0x02
    183   1.1        pk #define FB_CUR_SETHOT   0x04
    184   1.1        pk #define FB_CUR_SETCMAP  0x08
    185   1.1        pk #define FB_CUR_SETSHAPE 0x10
    186   1.1        pk #define FB_CUR_SETALL   0x1F
    187   1.1        pk 
    188   1.1        pk struct fbcursor {
    189   1.1        pk 	short set;		/* what to set */
    190   1.1        pk 	short enable;		/* enable/disable cursor */
    191   1.1        pk 	struct fbcurpos pos;	/* cursor's position */
    192   1.1        pk 	struct fbcurpos hot;	/* cursor's hot spot */
    193   1.1        pk 	struct fbcmap cmap;	/* color map info */
    194   1.1        pk 	struct fbcurpos size;	/* cursor's bit map size */
    195   1.1        pk 	char *image;		/* cursor's image bits */
    196   1.1        pk 	char *mask;		/* cursor's mask bits */
    197   1.1        pk };
    198   1.1        pk 
    199   1.1        pk /* set/get cursor attributes/shape */
    200   1.1        pk #define FBIOSCURSOR	_IOW('F', 24, struct fbcursor)
    201   1.1        pk #define FBIOGCURSOR	_IOWR('F', 25, struct fbcursor)
    202   1.1        pk 
    203   1.1        pk /* set/get cursor position */
    204   1.1        pk #define FBIOSCURPOS	_IOW('F', 26, struct fbcurpos)
    205   1.1        pk #define FBIOGCURPOS	_IOW('F', 27, struct fbcurpos)
    206   1.1        pk 
    207   1.1        pk /* get max cursor size */
    208   1.1        pk #define FBIOGCURMAX	_IOR('F', 28, struct fbcurpos)
    209   1.6  macallan 
    210   1.6  macallan #endif /* FBIO_H */
    211