xref: /csrg-svn/sys/news3400/iop/framebuf.h (revision 53887)
1*53887Smckusick /*
2*53887Smckusick  * Copyright (c) 1992 The Regents of the University of California.
3*53887Smckusick  * All rights reserved.
4*53887Smckusick  *
5*53887Smckusick  * This code is derived from software contributed to Berkeley by
6*53887Smckusick  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7*53887Smckusick  *
8*53887Smckusick  * %sccs.include.redist.c%
9*53887Smckusick  *
10*53887Smckusick  * from: $Hdr: framebuf.h,v 4.300 91/06/09 06:42:21 root Rel41 $ SONY
11*53887Smckusick  *
12*53887Smckusick  *	@(#)framebuf.h	7.1 (Berkeley) 06/04/92
13*53887Smckusick  */
14*53887Smckusick 
15*53887Smckusick #ifndef __FRAMEBUF__
16*53887Smckusick #define __FRAMEBUF__ 1
17*53887Smckusick 
18*53887Smckusick typedef unsigned short	Word;
19*53887Smckusick 
20*53887Smckusick #define BitsPerWord	16
21*53887Smckusick 
22*53887Smckusick typedef struct {
23*53887Smckusick 	short	x, y;
24*53887Smckusick } sPoint;
25*53887Smckusick 
26*53887Smckusick typedef struct {
27*53887Smckusick 	int	x, y;
28*53887Smckusick } lPoint;
29*53887Smckusick 
30*53887Smckusick typedef struct {
31*53887Smckusick 	sPoint	origin;
32*53887Smckusick 	sPoint	extent;
33*53887Smckusick } sRectangle;
34*53887Smckusick 
35*53887Smckusick typedef struct {
36*53887Smckusick 	lPoint	origin;
37*53887Smckusick 	lPoint	extent;
38*53887Smckusick } lRectangle;
39*53887Smckusick 
40*53887Smckusick typedef struct {
41*53887Smckusick 	char		type;	/* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */
42*53887Smckusick 	char		depth;	/* bitmap depth */
43*53887Smckusick 	unsigned short	width;	/* width in Words */
44*53887Smckusick 	sRectangle	rect;	/* defined area */
45*53887Smckusick 	Word		*base;	/* for BM_MEM */
46*53887Smckusick } sBitmap;
47*53887Smckusick 
48*53887Smckusick typedef struct {
49*53887Smckusick 	char		type;	/* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */
50*53887Smckusick 	char		depth;	/* bitmap depth */
51*53887Smckusick 	unsigned short	width;	/* width in Words */
52*53887Smckusick 	lRectangle	rect;	/* defined area */
53*53887Smckusick 	Word		*base;	/* for BM_MEM */
54*53887Smckusick } lBitmap;
55*53887Smckusick 
56*53887Smckusick #define BM_FB		0	/* frame buffer */
57*53887Smckusick #define BM_MEM		1	/* bitmap in memory (XY format) */
58*53887Smckusick #define BM_0		2	/* virtual bitmap of data '0' */
59*53887Smckusick #define BM_1		3	/* virtual bitmap of data '1' */
60*53887Smckusick #define BM_LBP		4	/* lbp page buffer (future support) */
61*53887Smckusick 
62*53887Smckusick /* 2 operand bitblt */
63*53887Smckusick typedef struct {
64*53887Smckusick 	unsigned char	func;		/* function code */
65*53887Smckusick 	char		transp;		/* transparency */
66*53887Smckusick 	int		fore_color;	/* foreground color */
67*53887Smckusick 	int		aux_color;	/* auxiliary color */
68*53887Smckusick 	int		planemask;	/* select plane */
69*53887Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
70*53887Smckusick 	sRectangle	srcRect;	/* source rectangle */
71*53887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
72*53887Smckusick 	sRectangle	destClip;	/* clip rectangle */
73*53887Smckusick 	sPoint		destPoint;	/* destination point */
74*53887Smckusick } sBitblt;
75*53887Smckusick 
76*53887Smckusick typedef struct {
77*53887Smckusick 	unsigned char	func;		/* function code */
78*53887Smckusick 	char		transp;		/* transparency */
79*53887Smckusick 	int		fore_color;	/* foreground color */
80*53887Smckusick 	int		aux_color;	/* auxiliary color */
81*53887Smckusick 	int		planemask;	/* select plane */
82*53887Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
83*53887Smckusick 	lRectangle	srcRect;	/* source rectangle */
84*53887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
85*53887Smckusick 	lRectangle	destClip;	/* clip rectangle */
86*53887Smckusick 	lPoint		destPoint;	/* destination point */
87*53887Smckusick } lBitblt;
88*53887Smckusick 
89*53887Smckusick /* tile 2 operand bitblt */
90*53887Smckusick typedef struct {
91*53887Smckusick 	unsigned char	func;		/* function code */
92*53887Smckusick 	char		transp;		/* transparency */
93*53887Smckusick 	int		fore_color;	/* foreground color */
94*53887Smckusick 	int		aux_color;	/* auxiliary color */
95*53887Smckusick 	int		planemask;	/* select plane */
96*53887Smckusick 	sBitmap		ptnBitmap;	/* pattern bitmap */
97*53887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
98*53887Smckusick 	sPoint		refPoint;	/* reference point */
99*53887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
100*53887Smckusick 	sRectangle	destClip;	/* clip rectangle */
101*53887Smckusick 	sRectangle	destRect;	/* destination rectangle */
102*53887Smckusick } sTileBitblt;
103*53887Smckusick 
104*53887Smckusick typedef struct {
105*53887Smckusick 	unsigned char	func;		/* function code */
106*53887Smckusick 	char		transp;		/* transparency */
107*53887Smckusick 	int		fore_color;	/* foreground color */
108*53887Smckusick 	int		aux_color;	/* auxiliary color */
109*53887Smckusick 	int		planemask;	/* select plane */
110*53887Smckusick 	lBitmap		ptnBitmap;	/* pattern bitmap */
111*53887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
112*53887Smckusick 	lPoint		refPoint;	/* reference point */
113*53887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
114*53887Smckusick 	lRectangle	destClip;	/* clip rectangle */
115*53887Smckusick 	lRectangle	destRect;	/* destination rectangle */
116*53887Smckusick } lTileBitblt;
117*53887Smckusick 
118*53887Smckusick /* 3 operand bitblt */
119*53887Smckusick typedef struct {
120*53887Smckusick 	unsigned char	func;		/* function code */
121*53887Smckusick 	char		transp;		/* transparency */
122*53887Smckusick 	int		fore_color;	/* foreground color */
123*53887Smckusick 	int		aux_color;	/* auxiliary color */
124*53887Smckusick 	int		planemask;	/* select plane */
125*53887Smckusick 	sBitmap		ptnBitmap;	/* pattern bitmap */
126*53887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
127*53887Smckusick 	sPoint		refPoint;	/* reference point */
128*53887Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
129*53887Smckusick 	sRectangle	srcRect;	/* source rectangle */
130*53887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
131*53887Smckusick 	sRectangle	destClip;	/* clip rectangle */
132*53887Smckusick 	sPoint		destPoint;	/* destination point */
133*53887Smckusick } sBitblt3;
134*53887Smckusick 
135*53887Smckusick typedef struct {
136*53887Smckusick 	unsigned char	func;		/* function code */
137*53887Smckusick 	char		transp;		/* transparency */
138*53887Smckusick 	int		fore_color;	/* foreground color */
139*53887Smckusick 	int		aux_color;	/* auxiliary color */
140*53887Smckusick 	int		planemask;	/* select plane */
141*53887Smckusick 	lBitmap		ptnBitmap;	/* pattern bitmap */
142*53887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
143*53887Smckusick 	lPoint		refPoint;	/* reference point */
144*53887Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
145*53887Smckusick 	lRectangle	srcRect;	/* source rectangle */
146*53887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
147*53887Smckusick 	lRectangle	destClip;	/* clip rectangle */
148*53887Smckusick 	lPoint		destPoint;	/* destination point */
149*53887Smckusick } lBitblt3;
150*53887Smckusick 
151*53887Smckusick typedef struct {
152*53887Smckusick 	sRectangle	srcRect;	/* source rectangle */
153*53887Smckusick 	sPoint		destPoint;	/* destination point */
154*53887Smckusick } sSrcDest;
155*53887Smckusick 
156*53887Smckusick typedef struct {
157*53887Smckusick 	lRectangle	srcRect;	/* source rectangle */
158*53887Smckusick 	lPoint		destPoint;	/* destination point */
159*53887Smckusick } lSrcDest;
160*53887Smckusick 
161*53887Smckusick /*
162*53887Smckusick  * batch bitblt
163*53887Smckusick  */
164*53887Smckusick typedef struct {
165*53887Smckusick 	unsigned char	func;		/* function code */
166*53887Smckusick 	char		transp;		/* transparency */
167*53887Smckusick 	int		fore_color;	/* foreground color */
168*53887Smckusick 	int		aux_color;	/* auxiliary color */
169*53887Smckusick 	int		planemask;	/* select plane */
170*53887Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
171*53887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
172*53887Smckusick 	sRectangle	destClip;	/* clip rectangle */
173*53887Smckusick 	int		nSrcDest;	/* number of src-dest in list */
174*53887Smckusick 	sSrcDest	*srcDestList;	/* pointer to src-dest spec */
175*53887Smckusick } sBatchBitblt;
176*53887Smckusick 
177*53887Smckusick typedef struct {
178*53887Smckusick 	unsigned char	func;		/* function code */
179*53887Smckusick 	char		transp;		/* transparency */
180*53887Smckusick 	int		fore_color;	/* foreground color */
181*53887Smckusick 	int		aux_color;	/* auxiliary color */
182*53887Smckusick 	int		planemask;	/* select plane */
183*53887Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
184*53887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
185*53887Smckusick 	lRectangle	destClip;	/* clip rectangle */
186*53887Smckusick 	int		nSrcDest;	/* number of src-dest in list */
187*53887Smckusick 	lSrcDest	*srcDestList;	/* pointer to src-dest spec */
188*53887Smckusick } lBatchBitblt;
189*53887Smckusick 
190*53887Smckusick #define MAX_BATCHBITBLT	1024		/* max number in src-dest list */
191*53887Smckusick 
192*53887Smckusick /*
193*53887Smckusick  * set screen mode
194*53887Smckusick  */
195*53887Smckusick 
196*53887Smckusick #define BLACK_ON_WHITE	0	/* white - 0, black - 1 (default) */
197*53887Smckusick #define WHITE_ON_BLACK	1	/* white - 1, black - 0 */
198*53887Smckusick 
199*53887Smckusick /*
200*53887Smckusick  * graphic primitive drawing
201*53887Smckusick  */
202*53887Smckusick 
203*53887Smckusick /* scan line array */
204*53887Smckusick typedef struct {
205*53887Smckusick 	short	y;
206*53887Smckusick 	short	x0, x1;		/* x0 <= x1 */
207*53887Smckusick } sScanl;
208*53887Smckusick 
209*53887Smckusick typedef struct {
210*53887Smckusick 	int	y;
211*53887Smckusick 	int	x0, x1;		/* x0 <= x1 */
212*53887Smckusick } lScanl;
213*53887Smckusick 
214*53887Smckusick /* line */
215*53887Smckusick typedef struct {
216*53887Smckusick 	unsigned int	lptn;		/* line pattern */
217*53887Smckusick 	short		np;		/* number of points */
218*53887Smckusick 	sPoint		*plist;		/* point list */
219*53887Smckusick 	int		fore_color;	/* foreground color */
220*53887Smckusick 	int		aux_color;	/* auxiliary color */
221*53887Smckusick 	int		planemask;	/* select plane */
222*53887Smckusick 	char		transp;		/* transparency */
223*53887Smckusick 	unsigned char	func;		/* rop function code */
224*53887Smckusick 	char		dlpf;		/* draw last point flag */
225*53887Smckusick 	sRectangle	clip;		/* clip rectangle */
226*53887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
227*53887Smckusick } sPrimLine;
228*53887Smckusick 
229*53887Smckusick typedef struct {
230*53887Smckusick 	unsigned int	lptn;		/* line pattern */
231*53887Smckusick 	short		np;		/* number of points */
232*53887Smckusick 	lPoint		*plist;		/* point list */
233*53887Smckusick 	int		fore_color;	/* foreground color */
234*53887Smckusick 	int		aux_color;	/* auxiliary color */
235*53887Smckusick 	int		planemask;	/* select plane */
236*53887Smckusick 	char		transp;		/* transparency */
237*53887Smckusick 	unsigned char	func;		/* rop function code */
238*53887Smckusick 	char		dlpf;		/* draw last point flag */
239*53887Smckusick 	lRectangle	clip;		/* clip rectangle */
240*53887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
241*53887Smckusick } lPrimLine;
242*53887Smckusick 
243*53887Smckusick /* rectangle filling */
244*53887Smckusick typedef struct {
245*53887Smckusick 	sRectangle	rect;		/* rectangle */
246*53887Smckusick 	sPoint		refPoint;	/* fill reference point */
247*53887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
248*53887Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
249*53887Smckusick 	int		fore_color;	/* foreground color */
250*53887Smckusick 	int		aux_color;	/* auxiliary color */
251*53887Smckusick 	int		planemask;	/* select plane */
252*53887Smckusick 	char		transp;		/* transparency */
253*53887Smckusick 	unsigned char	func;		/* rop function code */
254*53887Smckusick 	sRectangle	clip;		/* clip rectangle */
255*53887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
256*53887Smckusick } sPrimRect;
257*53887Smckusick 
258*53887Smckusick typedef struct {
259*53887Smckusick 	lRectangle	rect;		/* rectangle */
260*53887Smckusick 	lPoint		refPoint;	/* fill reference point */
261*53887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
262*53887Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
263*53887Smckusick 	int		fore_color;	/* foreground color */
264*53887Smckusick 	int		aux_color;	/* auxiliary color */
265*53887Smckusick 	int		planemask;	/* select plane */
266*53887Smckusick 	char		transp;		/* transparency */
267*53887Smckusick 	unsigned char	func;		/* rop function code */
268*53887Smckusick 	lRectangle	clip;		/* clip rectangle */
269*53887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
270*53887Smckusick } lPrimRect;
271*53887Smckusick 
272*53887Smckusick /* pattern filling */
273*53887Smckusick typedef struct {
274*53887Smckusick 	short		nscan;		/* number of scan element */
275*53887Smckusick 	sScanl		*scan;		/* scan line data */
276*53887Smckusick 	sPoint		refPoint;	/* fill reference point */
277*53887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
278*53887Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
279*53887Smckusick 	int		fore_color;	/* foreground color */
280*53887Smckusick 	int		aux_color;	/* auxiliary color */
281*53887Smckusick 	int		planemask;	/* select plane */
282*53887Smckusick 	char		transp;		/* transparency */
283*53887Smckusick 	unsigned char	func;		/* rop function code */
284*53887Smckusick 	sRectangle	clip;		/* clip rectangle */
285*53887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
286*53887Smckusick } sPrimFill;
287*53887Smckusick 
288*53887Smckusick typedef struct {
289*53887Smckusick 	short		nscan;		/* number of scan element */
290*53887Smckusick 	lScanl		*scan;		/* scan line data */
291*53887Smckusick 	lPoint		refPoint;	/* fill reference point */
292*53887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
293*53887Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
294*53887Smckusick 	int		fore_color;	/* foreground color */
295*53887Smckusick 	int		aux_color;	/* auxiliary color */
296*53887Smckusick 	int		planemask;	/* select plane */
297*53887Smckusick 	char		transp;		/* transparency */
298*53887Smckusick 	unsigned char	func;		/* rop function code */
299*53887Smckusick 	lRectangle	clip;		/* clip rectangle */
300*53887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
301*53887Smckusick } lPrimFill;
302*53887Smckusick 
303*53887Smckusick /* marker */
304*53887Smckusick typedef struct {
305*53887Smckusick 	short		np;		/* number of points */
306*53887Smckusick 	sPoint		*plist;		/* point list */
307*53887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
308*53887Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
309*53887Smckusick 	int		fore_color;	/* foreground color */
310*53887Smckusick 	int		aux_color;	/* auxiliary color */
311*53887Smckusick 	int		planemask;	/* select plane */
312*53887Smckusick 	char		transp;		/* transparency */
313*53887Smckusick 	unsigned char	func;		/* rop function code */
314*53887Smckusick 	sRectangle	clip;		/* clip rectangle */
315*53887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
316*53887Smckusick } sPrimMarker;
317*53887Smckusick 
318*53887Smckusick typedef struct {
319*53887Smckusick 	short		np;		/* number of points */
320*53887Smckusick 	lPoint		*plist;		/* point list */
321*53887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
322*53887Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
323*53887Smckusick 	int		fore_color;	/* foreground color */
324*53887Smckusick 	int		aux_color;	/* auxiliary color */
325*53887Smckusick 	int		planemask;	/* select plane */
326*53887Smckusick 	char		transp;		/* transparency */
327*53887Smckusick 	unsigned char	func;		/* rop function code */
328*53887Smckusick 	lRectangle	clip;		/* clip rectangle */
329*53887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
330*53887Smckusick } lPrimMarker;
331*53887Smckusick 
332*53887Smckusick /* text */
333*53887Smckusick #define MAX_STRING	1024
334*53887Smckusick 
335*53887Smckusick typedef struct {
336*53887Smckusick 	char		type;		/* ROM-font, etc */
337*53887Smckusick 	short		len;		/* string length (byte) */
338*53887Smckusick 	unsigned char	*str;		/* string */
339*53887Smckusick 	sPoint		p;
340*53887Smckusick 	int		dx, dy;		/* vector (16bit left shifted) */
341*53887Smckusick 	char		ex_factor;	/* expansion factor */
342*53887Smckusick 	sPoint		fp;		/* bitmap font upper-left */
343*53887Smckusick 	short		width, height;	/* font width, font height */
344*53887Smckusick 	short		column;		/* number of characters in a row */
345*53887Smckusick 	unsigned short	first_chr;	/* first character code */
346*53887Smckusick 	unsigned short	last_chr;	/* last character code */
347*53887Smckusick 	sBitmap		fontBM;		/* font bitmap */
348*53887Smckusick 	int		fore_color;	/* foreground color */
349*53887Smckusick 	int		aux_color;	/* auxiliary color */
350*53887Smckusick 	int		planemask;	/* select plane */
351*53887Smckusick 	char		transp;		/* transparency */
352*53887Smckusick 	unsigned char	func;		/* rop function code */
353*53887Smckusick 	sRectangle	clip;		/* clip rectangle */
354*53887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
355*53887Smckusick } sPrimText;
356*53887Smckusick 
357*53887Smckusick typedef struct {
358*53887Smckusick 	int		dx, dy;		/* vector (16bit left shifted) */
359*53887Smckusick 	lPoint		fp;		/* bitmap font upper-left */
360*53887Smckusick 	short		width, height;	/* font width, font height */
361*53887Smckusick 	short		column;		/* number of characters in a row */
362*53887Smckusick 	unsigned short	first_chr;	/* first character code */
363*53887Smckusick 	unsigned short	last_chr;	/* last character code */
364*53887Smckusick 	lBitmap		fontBM;		/* font bitmap */
365*53887Smckusick 	int		fore_color;	/* foreground color */
366*53887Smckusick 	int		aux_color;	/* auxiliary color */
367*53887Smckusick 	int		planemask;	/* select plane */
368*53887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
369*53887Smckusick 	lRectangle	clip;		/* clip rectangle */
370*53887Smckusick 	lPoint		p;		/* output position */
371*53887Smckusick 	unsigned char	*str;		/* string */
372*53887Smckusick 	short		len;		/* string length (byte) */
373*53887Smckusick 	char		type;		/* ROM-font, etc */
374*53887Smckusick 	char		transp;		/* transparency */
375*53887Smckusick 	unsigned char	func;		/* rop function code */
376*53887Smckusick 	char		ex_factor;	/* expansion factor */
377*53887Smckusick } lPrimText;
378*53887Smckusick 
379*53887Smckusick /* dot */
380*53887Smckusick typedef struct {
381*53887Smckusick 	short		np;		/* number of points */
382*53887Smckusick 	sPoint		*plist;		/* point list */
383*53887Smckusick 	int		fore_color;	/* foreground color */
384*53887Smckusick 	int		aux_color;	/* auxiliary color */
385*53887Smckusick 	int		planemask;	/* select plane */
386*53887Smckusick 	char		transp;		/* transparency */
387*53887Smckusick 	unsigned char	func;		/* rop function code */
388*53887Smckusick 	sRectangle	clip;		/* clip rectangle */
389*53887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
390*53887Smckusick } sPrimDot;
391*53887Smckusick 
392*53887Smckusick typedef struct {
393*53887Smckusick 	short		np;		/* number of points */
394*53887Smckusick 	lPoint		*plist;		/* point list */
395*53887Smckusick 	int		fore_color;	/* foreground color */
396*53887Smckusick 	int		aux_color;	/* auxiliary color */
397*53887Smckusick 	int		planemask;	/* select plane */
398*53887Smckusick 	char		transp;		/* transparency */
399*53887Smckusick 	unsigned char	func;		/* rop function code */
400*53887Smckusick 	lRectangle	clip;		/* clip rectangle */
401*53887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
402*53887Smckusick } lPrimDot;
403*53887Smckusick 
404*53887Smckusick /*
405*53887Smckusick  *	screen type
406*53887Smckusick  */
407*53887Smckusick typedef struct {
408*53887Smckusick 	short		colorwidth;	/* palette color width */
409*53887Smckusick 	short		plane;		/* number of planes */
410*53887Smckusick 	sRectangle	bufferrect;	/* framebuffer region */
411*53887Smckusick 	sRectangle	visiblerect;	/* visible screen region */
412*53887Smckusick } sScrType;
413*53887Smckusick 
414*53887Smckusick typedef struct {
415*53887Smckusick 	short		colorwidth;	/* palette color width */
416*53887Smckusick 	short		plane;		/* number of planes */
417*53887Smckusick 	char		type;		/* device type */
418*53887Smckusick 	char		unit;		/* unit no */
419*53887Smckusick 	lRectangle	bufferrect;	/* framebuffer region */
420*53887Smckusick 	lRectangle	visiblerect;	/* visible screen region */
421*53887Smckusick } lScrType;
422*53887Smckusick 
423*53887Smckusick /* device type */
424*53887Smckusick #define	FB_NWB512	1	/* fb is B/W bitmap display (816x1024) */
425*53887Smckusick #define	FB_NWB225	2	/* fb is color bitmap display (1280x1024) */
426*53887Smckusick #define	FB_POPM		3	/* fb is B/W bitmap display (816x1024) */
427*53887Smckusick #define	FB_POPC		4	/* fb is color bitmap display (1024x768) */
428*53887Smckusick #define FB_NWB514	5	/* fb is GrayScale bitmap display (1280x1280) */
429*53887Smckusick #define FB_NWB251	6	/* fb is New color bitmap display (1280x1024) */
430*53887Smckusick #define	FB_LCDM		7	/* fb is lcd bitmap (1120x780) */
431*53887Smckusick #define	FB_LCDC		8	/* fb is LCD color bitmap display (?) */
432*53887Smckusick #define	FB_NWB518	9	/* fb is B/W bitmap display (1024x768) */
433*53887Smckusick #define	FB_NWB252	10	/* fb is color bitmap display (1024x768) */
434*53887Smckusick #define	FB_NWB253	11	/* fb is B/W bitmap display (816x1024) */
435*53887Smckusick #define	FB_NWB254	12	/* fb is color bitmap display (1024x768) */
436*53887Smckusick #define	FB_NWB255	13	/* fb is B/W bitmap display (1280x1280) */
437*53887Smckusick #define	FB_SLB101	14	/* fb is color bitmap display (1920x1035) */
438*53887Smckusick #define FB_NWB256	15	/* fb is 3D-Rendaring Board (1280x1024) */
439*53887Smckusick #define	FB_NWB257	16	/* fb is color bitmap display (1280x1024) */
440*53887Smckusick 
441*53887Smckusick #define FB_NWB240	200	/* fb is A3 LPB/IR interface (3136x4516) */
442*53887Smckusick #define FB_NWB241	201	/* fb is A4 LBP/IR interface (3904x5600) */
443*53887Smckusick #define FB_NWB242	202	/* fb is A3 Image Processor (3136x4516) */
444*53887Smckusick 
445*53887Smckusick #define FB_FB2015	254	/* fb is full color big display (2048x1536) */
446*53887Smckusick #define FB_FB2020	255	/* fb is full color big display (2048x2048) */
447*53887Smckusick 
448*53887Smckusick #define FB_MONO0	1	/* fb is B/W (compat-3.0) */
449*53887Smckusick #define FB_COLOR0	2	/* fb is color (compat-3.0) */
450*53887Smckusick 
451*53887Smckusick /*
452*53887Smckusick  *	color
453*53887Smckusick  */
454*53887Smckusick typedef struct {
455*53887Smckusick 	short	index;		/* palette number */
456*53887Smckusick 	struct {
457*53887Smckusick 		short	r, g, b;
458*53887Smckusick 	} rgb;
459*53887Smckusick } sPalette;
460*53887Smckusick 
461*53887Smckusick typedef struct {
462*53887Smckusick 	int		count;
463*53887Smckusick 	sPalette	*palette;
464*53887Smckusick } lPalette;
465*53887Smckusick 
466*53887Smckusick /*
467*53887Smckusick  *	cursor
468*53887Smckusick  */
469*53887Smckusick typedef struct {
470*53887Smckusick 	unsigned char	func;
471*53887Smckusick 	char		cursor_color;
472*53887Smckusick 	char		mask_color;
473*53887Smckusick 	sPoint		hot;
474*53887Smckusick 	sPoint		size;
475*53887Smckusick 	sRectangle	cursorRect;	/* Cursor Pattern rea */
476*53887Smckusick 	sRectangle	maskRect;	/* Mask Pattern Area */
477*53887Smckusick 	sRectangle	saveRect;	/* Save Pattern Area */
478*53887Smckusick 	sRectangle	moveArea;
479*53887Smckusick } sCursor;
480*53887Smckusick 
481*53887Smckusick typedef struct {
482*53887Smckusick 	unsigned char	func;
483*53887Smckusick 	char		cursor_color;
484*53887Smckusick 	char		mask_color;
485*53887Smckusick 	lPoint		hot;
486*53887Smckusick 	lPoint		size;
487*53887Smckusick 	lRectangle	cursorRect;	/* Cursor Pattern Area */
488*53887Smckusick 	lRectangle	maskRect;	/* Mask Pattern Area */
489*53887Smckusick 	lRectangle	saveRect;	/* Save Pattern Area */
490*53887Smckusick 	lRectangle	moveArea;
491*53887Smckusick } lCursor;
492*53887Smckusick 
493*53887Smckusick typedef struct {
494*53887Smckusick 	unsigned char	func;
495*53887Smckusick 	int		cursor_color;
496*53887Smckusick 	int		mask_color;
497*53887Smckusick 	lPoint		hot;
498*53887Smckusick 	lPoint		size;
499*53887Smckusick 	lRectangle	cursorRect;	/* Cursor Pattern Area */
500*53887Smckusick 	lRectangle	maskRect;	/* Mask Pattern Area */
501*53887Smckusick 	lRectangle	saveRect;	/* Save Pattern Area */
502*53887Smckusick 	lRectangle	moveArea;
503*53887Smckusick } lCursor2;
504*53887Smckusick 
505*53887Smckusick typedef struct {
506*53887Smckusick 	int request;
507*53887Smckusick 	lPoint sp;
508*53887Smckusick 	lPoint dp;
509*53887Smckusick 	lPoint size;
510*53887Smckusick 	int refresh_rate;
511*53887Smckusick 	int func;
512*53887Smckusick 	int planemask;
513*53887Smckusick } lVideoCtl;
514*53887Smckusick 
515*53887Smckusick typedef struct {
516*53887Smckusick 	int request;
517*53887Smckusick 	int mode;
518*53887Smckusick 	int status;
519*53887Smckusick 	lRectangle vframe;
520*53887Smckusick 	int refresh_rate;
521*53887Smckusick 	int func;
522*53887Smckusick 	int planemask;
523*53887Smckusick } lVideoStatus;
524*53887Smckusick 
525*53887Smckusick /* Video Control Request */
526*53887Smckusick #define VIDEO_RESET     0x01
527*53887Smckusick #define VIDEO_RUN       0x02
528*53887Smckusick #define VIDEO_STOP      0x04
529*53887Smckusick #define VIDEO_CONT      0x08
530*53887Smckusick #define VIDEO_FRAME     0x10
531*53887Smckusick #define VIDEO_ROP       0x20
532*53887Smckusick 
533*53887Smckusick /* Video Status */
534*53887Smckusick #define VIDEO_STATUS    0x01
535*53887Smckusick 
536*53887Smckusick #define VIDEO_SIG_NTSC  0x01
537*53887Smckusick #define VIDEO_SIG_PAL   0x02
538*53887Smckusick 
539*53887Smckusick #define VIDEO_STATUS_RUN        1
540*53887Smckusick #define VIDEO_STATUS_STOP       2
541*53887Smckusick #define VIDEO_STATUS_ERROR      4
542*53887Smckusick 
543*53887Smckusick #define VIDEO_ERROR_SIZE        0x100
544*53887Smckusick #define VIDEO_ERROR_POINT       0x200
545*53887Smckusick #define VIDEO_ERROR_PARAM       0x400
546*53887Smckusick 
547*53887Smckusick typedef struct {
548*53887Smckusick 	int	request;
549*53887Smckusick 	int	param[8];
550*53887Smckusick } lFbIoctl;
551*53887Smckusick 
552*53887Smckusick 
553*53887Smckusick /* func */
554*53887Smckusick #define BF_0	0x0	/* 0 */
555*53887Smckusick #define BF_SDA	0x1	/* Src & Dest */
556*53887Smckusick #define BF_SDIA	0x2	/* Src & ~Dest */
557*53887Smckusick #define BF_S	0x3	/* Src */
558*53887Smckusick #define BF_SIDA	0x4	/* ~Src & Dest */
559*53887Smckusick #define BF_D	0x5	/* Dest */
560*53887Smckusick #define BF_SDX	0x6	/* Src ^ Dest */
561*53887Smckusick #define BF_SDO	0x7	/* Src | Dest */
562*53887Smckusick #define BF_SDOI	0x8	/* ~(Src | Dest) */
563*53887Smckusick #define BF_SDXI	0x9	/* ~(Src ^ Dest) */
564*53887Smckusick #define BF_DI	0xa	/* ~Dest */
565*53887Smckusick #define BF_SDIO	0xb	/* Src | ~Dest */
566*53887Smckusick #define BF_SI	0xc	/* ~Src */
567*53887Smckusick #define BF_SIDO	0xd	/* ~Src | Dest */
568*53887Smckusick #define BF_SDAI	0xe	/* ~(Src & Dest) */
569*53887Smckusick #define BF_1	0xf	/* 1 */
570*53887Smckusick 
571*53887Smckusick #define BF_NOP(f)	((f) == BF_D)
572*53887Smckusick #define BF_INV(f)	((f) == BF_DI)
573*53887Smckusick #define BF_CON(f)	((f) == BF_0 || (f) == BF_1)
574*53887Smckusick #define BF_SRC(f)	(!BF_NOP(f)&&!BF_INV(f)&&!BF_CON(f))
575*53887Smckusick 
576*53887Smckusick /* Bitmap Font Type */
577*53887Smckusick #define ROM_ASCII	0
578*53887Smckusick #define ROM_KANJI	1
579*53887Smckusick #define ASCII		2
580*53887Smckusick #define ROM_CONS	3
581*53887Smckusick 
582*53887Smckusick /* Plane Mask */
583*53887Smckusick #define FB_PLANEALL	0xffffff
584*53887Smckusick #define FB_PLANE0	0x000001
585*53887Smckusick #define FB_PLANE1	0x000002
586*53887Smckusick #define FB_PLANE2	0x000004
587*53887Smckusick #define FB_PLANE3	0x000008
588*53887Smckusick #define FB_PLANE4	0x000010
589*53887Smckusick #define FB_PLANE5	0x000020
590*53887Smckusick #define FB_PLANE6	0x000040
591*53887Smckusick #define FB_PLANE7	0x000080
592*53887Smckusick #define FB_PLANE8	0x000100
593*53887Smckusick #define FB_PLANE9	0x000200
594*53887Smckusick #define FB_PLANE10	0x000400
595*53887Smckusick #define FB_PLANE11	0x000800
596*53887Smckusick #define FB_PLANE12	0x001000
597*53887Smckusick #define FB_PLANE13	0x002000
598*53887Smckusick #define FB_PLANE14	0x004000
599*53887Smckusick #define FB_PLANE15	0x008000
600*53887Smckusick #define FB_PLANE16	0x010000
601*53887Smckusick #define FB_PLANE17	0x020000
602*53887Smckusick #define FB_PLANE18	0x040000
603*53887Smckusick #define FB_PLANE19	0x080000
604*53887Smckusick #define FB_PLANE20	0x100000
605*53887Smckusick #define FB_PLANE21	0x200000
606*53887Smckusick #define FB_PLANE22	0x400000
607*53887Smckusick #define FB_PLANE23	0x800000
608*53887Smckusick 
609*53887Smckusick /* Line Pattern */
610*53887Smckusick #define LINE_SLD	(unsigned)0xffffffff	/* solid */
611*53887Smckusick #define LINE_DSH	(unsigned)0xfcfcfcfc	/* dash */
612*53887Smckusick #define LINE_DOT	(unsigned)0xcccccccc	/* dot */
613*53887Smckusick #define LINE_DSHDOT	(unsigned)0xfff18fff	/* dash dot */
614*53887Smckusick #define LINE_DSHDOTDOT	(unsigned)0xff8c63ff	/* dash dot dot */
615*53887Smckusick 
616*53887Smckusick /*
617*53887Smckusick  * FB IOCTL
618*53887Smckusick  */
619*53887Smckusick #ifdef KERNEL
620*53887Smckusick #include "ioctl.h"
621*53887Smckusick #else /* KERNEL */
622*53887Smckusick #include <sys/ioctl.h>
623*53887Smckusick #endif /* KERNEL */
624*53887Smckusick 
625*53887Smckusick #define FBIOCSETSCR		_IOW('F', 0, int)
626*53887Smckusick #define FBIOCGETSCR		_IOR('F', 1, int)
627*53887Smckusick #define FBIOCSETDIM		_IOW('F', 2, int)
628*53887Smckusick #define FBIOCGETDIM		_IOR('F', 3, int)
629*53887Smckusick #define FBIOCSETSCRMODE		_IOW('F', 4, int)
630*53887Smckusick #define FBIOCGETSCRMODE		_IOR('F', 5, int)
631*53887Smckusick #define FBIOCAUTODIM		_IOW('F', 6, int)
632*53887Smckusick 
633*53887Smckusick #define FBIOCBITBLT 		_IOW('F', 10, sBitblt)
634*53887Smckusick #define FBIOCBATCHBITBLT	_IOW('F', 11, sBatchBitblt)
635*53887Smckusick #define FBIOCTILEBITBLT		_IOW('F', 12, sTileBitblt)
636*53887Smckusick #define FBIOCBITBLT3		_IOW('F', 13, sBitblt3)
637*53887Smckusick 
638*53887Smckusick #define FBIOCPOLYLINE		_IOW('F', 20, sPrimLine)
639*53887Smckusick #define FBIOCDJPOLYLINE		_IOW('F', 21, sPrimLine)
640*53887Smckusick #define FBIOCPOLYMARKER		_IOW('F', 22, sPrimMarker)
641*53887Smckusick #define FBIOCRECTANGLE		_IOW('F', 23, sPrimRect)
642*53887Smckusick #define FBIOCFILLSCAN		_IOW('F', 24, sPrimFill)
643*53887Smckusick #define FBIOCTEXT		_IOW('F', 25, sPrimText)
644*53887Smckusick #define FBIOCPOLYDOT		_IOW('F', 26, sPrimDot)
645*53887Smckusick 
646*53887Smckusick #define FBIOCGETSCRTYPE		_IOR('F', 30, sScrType)
647*53887Smckusick 
648*53887Smckusick /* for color display */
649*53887Smckusick #define FBIOCSETPALETTE		_IOW('F', 31, sPalette)
650*53887Smckusick #define FBIOCGETPALETTE		_IOWR('F', 32, sPalette)
651*53887Smckusick #define FBIOCSETDADDR		_IOW('F', 33, int)
652*53887Smckusick 
653*53887Smckusick #define FBIOCENABLE		_IO('F', 40)
654*53887Smckusick #define FBIOCDISABLE		_IO('F', 41)
655*53887Smckusick 
656*53887Smckusick #define FBIOCSETCURSOR		_IOW('F', 42, sCursor)
657*53887Smckusick #define FBIOCUNSETCURSOR	_IO('F', 43)
658*53887Smckusick #define FBIOCSHOWCURSOR		_IO('F', 44)
659*53887Smckusick #define FBIOCHIDECURSOR		_IO('F', 45)
660*53887Smckusick #define FBIOCSETXY		_IOW('F', 46, sPoint)
661*53887Smckusick 
662*53887Smckusick #define FBIOCNBITBLT 		_IOW('F', 50, lBitblt)
663*53887Smckusick #define FBIOCNBATCHBITBLT	_IOW('F', 51, lBatchBitblt)
664*53887Smckusick #define FBIOCNTILEBITBLT	_IOW('F', 52, lTileBitblt)
665*53887Smckusick #define FBIOCNBITBLT3		_IOW('F', 53, lBitblt3)
666*53887Smckusick 
667*53887Smckusick #define FBIOCNPOLYLINE		_IOW('F', 60, lPrimLine)
668*53887Smckusick #define FBIOCNDJPOLYLINE	_IOW('F', 61, lPrimLine)
669*53887Smckusick #define FBIOCNPOLYMARKER	_IOW('F', 62, lPrimMarker)
670*53887Smckusick #define FBIOCNRECTANGLE		_IOW('F', 63, lPrimRect)
671*53887Smckusick #define FBIOCNFILLSCAN		_IOW('F', 64, lPrimFill)
672*53887Smckusick #define FBIOCNTEXT		_IOW('F', 65, lPrimText)
673*53887Smckusick #define FBIOCNPOLYDOT		_IOW('F', 66, lPrimDot)
674*53887Smckusick 
675*53887Smckusick #define FBIOCNGETSCRTYPE	_IOR('F', 70, lScrType)
676*53887Smckusick #define FBIOCNSETPALETTE	_IOW('F', 71, lPalette)
677*53887Smckusick #define FBIOCNGETPALETTE	_IOWR('F', 72, lPalette)
678*53887Smckusick #define FBIOCNSETPALETTEMODE	_IOW('F', 73, int)
679*53887Smckusick #define FBIOCNGETPALETTEMODE	_IOR('F', 74, int)
680*53887Smckusick 
681*53887Smckusick #define FBIOCNSETCURSOR		_IOW('F', 80, lCursor)
682*53887Smckusick #define FBIOCNUNSETCURSOR	_IO('F', 81)
683*53887Smckusick #define FBIOCNSHOWCURSOR	_IO('F', 82)
684*53887Smckusick #define FBIOCNHIDECURSOR	_IO('F', 83)
685*53887Smckusick #define FBIOCNSETXY		_IOW('F', 84, lPoint)
686*53887Smckusick #define FBIOCNSETCURSOR2	_IOW('F', 85, lCursor2)
687*53887Smckusick 
688*53887Smckusick #define FBIOCNSETVIDEO		_IOW('F', 90, lVideoCtl)
689*53887Smckusick #define FBIOCNGETVIDEO		_IOR('F', 91, lVideoStatus)
690*53887Smckusick 
691*53887Smckusick #define FBIOCNIOCTL		_IOWR('F', 100, lFbIoctl)
692*53887Smckusick 
693*53887Smckusick #endif /* !__FRAMEBUF__ */
694