xref: /netbsd-src/sys/arch/sun3/dev/fbvar.h (revision 3aa5a3ae30f092daa39cb540c574af3082fdc595)
1 /*	$NetBSD: fbvar.h,v 1.14 2022/02/12 03:24:35 riastradh 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 	const char *fb_name;		/* i.e. device_xname(sc_dev) */
57 
58 	void *	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 uint32_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)(dev_t, int, int, struct lwp *);
76 	int 	(*fbd_close)(dev_t, int, int, struct lwp *);
77 	paddr_t	(*fbd_mmap)(dev_t, off_t, int);
78 	int	(*fbd_kqfilter)(dev_t, struct knote *);
79 	/* These are the internal ioctl functions */
80 	int 	(*fbd_gattr)(struct fbdevice *,  void *);
81 	int 	(*fbd_gvideo)(struct fbdevice *, void *);
82 	int 	(*fbd_svideo)(struct fbdevice *, void *);
83 	int 	(*fbd_getcmap)(struct fbdevice *, void *);
84 	int 	(*fbd_putcmap)(struct fbdevice *, void *);
85 };
86 
87 int 	fbioctlfb(struct fbdevice *, u_long, void *);
88 
89 void	fb_attach(struct fbdevice *, int);
90 int 	fb_noioctl(struct fbdevice *, void *);
91 
92 void	fb_eeprom_setsize (struct fbdevice *);
93 
94 int 	fb_pfour_id(void *);
95 int 	fb_pfour_get_video(struct fbdevice *);
96 void	fb_pfour_set_video(struct fbdevice *, int);
97 
98 void	fb_pfour_setsize(struct fbdevice *);
99 
100 /* This comes from enable.c */
101 void	enable_video(int);
102