xref: /csrg-svn/sys/news3400/iop/fbreg.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: fbreg.h,v 4.300 91/06/27 20:43:07 root Rel41 $ SONY
1153887Smckusick  *
12*63308Sbostic  *	@(#)fbreg.h	8.1 (Berkeley) 06/11/93
1353887Smckusick  */
1453887Smckusick 
1553887Smckusick #ifdef KERNEL
1653887Smckusick 
1753887Smckusick struct fb_softc {
1853887Smckusick 	int	fbs_state;
1953887Smckusick 	int	fbs_device;
2053887Smckusick 	lScrType fbs_type;
2153887Smckusick 	int	fbs_flag;
2253887Smckusick };
2353887Smckusick 
2453887Smckusick #if defined(news3200) || defined(news3400)
2553887Smckusick #define	splfb		spl3
2653887Smckusick #endif
2753887Smckusick #ifdef news3800
2853887Smckusick #define	splfb		spl4
2953887Smckusick #endif
3053887Smckusick 
3153887Smckusick /*
3253887Smckusick  * state of fbstate
3353887Smckusick  */
3453887Smckusick #define	FB_BUSY		01	/* fb is busy */
3553887Smckusick #define FB_WANTED	02	/* fb is wanted */
3653887Smckusick #define FB_WAIT		04	/* fb is waiting for command complete */
3753887Smckusick #define FB_DELAY	010	/* fb is busy, but not wait (inner ioctl) */
3853887Smckusick #define FB_DELAY2	020	/* fb is busy, but not wait (outer ioctl) */
3953887Smckusick 
4053887Smckusick /*
4153887Smckusick  * physical page map for IOP
4253887Smckusick  */
4353887Smckusick #define FB_MAX_IO	(2048*1024)	/* 2048 KB */
4453887Smckusick #define NFBMAP	(FB_MAX_IO / NBPG + 1)	/* maximum number of pages */
4553887Smckusick 
4653887Smckusick struct fb_map {
4753887Smckusick 	caddr_t		fm_vaddr;	/* virtual address */
4853887Smckusick 	unsigned	fm_offset;	/* offset into first page */
4953887Smckusick 	unsigned	fm_count;	/* byte counts */
5053887Smckusick 	caddr_t		fm_addr[NFBMAP]; /* first addr into page */
5153887Smckusick };
5253887Smckusick 
5353887Smckusick extern struct fb_map	fbmap[];
5453887Smckusick 
5553887Smckusick /*
5653887Smckusick  * fbreg definition
5753887Smckusick  */
5853887Smckusick struct fbreg {
5953887Smckusick 	u_char	fb_command;	/* command byte */
6053887Smckusick 	u_char	fb_result;	/* result byte */
6153887Smckusick 	u_char	fb_device;	/* device type */
6253887Smckusick 	u_char	fb_unit;	/* unit no */
6353887Smckusick 
6453887Smckusick 	union {
6558624Sutashiro 	    lBitblt	_fb_bitblt;		/* bitblt command */
6658624Sutashiro 	    lBatchBitblt _fb_batchbitblt;	/* batch bitblt command */
6758624Sutashiro 	    lTileBitblt	_fb_tilebitblt;		/* tile bitblt command */
6858624Sutashiro 	    lBitblt3	_fb_bitblt3;		/* 3 operand bitblt command */
6958624Sutashiro 	    lPrimLine	_fb_polyline;		/* (disjoint) polyline */
7058624Sutashiro 	    lPrimRect	_fb_rectangle;		/* rectangle */
7158624Sutashiro 	    lPrimFill	_fb_fillscan;		/* fill pattern */
7258624Sutashiro 	    lPrimMarker	_fb_polymarker;		/* polymarker */
7358624Sutashiro 	    lPrimText	_fb_text;		/* text display */
7458624Sutashiro 	    lPrimDot	_fb_polydot;		/* polydot */
7558624Sutashiro 	    lScrType	_fb_scrtype;		/* screen type */
7658624Sutashiro 	    lCursor2	_fb_cursor;		/* cursor area */
7758624Sutashiro 	    lPalette	_fb_palette;		/* get/set palette */
7853887Smckusick 	    lPoint	_fb_point;
7953887Smckusick 	    int		_fb_data;
8053887Smckusick 	    lVideoCtl	_fb_videoctl;
8153887Smckusick 	    lVideoStatus _fb_videostatus;
8253887Smckusick 	    lFbIoctl	_fb_ioctl;
8353887Smckusick 	} fb_un;
8453887Smckusick };
8558624Sutashiro 
8653887Smckusick #define fb_bitblt	fb_un._fb_bitblt
8753887Smckusick #define fb_batchbitblt	fb_un._fb_batchbitblt
8853887Smckusick #define fb_tilebitblt	fb_un._fb_tilebitblt
8953887Smckusick #define fb_bitblt3	fb_un._fb_bitblt3
9053887Smckusick #define fb_polyline	fb_un._fb_polyline
9153887Smckusick #define fb_rectangle	fb_un._fb_rectangle
9253887Smckusick #define fb_fillscan	fb_un._fb_fillscan
9353887Smckusick #define fb_polymarker	fb_un._fb_polymarker
9453887Smckusick #define fb_text		fb_un._fb_text
9553887Smckusick #define fb_polydot	fb_un._fb_polydot
9653887Smckusick #define fb_scrtype	fb_un._fb_scrtype
9753887Smckusick #define fb_cursor	fb_un._fb_cursor
9853887Smckusick #define fb_palette	fb_un._fb_palette
9953887Smckusick #define fb_point	fb_un._fb_point
10053887Smckusick #define fb_data		fb_un._fb_data
10153887Smckusick #define fb_videoctl	fb_un._fb_videoctl
10253887Smckusick #define fb_videostatus	fb_un._fb_videostatus
10353887Smckusick #define fb_fbioctl	fb_un._fb_ioctl
10453887Smckusick 
10553887Smckusick /* command definiton */
10653887Smckusick #define FB_CPROBE	0	/* probe */
10753887Smckusick #define FB_CATTACH	1	/* attach */
10853887Smckusick #define FB_COPEN	2	/* read from Frame Buffer */
10953887Smckusick #define FB_CCLOSE	3	/* write to Frame Buffer */
11053887Smckusick #define FB_CBITBLT	4	/* bitblt */
11153887Smckusick #define FB_CBATCHBITBLT	5	/* bitblt */
11253887Smckusick #define FB_CSETSCR	6	/* set display screen */
11353887Smckusick #define FB_CGETSCR	7	/* get display screen */
11453887Smckusick #define FB_CSETDIM	8	/* set dimmer level */
11553887Smckusick #define FB_CGETDIM	9	/* get dimmer level */
11653887Smckusick #define FB_CDRAW	10	/* graphic primitive drawing */
11753887Smckusick #define FB_CPOLYLINE	11
11853887Smckusick #define FB_CDJPOLYLINE	12
11953887Smckusick #define FB_CRECTANGLE	13
12053887Smckusick #define FB_CFILLSCAN	14
12153887Smckusick #define FB_CPOLYMARKER	15
12253887Smckusick #define FB_CTEXT	16
12353887Smckusick #define FB_CPOLYDOT	17
12453887Smckusick #define FB_CSETSCRMODE	18
12553887Smckusick #define FB_CGETSCRMODE	19
12653887Smckusick #define FB_CGETSCRTYPE	20	/* get screen type (b/w or color8 or...) */
12753887Smckusick #define FB_CSETPALETTE	21
12853887Smckusick #define FB_CGETPALETTE	22
12953887Smckusick #define FB_CSELPALETTE	23	/* select current palette */
13053887Smckusick #define FB_CSETDADDR	24	/* set display address */
13153887Smckusick 
13253887Smckusick #define FB_CTILEBITBLT	30	/* tile bitblt */
13353887Smckusick #define FB_CBITBLT3	31	/* 3 operand bitblt */
13453887Smckusick 
13553887Smckusick #define FB_CSETCURSOR	50
13653887Smckusick #define FB_CUNSETCURSOR	51
13753887Smckusick #define FB_CSHOWCURSOR	52
13853887Smckusick #define FB_CHIDECURSOR	53
13953887Smckusick #define FB_CSETXY	54
14053887Smckusick #define FB_CAUTODIM	55
14153887Smckusick 
14253887Smckusick #define FB_CSETVIDEO	60
14353887Smckusick #define FB_CGETVIDEO	61
14453887Smckusick #define FB_CSETPMODE	62
14553887Smckusick #define FB_CGETPMODE	63
14653887Smckusick 
14753887Smckusick #define FB_CGETPAGE	70
14853887Smckusick 
14953887Smckusick #define FB_CIOCTL	80
15053887Smckusick 
15153887Smckusick /* result definiton */
15253887Smckusick #define FB_ROK		0	/* OK */
15353887Smckusick #define FB_RERROR	1	/* some error occurred */
15453887Smckusick 
15558624Sutashiro #define	FBUNIT(dev)	(minor(dev) & 0x7f)
15658624Sutashiro #define	FBVIDEO(dev)	(minor(dev) & 0x80)
15753887Smckusick 
15853887Smckusick #define FBPRI	(PRIBIO+1)
15953887Smckusick 
16053887Smckusick #define ASROM_SIZE	0x10000		/* size of auto-select ROM */
16153887Smckusick #define ASREG_SIZE	0x10000		/* size of auto-select control reg. */
16253887Smckusick #define ASREG_SIZE2	0x40000		/* size of 2nd area */
16353887Smckusick 
16453887Smckusick #endif /* KERNEL */
165