Home | History | Annotate | Line # | Download | only in dev
fbvar.h revision 1.8
      1 /*	$NetBSD: fbvar.h,v 1.8 2003/08/07 16:29:55 agc Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1992, 1993
      5  *	The Regents of the University of California.  All rights reserved.
      6  *
      7  * This software was developed by the Computer Systems Engineering group
      8  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
      9  * contributed to Berkeley.
     10  *
     11  * All advertising materials mentioning features or use of this software
     12  * must display the following acknowledgement:
     13  *	This product includes software developed by the University of
     14  *	California, Lawrence Berkeley Laboratory.
     15  *
     16  * Redistribution and use in source and binary forms, with or without
     17  * modification, are permitted provided that the following conditions
     18  * are met:
     19  * 1. Redistributions of source code must retain the above copyright
     20  *    notice, this list of conditions and the following disclaimer.
     21  * 2. Redistributions in binary form must reproduce the above copyright
     22  *    notice, this list of conditions and the following disclaimer in the
     23  *    documentation and/or other materials provided with the distribution.
     24  * 3. Neither the name of the University nor the names of its contributors
     25  *    may be used to endorse or promote products derived from this software
     26  *    without specific prior written permission.
     27  *
     28  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     29  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     31  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     32  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     36  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     37  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     38  * SUCH DAMAGE.
     39  *
     40  *	@(#)fbvar.h	8.1 (Berkeley) 6/11/93
     41  */
     42 
     43 #include <sys/event.h>		/* for struct knote */
     44 
     45 /*
     46  * Frame buffer variables.  All frame buffer drivers must provide the
     47  * following in order to participate.
     48  */
     49 
     50 struct fbcmap;
     51 
     52 struct fbdevice {
     53 	struct	fbtype fb_fbtype;	/* see fbio.h */
     54 	struct	fbdriver *fb_driver;	/* pointer to driver */
     55 	void *fb_private;		/* for fb driver use */
     56 	char *fb_name;			/* i.e. sc_dev.dx_name */
     57 
     58 	caddr_t	fb_pixels;		/* display RAM */
     59 	int	fb_linebytes;		/* bytes per display line */
     60 
     61 	int	fb_flags;		/* copy of cf_flags */
     62 
     63 	/* This points to the P4 register if the FB has one. */
     64 	volatile u_int32_t *fb_pfour;
     65 
     66 	/*
     67 	 * XXX - The "Raster console" stuff could be stored
     68 	 * in the driver specific structure at fb_private
     69 	 * if needed.
     70 	 */
     71 };
     72 
     73 struct fbdriver {
     74 	/* These avoid the need to know our major number. */
     75 	int 	(*fbd_open) __P((dev_t, int, int, struct proc *));
     76 	int 	(*fbd_close) __P((dev_t, int, int, struct proc *));
     77 	paddr_t	(*fbd_mmap) __P((dev_t, off_t, int));
     78 	int	(*fbd_kqfilter) __P((dev_t, struct knote *));
     79 	/* These are the internal ioctl functions */
     80 	int 	(*fbd_gattr) __P((struct fbdevice *,  void *));
     81 	int 	(*fbd_gvideo) __P((struct fbdevice *, void *));
     82 	int 	(*fbd_svideo) __P((struct fbdevice *, void *));
     83 	int 	(*fbd_getcmap) __P((struct fbdevice *, void *));
     84 	int 	(*fbd_putcmap) __P((struct fbdevice *, void *));
     85 };
     86 
     87 int 	fbioctlfb __P((struct fbdevice *, u_long, caddr_t));
     88 
     89 void	fb_attach __P((struct fbdevice *, int));
     90 int 	fb_noioctl __P((struct fbdevice *, void *));
     91 void	fb_unblank __P((void));
     92 
     93 void	fb_eeprom_setsize  __P((struct fbdevice *));
     94 
     95 int 	fb_pfour_id __P((void *));
     96 int 	fb_pfour_get_video __P((struct fbdevice *));
     97 void	fb_pfour_set_video __P((struct fbdevice *, int));
     98 
     99 void	fb_pfour_setsize __P((struct fbdevice *));
    100 
    101 /* This comes from enable.c */
    102 void	enable_video __P((int));
    103