xref: /original-bsd/sys/news3400/iop/fbreg.h (revision d364528e)
1 /*
2  * Copyright (c) 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7  *
8  * %sccs.include.redist.c%
9  *
10  * from: $Hdr: fbreg.h,v 4.300 91/06/27 20:43:07 root Rel41 $ SONY
11  *
12  *	@(#)fbreg.h	7.1 (Berkeley) 06/04/92
13  */
14 
15 #ifdef KERNEL
16 
17 #include "../include/fix_machine_type.h"
18 
19 struct fb_softc {
20 	int	fbs_state;
21 	int	fbs_device;
22 	lScrType fbs_type;
23 	int	fbs_flag;
24 };
25 
26 #ifdef news700
27 #define	splfb		spl4
28 #endif
29 #if defined(news800) || defined(news1800)
30 #define	splfb		spl5
31 #endif
32 #if defined(news1200) || defined(news1700)
33 #define	splfb		spl3
34 #endif
35 #if defined(news3200) || defined(news3400)
36 #define	splfb		spl3
37 #endif
38 #ifdef news3800
39 #define	splfb		spl4
40 #endif
41 
42 /*
43  * state of fbstate
44  */
45 #define	FB_BUSY		01	/* fb is busy */
46 #define FB_WANTED	02	/* fb is wanted */
47 #define FB_WAIT		04	/* fb is waiting for command complete */
48 #define FB_DELAY	010	/* fb is busy, but not wait (inner ioctl) */
49 #define FB_DELAY2	020	/* fb is busy, but not wait (outer ioctl) */
50 
51 /*
52  * physical page map for IOP
53  */
54 #define FB_MAX_IO	(2048*1024)	/* 2048 KB */
55 #define NFBMAP	(FB_MAX_IO / NBPG + 1)	/* maximum number of pages */
56 
57 struct fb_map {
58 	caddr_t		fm_vaddr;	/* virtual address */
59 	unsigned	fm_offset;	/* offset into first page */
60 	unsigned	fm_count;	/* byte counts */
61 	caddr_t		fm_addr[NFBMAP]; /* first addr into page */
62 };
63 
64 extern struct fb_map	fbmap[];
65 
66 /*
67  * fbreg definition
68  */
69 struct fbreg {
70 	u_char	fb_command;	/* command byte */
71 	u_char	fb_result;	/* result byte */
72 	u_char	fb_device;	/* device type */
73 	u_char	fb_unit;	/* unit no */
74 
75 	union {
76 	    lBitblt	_fb_bitblt;	/* bitblt command */
77 	    lBatchBitblt _fb_batchbitblt; /* batch bitblt command */
78 	    lTileBitblt	_fb_tilebitblt;	/* tile bitblt command */
79 	    lBitblt3	_fb_bitblt3;	/* 3 operand bitblt command */
80 	    lPrimLine	_fb_polyline;	/* (disjoint) polyline */
81 	    lPrimRect	_fb_rectangle;	/* rectangle */
82 	    lPrimFill	_fb_fillscan;	/* fill pattern */
83 	    lPrimMarker	_fb_polymarker;	/* polymarker */
84 	    lPrimText	_fb_text;	/* text display */
85 	    lPrimDot	_fb_polydot;	/* polydot */
86 	    lScrType	_fb_scrtype;	/* screen type */
87 	    lCursor2	_fb_cursor;	/* cursor area */
88 	    lPalette	_fb_palette;	/* get/set palette */
89 	    lPoint	_fb_point;
90 	    int		_fb_data;
91 	    lVideoCtl	_fb_videoctl;
92 	    lVideoStatus _fb_videostatus;
93 	    lFbIoctl	_fb_ioctl;
94 	} fb_un;
95 };
96 #define fb_bitblt	fb_un._fb_bitblt
97 #define fb_batchbitblt	fb_un._fb_batchbitblt
98 #define fb_tilebitblt	fb_un._fb_tilebitblt
99 #define fb_bitblt3	fb_un._fb_bitblt3
100 #define fb_polyline	fb_un._fb_polyline
101 #define fb_rectangle	fb_un._fb_rectangle
102 #define fb_fillscan	fb_un._fb_fillscan
103 #define fb_polymarker	fb_un._fb_polymarker
104 #define fb_text		fb_un._fb_text
105 #define fb_polydot	fb_un._fb_polydot
106 #define fb_scrtype	fb_un._fb_scrtype
107 #define fb_cursor	fb_un._fb_cursor
108 #define fb_palette	fb_un._fb_palette
109 #define fb_point	fb_un._fb_point
110 #define fb_data		fb_un._fb_data
111 #define fb_videoctl	fb_un._fb_videoctl
112 #define fb_videostatus	fb_un._fb_videostatus
113 #define fb_fbioctl	fb_un._fb_ioctl
114 
115 /* command definiton */
116 #define FB_CPROBE	0	/* probe */
117 #define FB_CATTACH	1	/* attach */
118 #define FB_COPEN	2	/* read from Frame Buffer */
119 #define FB_CCLOSE	3	/* write to Frame Buffer */
120 #define FB_CBITBLT	4	/* bitblt */
121 #define FB_CBATCHBITBLT	5	/* bitblt */
122 #define FB_CSETSCR	6	/* set display screen */
123 #define FB_CGETSCR	7	/* get display screen */
124 #define FB_CSETDIM	8	/* set dimmer level */
125 #define FB_CGETDIM	9	/* get dimmer level */
126 #define FB_CDRAW	10	/* graphic primitive drawing */
127 #define FB_CPOLYLINE	11
128 #define FB_CDJPOLYLINE	12
129 #define FB_CRECTANGLE	13
130 #define FB_CFILLSCAN	14
131 #define FB_CPOLYMARKER	15
132 #define FB_CTEXT	16
133 #define FB_CPOLYDOT	17
134 #define FB_CSETSCRMODE	18
135 #define FB_CGETSCRMODE	19
136 #define FB_CGETSCRTYPE	20	/* get screen type (b/w or color8 or...) */
137 #define FB_CSETPALETTE	21
138 #define FB_CGETPALETTE	22
139 #define FB_CSELPALETTE	23	/* select current palette */
140 #define FB_CSETDADDR	24	/* set display address */
141 
142 #define FB_CTILEBITBLT	30	/* tile bitblt */
143 #define FB_CBITBLT3	31	/* 3 operand bitblt */
144 
145 #define FB_CSETCURSOR	50
146 #define FB_CUNSETCURSOR	51
147 #define FB_CSHOWCURSOR	52
148 #define FB_CHIDECURSOR	53
149 #define FB_CSETXY	54
150 #define FB_CAUTODIM	55
151 
152 #define FB_CSETVIDEO	60
153 #define FB_CGETVIDEO	61
154 #define FB_CSETPMODE	62
155 #define FB_CGETPMODE	63
156 
157 #define FB_CGETPAGE	70
158 
159 #define FB_CIOCTL	80
160 
161 /* result definiton */
162 #define FB_ROK		0	/* OK */
163 #define FB_RERROR	1	/* some error occurred */
164 
165 #define	FBUNIT(dev) (minor(dev) & 0x7f)
166 #define	FBVIDEO(dev) (minor(dev) & 0x80)
167 
168 #define FBPRI	(PRIBIO+1)
169 
170 #define ASROM_SIZE	0x10000		/* size of auto-select ROM */
171 #define ASREG_SIZE	0x10000		/* size of auto-select control reg. */
172 #define ASREG_SIZE2	0x40000		/* size of 2nd area */
173 
174 #endif /* KERNEL */
175