xref: /csrg-svn/sys/news3400/iop/framebuf.h (revision 63308)
153887Smckusick /*
2*63308Sbostic  * Copyright (c) 1992, 1993
3*63308Sbostic  *	The Regents of the University of California.  All rights reserved.
453887Smckusick  *
553887Smckusick  * This code is derived from software contributed to Berkeley by
653887Smckusick  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
753887Smckusick  *
853887Smckusick  * %sccs.include.redist.c%
953887Smckusick  *
1053887Smckusick  * from: $Hdr: framebuf.h,v 4.300 91/06/09 06:42:21 root Rel41 $ SONY
1153887Smckusick  *
12*63308Sbostic  *	@(#)framebuf.h	8.1 (Berkeley) 06/11/93
1353887Smckusick  */
1453887Smckusick 
1553887Smckusick #ifndef __FRAMEBUF__
1653887Smckusick #define __FRAMEBUF__ 1
1753887Smckusick 
1853887Smckusick typedef unsigned short	Word;
1953887Smckusick 
2053887Smckusick #define BitsPerWord	16
2153887Smckusick 
2253887Smckusick typedef struct {
2353887Smckusick 	short	x, y;
2453887Smckusick } sPoint;
2553887Smckusick 
2653887Smckusick typedef struct {
2753887Smckusick 	int	x, y;
2853887Smckusick } lPoint;
2953887Smckusick 
3053887Smckusick typedef struct {
3153887Smckusick 	sPoint	origin;
3253887Smckusick 	sPoint	extent;
3353887Smckusick } sRectangle;
3453887Smckusick 
3553887Smckusick typedef struct {
3653887Smckusick 	lPoint	origin;
3753887Smckusick 	lPoint	extent;
3853887Smckusick } lRectangle;
3953887Smckusick 
4053887Smckusick typedef struct {
4153887Smckusick 	char		type;	/* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */
4253887Smckusick 	char		depth;	/* bitmap depth */
4353887Smckusick 	unsigned short	width;	/* width in Words */
4453887Smckusick 	sRectangle	rect;	/* defined area */
4553887Smckusick 	Word		*base;	/* for BM_MEM */
4653887Smckusick } sBitmap;
4753887Smckusick 
4853887Smckusick typedef struct {
4953887Smckusick 	char		type;	/* BM_FB, BM_MEM, BM_0, BM_1 or BM_LBP */
5053887Smckusick 	char		depth;	/* bitmap depth */
5153887Smckusick 	unsigned short	width;	/* width in Words */
5253887Smckusick 	lRectangle	rect;	/* defined area */
5353887Smckusick 	Word		*base;	/* for BM_MEM */
5453887Smckusick } lBitmap;
5553887Smckusick 
5653887Smckusick #define BM_FB		0	/* frame buffer */
5753887Smckusick #define BM_MEM		1	/* bitmap in memory (XY format) */
5853887Smckusick #define BM_0		2	/* virtual bitmap of data '0' */
5953887Smckusick #define BM_1		3	/* virtual bitmap of data '1' */
6053887Smckusick #define BM_LBP		4	/* lbp page buffer (future support) */
6153887Smckusick 
6253887Smckusick /* 2 operand bitblt */
6353887Smckusick typedef struct {
6453887Smckusick 	unsigned char	func;		/* function code */
6553887Smckusick 	char		transp;		/* transparency */
6653887Smckusick 	int		fore_color;	/* foreground color */
6753887Smckusick 	int		aux_color;	/* auxiliary color */
6853887Smckusick 	int		planemask;	/* select plane */
6953887Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
7053887Smckusick 	sRectangle	srcRect;	/* source rectangle */
7153887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
7253887Smckusick 	sRectangle	destClip;	/* clip rectangle */
7353887Smckusick 	sPoint		destPoint;	/* destination point */
7453887Smckusick } sBitblt;
7553887Smckusick 
7653887Smckusick typedef struct {
7753887Smckusick 	unsigned char	func;		/* function code */
7853887Smckusick 	char		transp;		/* transparency */
7953887Smckusick 	int		fore_color;	/* foreground color */
8053887Smckusick 	int		aux_color;	/* auxiliary color */
8153887Smckusick 	int		planemask;	/* select plane */
8253887Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
8353887Smckusick 	lRectangle	srcRect;	/* source rectangle */
8453887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
8553887Smckusick 	lRectangle	destClip;	/* clip rectangle */
8653887Smckusick 	lPoint		destPoint;	/* destination point */
8753887Smckusick } lBitblt;
8853887Smckusick 
8953887Smckusick /* tile 2 operand bitblt */
9053887Smckusick typedef struct {
9153887Smckusick 	unsigned char	func;		/* function code */
9253887Smckusick 	char		transp;		/* transparency */
9353887Smckusick 	int		fore_color;	/* foreground color */
9453887Smckusick 	int		aux_color;	/* auxiliary color */
9553887Smckusick 	int		planemask;	/* select plane */
9653887Smckusick 	sBitmap		ptnBitmap;	/* pattern bitmap */
9753887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
9853887Smckusick 	sPoint		refPoint;	/* reference point */
9953887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
10053887Smckusick 	sRectangle	destClip;	/* clip rectangle */
10153887Smckusick 	sRectangle	destRect;	/* destination rectangle */
10253887Smckusick } sTileBitblt;
10353887Smckusick 
10453887Smckusick typedef struct {
10553887Smckusick 	unsigned char	func;		/* function code */
10653887Smckusick 	char		transp;		/* transparency */
10753887Smckusick 	int		fore_color;	/* foreground color */
10853887Smckusick 	int		aux_color;	/* auxiliary color */
10953887Smckusick 	int		planemask;	/* select plane */
11053887Smckusick 	lBitmap		ptnBitmap;	/* pattern bitmap */
11153887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
11253887Smckusick 	lPoint		refPoint;	/* reference point */
11353887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
11453887Smckusick 	lRectangle	destClip;	/* clip rectangle */
11553887Smckusick 	lRectangle	destRect;	/* destination rectangle */
11653887Smckusick } lTileBitblt;
11753887Smckusick 
11853887Smckusick /* 3 operand bitblt */
11953887Smckusick typedef struct {
12053887Smckusick 	unsigned char	func;		/* function code */
12153887Smckusick 	char		transp;		/* transparency */
12253887Smckusick 	int		fore_color;	/* foreground color */
12353887Smckusick 	int		aux_color;	/* auxiliary color */
12453887Smckusick 	int		planemask;	/* select plane */
12553887Smckusick 	sBitmap		ptnBitmap;	/* pattern bitmap */
12653887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
12753887Smckusick 	sPoint		refPoint;	/* reference point */
12853887Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
12953887Smckusick 	sRectangle	srcRect;	/* source rectangle */
13053887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
13153887Smckusick 	sRectangle	destClip;	/* clip rectangle */
13253887Smckusick 	sPoint		destPoint;	/* destination point */
13353887Smckusick } sBitblt3;
13453887Smckusick 
13553887Smckusick typedef struct {
13653887Smckusick 	unsigned char	func;		/* function code */
13753887Smckusick 	char		transp;		/* transparency */
13853887Smckusick 	int		fore_color;	/* foreground color */
13953887Smckusick 	int		aux_color;	/* auxiliary color */
14053887Smckusick 	int		planemask;	/* select plane */
14153887Smckusick 	lBitmap		ptnBitmap;	/* pattern bitmap */
14253887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
14353887Smckusick 	lPoint		refPoint;	/* reference point */
14453887Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
14553887Smckusick 	lRectangle	srcRect;	/* source rectangle */
14653887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
14753887Smckusick 	lRectangle	destClip;	/* clip rectangle */
14853887Smckusick 	lPoint		destPoint;	/* destination point */
14953887Smckusick } lBitblt3;
15053887Smckusick 
15153887Smckusick typedef struct {
15253887Smckusick 	sRectangle	srcRect;	/* source rectangle */
15353887Smckusick 	sPoint		destPoint;	/* destination point */
15453887Smckusick } sSrcDest;
15553887Smckusick 
15653887Smckusick typedef struct {
15753887Smckusick 	lRectangle	srcRect;	/* source rectangle */
15853887Smckusick 	lPoint		destPoint;	/* destination point */
15953887Smckusick } lSrcDest;
16053887Smckusick 
16153887Smckusick /*
16253887Smckusick  * batch bitblt
16353887Smckusick  */
16453887Smckusick typedef struct {
16553887Smckusick 	unsigned char	func;		/* function code */
16653887Smckusick 	char		transp;		/* transparency */
16753887Smckusick 	int		fore_color;	/* foreground color */
16853887Smckusick 	int		aux_color;	/* auxiliary color */
16953887Smckusick 	int		planemask;	/* select plane */
17053887Smckusick 	sBitmap		srcBitmap;	/* source bitmap */
17153887Smckusick 	sBitmap		destBitmap;	/* destination bitmap */
17253887Smckusick 	sRectangle	destClip;	/* clip rectangle */
17353887Smckusick 	int		nSrcDest;	/* number of src-dest in list */
17453887Smckusick 	sSrcDest	*srcDestList;	/* pointer to src-dest spec */
17553887Smckusick } sBatchBitblt;
17653887Smckusick 
17753887Smckusick typedef struct {
17853887Smckusick 	unsigned char	func;		/* function code */
17953887Smckusick 	char		transp;		/* transparency */
18053887Smckusick 	int		fore_color;	/* foreground color */
18153887Smckusick 	int		aux_color;	/* auxiliary color */
18253887Smckusick 	int		planemask;	/* select plane */
18353887Smckusick 	lBitmap		srcBitmap;	/* source bitmap */
18453887Smckusick 	lBitmap		destBitmap;	/* destination bitmap */
18553887Smckusick 	lRectangle	destClip;	/* clip rectangle */
18653887Smckusick 	int		nSrcDest;	/* number of src-dest in list */
18753887Smckusick 	lSrcDest	*srcDestList;	/* pointer to src-dest spec */
18853887Smckusick } lBatchBitblt;
18953887Smckusick 
19053887Smckusick #define MAX_BATCHBITBLT	1024		/* max number in src-dest list */
19153887Smckusick 
19253887Smckusick /*
19353887Smckusick  * set screen mode
19453887Smckusick  */
19553887Smckusick 
19653887Smckusick #define BLACK_ON_WHITE	0	/* white - 0, black - 1 (default) */
19753887Smckusick #define WHITE_ON_BLACK	1	/* white - 1, black - 0 */
19853887Smckusick 
19953887Smckusick /*
20053887Smckusick  * graphic primitive drawing
20153887Smckusick  */
20253887Smckusick 
20353887Smckusick /* scan line array */
20453887Smckusick typedef struct {
20553887Smckusick 	short	y;
20653887Smckusick 	short	x0, x1;		/* x0 <= x1 */
20753887Smckusick } sScanl;
20853887Smckusick 
20953887Smckusick typedef struct {
21053887Smckusick 	int	y;
21153887Smckusick 	int	x0, x1;		/* x0 <= x1 */
21253887Smckusick } lScanl;
21353887Smckusick 
21453887Smckusick /* line */
21553887Smckusick typedef struct {
21653887Smckusick 	unsigned int	lptn;		/* line pattern */
21753887Smckusick 	short		np;		/* number of points */
21853887Smckusick 	sPoint		*plist;		/* point list */
21953887Smckusick 	int		fore_color;	/* foreground color */
22053887Smckusick 	int		aux_color;	/* auxiliary color */
22153887Smckusick 	int		planemask;	/* select plane */
22253887Smckusick 	char		transp;		/* transparency */
22353887Smckusick 	unsigned char	func;		/* rop function code */
22453887Smckusick 	char		dlpf;		/* draw last point flag */
22553887Smckusick 	sRectangle	clip;		/* clip rectangle */
22653887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
22753887Smckusick } sPrimLine;
22853887Smckusick 
22953887Smckusick typedef struct {
23053887Smckusick 	unsigned int	lptn;		/* line pattern */
23153887Smckusick 	short		np;		/* number of points */
23253887Smckusick 	lPoint		*plist;		/* point list */
23353887Smckusick 	int		fore_color;	/* foreground color */
23453887Smckusick 	int		aux_color;	/* auxiliary color */
23553887Smckusick 	int		planemask;	/* select plane */
23653887Smckusick 	char		transp;		/* transparency */
23753887Smckusick 	unsigned char	func;		/* rop function code */
23853887Smckusick 	char		dlpf;		/* draw last point flag */
23953887Smckusick 	lRectangle	clip;		/* clip rectangle */
24053887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
24153887Smckusick } lPrimLine;
24253887Smckusick 
24353887Smckusick /* rectangle filling */
24453887Smckusick typedef struct {
24553887Smckusick 	sRectangle	rect;		/* rectangle */
24653887Smckusick 	sPoint		refPoint;	/* fill reference point */
24753887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
24853887Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
24953887Smckusick 	int		fore_color;	/* foreground color */
25053887Smckusick 	int		aux_color;	/* auxiliary color */
25153887Smckusick 	int		planemask;	/* select plane */
25253887Smckusick 	char		transp;		/* transparency */
25353887Smckusick 	unsigned char	func;		/* rop function code */
25453887Smckusick 	sRectangle	clip;		/* clip rectangle */
25553887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
25653887Smckusick } sPrimRect;
25753887Smckusick 
25853887Smckusick typedef struct {
25953887Smckusick 	lRectangle	rect;		/* rectangle */
26053887Smckusick 	lPoint		refPoint;	/* fill reference point */
26153887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
26253887Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
26353887Smckusick 	int		fore_color;	/* foreground color */
26453887Smckusick 	int		aux_color;	/* auxiliary color */
26553887Smckusick 	int		planemask;	/* select plane */
26653887Smckusick 	char		transp;		/* transparency */
26753887Smckusick 	unsigned char	func;		/* rop function code */
26853887Smckusick 	lRectangle	clip;		/* clip rectangle */
26953887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
27053887Smckusick } lPrimRect;
27153887Smckusick 
27253887Smckusick /* pattern filling */
27353887Smckusick typedef struct {
27453887Smckusick 	short		nscan;		/* number of scan element */
27553887Smckusick 	sScanl		*scan;		/* scan line data */
27653887Smckusick 	sPoint		refPoint;	/* fill reference point */
27753887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
27853887Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
27953887Smckusick 	int		fore_color;	/* foreground color */
28053887Smckusick 	int		aux_color;	/* auxiliary color */
28153887Smckusick 	int		planemask;	/* select plane */
28253887Smckusick 	char		transp;		/* transparency */
28353887Smckusick 	unsigned char	func;		/* rop function code */
28453887Smckusick 	sRectangle	clip;		/* clip rectangle */
28553887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
28653887Smckusick } sPrimFill;
28753887Smckusick 
28853887Smckusick typedef struct {
28953887Smckusick 	short		nscan;		/* number of scan element */
29053887Smckusick 	lScanl		*scan;		/* scan line data */
29153887Smckusick 	lPoint		refPoint;	/* fill reference point */
29253887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
29353887Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
29453887Smckusick 	int		fore_color;	/* foreground color */
29553887Smckusick 	int		aux_color;	/* auxiliary color */
29653887Smckusick 	int		planemask;	/* select plane */
29753887Smckusick 	char		transp;		/* transparency */
29853887Smckusick 	unsigned char	func;		/* rop function code */
29953887Smckusick 	lRectangle	clip;		/* clip rectangle */
30053887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
30153887Smckusick } lPrimFill;
30253887Smckusick 
30353887Smckusick /* marker */
30453887Smckusick typedef struct {
30553887Smckusick 	short		np;		/* number of points */
30653887Smckusick 	sPoint		*plist;		/* point list */
30753887Smckusick 	sRectangle	ptnRect;	/* pattern rectangle */
30853887Smckusick 	sBitmap		ptnBM;		/* pattern bitmap */
30953887Smckusick 	int		fore_color;	/* foreground color */
31053887Smckusick 	int		aux_color;	/* auxiliary color */
31153887Smckusick 	int		planemask;	/* select plane */
31253887Smckusick 	char		transp;		/* transparency */
31353887Smckusick 	unsigned char	func;		/* rop function code */
31453887Smckusick 	sRectangle	clip;		/* clip rectangle */
31553887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
31653887Smckusick } sPrimMarker;
31753887Smckusick 
31853887Smckusick typedef struct {
31953887Smckusick 	short		np;		/* number of points */
32053887Smckusick 	lPoint		*plist;		/* point list */
32153887Smckusick 	lRectangle	ptnRect;	/* pattern rectangle */
32253887Smckusick 	lBitmap		ptnBM;		/* pattern bitmap */
32353887Smckusick 	int		fore_color;	/* foreground color */
32453887Smckusick 	int		aux_color;	/* auxiliary color */
32553887Smckusick 	int		planemask;	/* select plane */
32653887Smckusick 	char		transp;		/* transparency */
32753887Smckusick 	unsigned char	func;		/* rop function code */
32853887Smckusick 	lRectangle	clip;		/* clip rectangle */
32953887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
33053887Smckusick } lPrimMarker;
33153887Smckusick 
33253887Smckusick /* text */
33353887Smckusick #define MAX_STRING	1024
33453887Smckusick 
33553887Smckusick typedef struct {
33653887Smckusick 	char		type;		/* ROM-font, etc */
33753887Smckusick 	short		len;		/* string length (byte) */
33853887Smckusick 	unsigned char	*str;		/* string */
33953887Smckusick 	sPoint		p;
34053887Smckusick 	int		dx, dy;		/* vector (16bit left shifted) */
34153887Smckusick 	char		ex_factor;	/* expansion factor */
34253887Smckusick 	sPoint		fp;		/* bitmap font upper-left */
34353887Smckusick 	short		width, height;	/* font width, font height */
34453887Smckusick 	short		column;		/* number of characters in a row */
34553887Smckusick 	unsigned short	first_chr;	/* first character code */
34653887Smckusick 	unsigned short	last_chr;	/* last character code */
34753887Smckusick 	sBitmap		fontBM;		/* font bitmap */
34853887Smckusick 	int		fore_color;	/* foreground color */
34953887Smckusick 	int		aux_color;	/* auxiliary color */
35053887Smckusick 	int		planemask;	/* select plane */
35153887Smckusick 	char		transp;		/* transparency */
35253887Smckusick 	unsigned char	func;		/* rop function code */
35353887Smckusick 	sRectangle	clip;		/* clip rectangle */
35453887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
35553887Smckusick } sPrimText;
35653887Smckusick 
35753887Smckusick typedef struct {
35853887Smckusick 	int		dx, dy;		/* vector (16bit left shifted) */
35953887Smckusick 	lPoint		fp;		/* bitmap font upper-left */
36053887Smckusick 	short		width, height;	/* font width, font height */
36153887Smckusick 	short		column;		/* number of characters in a row */
36253887Smckusick 	unsigned short	first_chr;	/* first character code */
36353887Smckusick 	unsigned short	last_chr;	/* last character code */
36453887Smckusick 	lBitmap		fontBM;		/* font bitmap */
36553887Smckusick 	int		fore_color;	/* foreground color */
36653887Smckusick 	int		aux_color;	/* auxiliary color */
36753887Smckusick 	int		planemask;	/* select plane */
36853887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
36953887Smckusick 	lRectangle	clip;		/* clip rectangle */
37053887Smckusick 	lPoint		p;		/* output position */
37153887Smckusick 	unsigned char	*str;		/* string */
37253887Smckusick 	short		len;		/* string length (byte) */
37353887Smckusick 	char		type;		/* ROM-font, etc */
37453887Smckusick 	char		transp;		/* transparency */
37553887Smckusick 	unsigned char	func;		/* rop function code */
37653887Smckusick 	char		ex_factor;	/* expansion factor */
37753887Smckusick } lPrimText;
37853887Smckusick 
37953887Smckusick /* dot */
38053887Smckusick typedef struct {
38153887Smckusick 	short		np;		/* number of points */
38253887Smckusick 	sPoint		*plist;		/* point list */
38353887Smckusick 	int		fore_color;	/* foreground color */
38453887Smckusick 	int		aux_color;	/* auxiliary color */
38553887Smckusick 	int		planemask;	/* select plane */
38653887Smckusick 	char		transp;		/* transparency */
38753887Smckusick 	unsigned char	func;		/* rop function code */
38853887Smckusick 	sRectangle	clip;		/* clip rectangle */
38953887Smckusick 	sBitmap		drawBM;		/* drawing bitmap */
39053887Smckusick } sPrimDot;
39153887Smckusick 
39253887Smckusick typedef struct {
39353887Smckusick 	short		np;		/* number of points */
39453887Smckusick 	lPoint		*plist;		/* point list */
39553887Smckusick 	int		fore_color;	/* foreground color */
39653887Smckusick 	int		aux_color;	/* auxiliary color */
39753887Smckusick 	int		planemask;	/* select plane */
39853887Smckusick 	char		transp;		/* transparency */
39953887Smckusick 	unsigned char	func;		/* rop function code */
40053887Smckusick 	lRectangle	clip;		/* clip rectangle */
40153887Smckusick 	lBitmap		drawBM;		/* drawing bitmap */
40253887Smckusick } lPrimDot;
40353887Smckusick 
40453887Smckusick /*
40553887Smckusick  *	screen type
40653887Smckusick  */
40753887Smckusick typedef struct {
40853887Smckusick 	short		colorwidth;	/* palette color width */
40953887Smckusick 	short		plane;		/* number of planes */
41053887Smckusick 	sRectangle	bufferrect;	/* framebuffer region */
41153887Smckusick 	sRectangle	visiblerect;	/* visible screen region */
41253887Smckusick } sScrType;
41353887Smckusick 
41453887Smckusick typedef struct {
41553887Smckusick 	short		colorwidth;	/* palette color width */
41653887Smckusick 	short		plane;		/* number of planes */
41753887Smckusick 	char		type;		/* device type */
41853887Smckusick 	char		unit;		/* unit no */
41953887Smckusick 	lRectangle	bufferrect;	/* framebuffer region */
42053887Smckusick 	lRectangle	visiblerect;	/* visible screen region */
42153887Smckusick } lScrType;
42253887Smckusick 
42353887Smckusick /* device type */
42453887Smckusick #define	FB_NWB512	1	/* fb is B/W bitmap display (816x1024) */
42553887Smckusick #define	FB_NWB225	2	/* fb is color bitmap display (1280x1024) */
42653887Smckusick #define	FB_POPM		3	/* fb is B/W bitmap display (816x1024) */
42753887Smckusick #define	FB_POPC		4	/* fb is color bitmap display (1024x768) */
42853887Smckusick #define FB_NWB514	5	/* fb is GrayScale bitmap display (1280x1280) */
42953887Smckusick #define FB_NWB251	6	/* fb is New color bitmap display (1280x1024) */
43053887Smckusick #define	FB_LCDM		7	/* fb is lcd bitmap (1120x780) */
43153887Smckusick #define	FB_LCDC		8	/* fb is LCD color bitmap display (?) */
43253887Smckusick #define	FB_NWB518	9	/* fb is B/W bitmap display (1024x768) */
43353887Smckusick #define	FB_NWB252	10	/* fb is color bitmap display (1024x768) */
43453887Smckusick #define	FB_NWB253	11	/* fb is B/W bitmap display (816x1024) */
43553887Smckusick #define	FB_NWB254	12	/* fb is color bitmap display (1024x768) */
43653887Smckusick #define	FB_NWB255	13	/* fb is B/W bitmap display (1280x1280) */
43753887Smckusick #define	FB_SLB101	14	/* fb is color bitmap display (1920x1035) */
43853887Smckusick #define FB_NWB256	15	/* fb is 3D-Rendaring Board (1280x1024) */
43953887Smckusick #define	FB_NWB257	16	/* fb is color bitmap display (1280x1024) */
44053887Smckusick 
44153887Smckusick #define FB_NWB240	200	/* fb is A3 LPB/IR interface (3136x4516) */
44253887Smckusick #define FB_NWB241	201	/* fb is A4 LBP/IR interface (3904x5600) */
44353887Smckusick #define FB_NWB242	202	/* fb is A3 Image Processor (3136x4516) */
44453887Smckusick 
44553887Smckusick #define FB_FB2015	254	/* fb is full color big display (2048x1536) */
44653887Smckusick #define FB_FB2020	255	/* fb is full color big display (2048x2048) */
44753887Smckusick 
44853887Smckusick #define FB_MONO0	1	/* fb is B/W (compat-3.0) */
44953887Smckusick #define FB_COLOR0	2	/* fb is color (compat-3.0) */
45053887Smckusick 
45153887Smckusick /*
45253887Smckusick  *	color
45353887Smckusick  */
45453887Smckusick typedef struct {
45553887Smckusick 	short	index;		/* palette number */
45653887Smckusick 	struct {
45753887Smckusick 		short	r, g, b;
45853887Smckusick 	} rgb;
45953887Smckusick } sPalette;
46053887Smckusick 
46153887Smckusick typedef struct {
46253887Smckusick 	int		count;
46353887Smckusick 	sPalette	*palette;
46453887Smckusick } lPalette;
46553887Smckusick 
46653887Smckusick /*
46753887Smckusick  *	cursor
46853887Smckusick  */
46953887Smckusick typedef struct {
47053887Smckusick 	unsigned char	func;
47153887Smckusick 	char		cursor_color;
47253887Smckusick 	char		mask_color;
47353887Smckusick 	sPoint		hot;
47453887Smckusick 	sPoint		size;
47553887Smckusick 	sRectangle	cursorRect;	/* Cursor Pattern rea */
47653887Smckusick 	sRectangle	maskRect;	/* Mask Pattern Area */
47753887Smckusick 	sRectangle	saveRect;	/* Save Pattern Area */
47853887Smckusick 	sRectangle	moveArea;
47953887Smckusick } sCursor;
48053887Smckusick 
48153887Smckusick typedef struct {
48253887Smckusick 	unsigned char	func;
48353887Smckusick 	char		cursor_color;
48453887Smckusick 	char		mask_color;
48553887Smckusick 	lPoint		hot;
48653887Smckusick 	lPoint		size;
48753887Smckusick 	lRectangle	cursorRect;	/* Cursor Pattern Area */
48853887Smckusick 	lRectangle	maskRect;	/* Mask Pattern Area */
48953887Smckusick 	lRectangle	saveRect;	/* Save Pattern Area */
49053887Smckusick 	lRectangle	moveArea;
49153887Smckusick } lCursor;
49253887Smckusick 
49353887Smckusick typedef struct {
49453887Smckusick 	unsigned char	func;
49553887Smckusick 	int		cursor_color;
49653887Smckusick 	int		mask_color;
49753887Smckusick 	lPoint		hot;
49853887Smckusick 	lPoint		size;
49953887Smckusick 	lRectangle	cursorRect;	/* Cursor Pattern Area */
50053887Smckusick 	lRectangle	maskRect;	/* Mask Pattern Area */
50153887Smckusick 	lRectangle	saveRect;	/* Save Pattern Area */
50253887Smckusick 	lRectangle	moveArea;
50353887Smckusick } lCursor2;
50453887Smckusick 
50553887Smckusick typedef struct {
50653887Smckusick 	int request;
50753887Smckusick 	lPoint sp;
50853887Smckusick 	lPoint dp;
50953887Smckusick 	lPoint size;
51053887Smckusick 	int refresh_rate;
51153887Smckusick 	int func;
51253887Smckusick 	int planemask;
51353887Smckusick } lVideoCtl;
51453887Smckusick 
51553887Smckusick typedef struct {
51653887Smckusick 	int request;
51753887Smckusick 	int mode;
51853887Smckusick 	int status;
51953887Smckusick 	lRectangle vframe;
52053887Smckusick 	int refresh_rate;
52153887Smckusick 	int func;
52253887Smckusick 	int planemask;
52353887Smckusick } lVideoStatus;
52453887Smckusick 
52553887Smckusick /* Video Control Request */
52653887Smckusick #define VIDEO_RESET     0x01
52753887Smckusick #define VIDEO_RUN       0x02
52853887Smckusick #define VIDEO_STOP      0x04
52953887Smckusick #define VIDEO_CONT      0x08
53053887Smckusick #define VIDEO_FRAME     0x10
53153887Smckusick #define VIDEO_ROP       0x20
53253887Smckusick 
53353887Smckusick /* Video Status */
53453887Smckusick #define VIDEO_STATUS    0x01
53553887Smckusick 
53653887Smckusick #define VIDEO_SIG_NTSC  0x01
53753887Smckusick #define VIDEO_SIG_PAL   0x02
53853887Smckusick 
53953887Smckusick #define VIDEO_STATUS_RUN        1
54053887Smckusick #define VIDEO_STATUS_STOP       2
54153887Smckusick #define VIDEO_STATUS_ERROR      4
54253887Smckusick 
54353887Smckusick #define VIDEO_ERROR_SIZE        0x100
54453887Smckusick #define VIDEO_ERROR_POINT       0x200
54553887Smckusick #define VIDEO_ERROR_PARAM       0x400
54653887Smckusick 
54753887Smckusick typedef struct {
54853887Smckusick 	int	request;
54953887Smckusick 	int	param[8];
55053887Smckusick } lFbIoctl;
55153887Smckusick 
55253887Smckusick 
55353887Smckusick /* func */
55453887Smckusick #define BF_0	0x0	/* 0 */
55553887Smckusick #define BF_SDA	0x1	/* Src & Dest */
55653887Smckusick #define BF_SDIA	0x2	/* Src & ~Dest */
55753887Smckusick #define BF_S	0x3	/* Src */
55853887Smckusick #define BF_SIDA	0x4	/* ~Src & Dest */
55953887Smckusick #define BF_D	0x5	/* Dest */
56053887Smckusick #define BF_SDX	0x6	/* Src ^ Dest */
56153887Smckusick #define BF_SDO	0x7	/* Src | Dest */
56253887Smckusick #define BF_SDOI	0x8	/* ~(Src | Dest) */
56353887Smckusick #define BF_SDXI	0x9	/* ~(Src ^ Dest) */
56453887Smckusick #define BF_DI	0xa	/* ~Dest */
56553887Smckusick #define BF_SDIO	0xb	/* Src | ~Dest */
56653887Smckusick #define BF_SI	0xc	/* ~Src */
56753887Smckusick #define BF_SIDO	0xd	/* ~Src | Dest */
56853887Smckusick #define BF_SDAI	0xe	/* ~(Src & Dest) */
56953887Smckusick #define BF_1	0xf	/* 1 */
57053887Smckusick 
57153887Smckusick #define BF_NOP(f)	((f) == BF_D)
57253887Smckusick #define BF_INV(f)	((f) == BF_DI)
57353887Smckusick #define BF_CON(f)	((f) == BF_0 || (f) == BF_1)
57453887Smckusick #define BF_SRC(f)	(!BF_NOP(f)&&!BF_INV(f)&&!BF_CON(f))
57553887Smckusick 
57653887Smckusick /* Bitmap Font Type */
57753887Smckusick #define ROM_ASCII	0
57853887Smckusick #define ROM_KANJI	1
57953887Smckusick #define ASCII		2
58053887Smckusick #define ROM_CONS	3
58153887Smckusick 
58253887Smckusick /* Plane Mask */
58353887Smckusick #define FB_PLANEALL	0xffffff
58453887Smckusick #define FB_PLANE0	0x000001
58553887Smckusick #define FB_PLANE1	0x000002
58653887Smckusick #define FB_PLANE2	0x000004
58753887Smckusick #define FB_PLANE3	0x000008
58853887Smckusick #define FB_PLANE4	0x000010
58953887Smckusick #define FB_PLANE5	0x000020
59053887Smckusick #define FB_PLANE6	0x000040
59153887Smckusick #define FB_PLANE7	0x000080
59253887Smckusick #define FB_PLANE8	0x000100
59353887Smckusick #define FB_PLANE9	0x000200
59453887Smckusick #define FB_PLANE10	0x000400
59553887Smckusick #define FB_PLANE11	0x000800
59653887Smckusick #define FB_PLANE12	0x001000
59753887Smckusick #define FB_PLANE13	0x002000
59853887Smckusick #define FB_PLANE14	0x004000
59953887Smckusick #define FB_PLANE15	0x008000
60053887Smckusick #define FB_PLANE16	0x010000
60153887Smckusick #define FB_PLANE17	0x020000
60253887Smckusick #define FB_PLANE18	0x040000
60353887Smckusick #define FB_PLANE19	0x080000
60453887Smckusick #define FB_PLANE20	0x100000
60553887Smckusick #define FB_PLANE21	0x200000
60653887Smckusick #define FB_PLANE22	0x400000
60753887Smckusick #define FB_PLANE23	0x800000
60853887Smckusick 
60953887Smckusick /* Line Pattern */
61053887Smckusick #define LINE_SLD	(unsigned)0xffffffff	/* solid */
61153887Smckusick #define LINE_DSH	(unsigned)0xfcfcfcfc	/* dash */
61253887Smckusick #define LINE_DOT	(unsigned)0xcccccccc	/* dot */
61353887Smckusick #define LINE_DSHDOT	(unsigned)0xfff18fff	/* dash dot */
61453887Smckusick #define LINE_DSHDOTDOT	(unsigned)0xff8c63ff	/* dash dot dot */
61553887Smckusick 
61653887Smckusick /*
61753887Smckusick  * FB IOCTL
61853887Smckusick  */
61953887Smckusick #include <sys/ioctl.h>
62053887Smckusick 
62153887Smckusick #define FBIOCSETSCR		_IOW('F', 0, int)
62253887Smckusick #define FBIOCGETSCR		_IOR('F', 1, int)
62353887Smckusick #define FBIOCSETDIM		_IOW('F', 2, int)
62453887Smckusick #define FBIOCGETDIM		_IOR('F', 3, int)
62553887Smckusick #define FBIOCSETSCRMODE		_IOW('F', 4, int)
62653887Smckusick #define FBIOCGETSCRMODE		_IOR('F', 5, int)
62753887Smckusick #define FBIOCAUTODIM		_IOW('F', 6, int)
62853887Smckusick 
62953887Smckusick #define FBIOCBITBLT 		_IOW('F', 10, sBitblt)
63053887Smckusick #define FBIOCBATCHBITBLT	_IOW('F', 11, sBatchBitblt)
63153887Smckusick #define FBIOCTILEBITBLT		_IOW('F', 12, sTileBitblt)
63253887Smckusick #define FBIOCBITBLT3		_IOW('F', 13, sBitblt3)
63353887Smckusick 
63453887Smckusick #define FBIOCPOLYLINE		_IOW('F', 20, sPrimLine)
63553887Smckusick #define FBIOCDJPOLYLINE		_IOW('F', 21, sPrimLine)
63653887Smckusick #define FBIOCPOLYMARKER		_IOW('F', 22, sPrimMarker)
63753887Smckusick #define FBIOCRECTANGLE		_IOW('F', 23, sPrimRect)
63853887Smckusick #define FBIOCFILLSCAN		_IOW('F', 24, sPrimFill)
63953887Smckusick #define FBIOCTEXT		_IOW('F', 25, sPrimText)
64053887Smckusick #define FBIOCPOLYDOT		_IOW('F', 26, sPrimDot)
64153887Smckusick 
64253887Smckusick #define FBIOCGETSCRTYPE		_IOR('F', 30, sScrType)
64353887Smckusick 
64453887Smckusick /* for color display */
64553887Smckusick #define FBIOCSETPALETTE		_IOW('F', 31, sPalette)
64653887Smckusick #define FBIOCGETPALETTE		_IOWR('F', 32, sPalette)
64753887Smckusick #define FBIOCSETDADDR		_IOW('F', 33, int)
64853887Smckusick 
64953887Smckusick #define FBIOCENABLE		_IO('F', 40)
65053887Smckusick #define FBIOCDISABLE		_IO('F', 41)
65153887Smckusick 
65253887Smckusick #define FBIOCSETCURSOR		_IOW('F', 42, sCursor)
65353887Smckusick #define FBIOCUNSETCURSOR	_IO('F', 43)
65453887Smckusick #define FBIOCSHOWCURSOR		_IO('F', 44)
65553887Smckusick #define FBIOCHIDECURSOR		_IO('F', 45)
65653887Smckusick #define FBIOCSETXY		_IOW('F', 46, sPoint)
65753887Smckusick 
65853887Smckusick #define FBIOCNBITBLT 		_IOW('F', 50, lBitblt)
65953887Smckusick #define FBIOCNBATCHBITBLT	_IOW('F', 51, lBatchBitblt)
66053887Smckusick #define FBIOCNTILEBITBLT	_IOW('F', 52, lTileBitblt)
66153887Smckusick #define FBIOCNBITBLT3		_IOW('F', 53, lBitblt3)
66253887Smckusick 
66353887Smckusick #define FBIOCNPOLYLINE		_IOW('F', 60, lPrimLine)
66453887Smckusick #define FBIOCNDJPOLYLINE	_IOW('F', 61, lPrimLine)
66553887Smckusick #define FBIOCNPOLYMARKER	_IOW('F', 62, lPrimMarker)
66653887Smckusick #define FBIOCNRECTANGLE		_IOW('F', 63, lPrimRect)
66753887Smckusick #define FBIOCNFILLSCAN		_IOW('F', 64, lPrimFill)
66853887Smckusick #define FBIOCNTEXT		_IOW('F', 65, lPrimText)
66953887Smckusick #define FBIOCNPOLYDOT		_IOW('F', 66, lPrimDot)
67053887Smckusick 
67153887Smckusick #define FBIOCNGETSCRTYPE	_IOR('F', 70, lScrType)
67253887Smckusick #define FBIOCNSETPALETTE	_IOW('F', 71, lPalette)
67353887Smckusick #define FBIOCNGETPALETTE	_IOWR('F', 72, lPalette)
67453887Smckusick #define FBIOCNSETPALETTEMODE	_IOW('F', 73, int)
67553887Smckusick #define FBIOCNGETPALETTEMODE	_IOR('F', 74, int)
67653887Smckusick 
67753887Smckusick #define FBIOCNSETCURSOR		_IOW('F', 80, lCursor)
67853887Smckusick #define FBIOCNUNSETCURSOR	_IO('F', 81)
67953887Smckusick #define FBIOCNSHOWCURSOR	_IO('F', 82)
68053887Smckusick #define FBIOCNHIDECURSOR	_IO('F', 83)
68153887Smckusick #define FBIOCNSETXY		_IOW('F', 84, lPoint)
68253887Smckusick #define FBIOCNSETCURSOR2	_IOW('F', 85, lCursor2)
68353887Smckusick 
68453887Smckusick #define FBIOCNSETVIDEO		_IOW('F', 90, lVideoCtl)
68553887Smckusick #define FBIOCNGETVIDEO		_IOR('F', 91, lVideoStatus)
68653887Smckusick 
68753887Smckusick #define FBIOCNIOCTL		_IOWR('F', 100, lFbIoctl)
68853887Smckusick 
68953887Smckusick #endif /* !__FRAMEBUF__ */
690