Home | History | Annotate | Line # | Download | only in dev
grfioctl.h revision 1.3
      1 /*
      2  * Copyright (c) 1988 University of Utah.
      3  * Copyright (c) 1990 The Regents of the University of California.
      4  * All rights reserved.
      5  *
      6  * This code is derived from software contributed to Berkeley by
      7  * the Systems Programming Group of the University of Utah Computer
      8  * Science Department.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *	This product includes software developed by the University of
     21  *	California, Berkeley and its contributors.
     22  * 4. Neither the name of the University nor the names of its contributors
     23  *    may be used to endorse or promote products derived from this software
     24  *    without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36  * SUCH DAMAGE.
     37  *
     38  *	from: Utah Hdr: grfioctl.h 1.1 90/07/09
     39  *	from: @(#)grfioctl.h	7.2 (Berkeley) 11/4/90
     40  *	$Id: grfioctl.h,v 1.3 1993/09/02 18:08:00 mw Exp $
     41  */
     42 
     43 
     44 /* these are changeable values, encapsulated in their own structure, so
     45    no the whole thing has to be copied when setting parameters. */
     46 struct grfdyninfo {
     47 	int	gdi_fbx;			/* frame buffer x offset */
     48 	int	gdi_fby;			/* frame buffer y offset */
     49 	int	gdi_dwidth;		/* displayed part width */
     50 	int	gdi_dheight;		/* displayed part height */
     51 	int	gdi_dx;			/* displayed part x offset */
     52 	int	gdi_dy;			/* displayed part y offset */
     53 };
     54 
     55 struct	grfinfo {
     56 	caddr_t	gd_regaddr;		/* control registers physaddr */
     57 	int	gd_regsize;		/* control registers size */
     58 	caddr_t	gd_fbaddr;		/* frame buffer physaddr */
     59 	int	gd_fbsize;		/* frame buffer size */
     60 	short	gd_colors;		/* number of colors */
     61 	short	gd_planes;		/* number of planes */
     62 
     63 	int	gd_fbwidth;		/* frame buffer width */
     64 	int	gd_fbheight;		/* frame buffer height */
     65 
     66 	struct grfdyninfo gd_dyn;	/* everything changable by GRFIOCSINFO */
     67 /* compatibility... */
     68 #define gd_fbx		gd_dyn.gdi_fbx
     69 #define gd_fby		gd_dyn.gdi_fby
     70 #define gd_dwidth 	gd_dyn.gdi_dwidth
     71 #define gd_dheight	gd_dyn.gdi_dheight
     72 #define gd_dx		gd_dyn.gdi_dx
     73 #define gd_dy		gd_dyn.gdi_dy
     74 };
     75 
     76 
     77 /* video mode, should be display-independant, but it might need
     78    modifications in the future to really become hardware-independant. */
     79 
     80 struct grfvideo_mode {
     81   u_char  mode_num;		/* index in mode table */
     82   char	  mode_descr[80];	/* description of mode */
     83   u_long  pixel_clock;		/* in Hz. */
     84   u_short disp_width;		/* width of displayed video (incl overscan) */
     85   u_short disp_height;		/* height "" */
     86   u_short depth;		/* number of bitplanes resp. bits per pixel */
     87   u_short hblank_start;
     88   u_short hblank_stop;
     89   u_short hsync_start;		/* video-parameters, take care not to   */
     90   u_short hsync_stop;		/* use parameters that violete specs of */
     91   u_short htotal;		/* your monitor !                       */
     92   u_short vblank_start;
     93   u_short vblank_stop;
     94   u_short vsync_start;
     95   u_short vsync_stop;
     96   u_short vtotal;
     97 };
     98 
     99 
    100 /*
    101  * BSD ioctls
    102  */
    103 #define	GRFIOCGINFO	_IOR('G', 0, struct grfinfo) /* get info on device */
    104 #define	GRFIOCON	_IO('G', 1)		/* turn graphics on */
    105 #define	GRFIOCOFF	_IO('G', 2)		/* turn graphics off */
    106 #define GRFIOCMAP	_IOWR('G', 5, int)	/* map in regs+framebuffer */
    107 #define GRFIOCUNMAP	_IOW('G', 6, int)	/* unmap regs+framebuffer */
    108 
    109 /* amiga addons */
    110 	/* set info on device */
    111 #define	GRFIOCSINFO	_IOW('G', 40, struct grfdyninfo)
    112 	/* get video_mode. mode_num==0 gets current mode. */
    113 #define GRFGETVMODE	_IOWR('G', 41, struct grfvideo_mode)
    114 	/* set video_mode. */
    115 #define GRFSETVMODE	_IOW('G', 42, int)
    116 	/* get number of configured video modes */
    117 #define GRFGETNUMVM	_IOR('G', 43, int)
    118 
    119 
    120 
    121