Home | History | Annotate | Line # | Download | only in dev
cgfourteenvar.h revision 1.11.6.1
      1  1.11.6.1     rmind /*	$NetBSD: cgfourteenvar.h,v 1.11.6.1 2010/07/03 01:19:27 rmind Exp $ */
      2       1.1    abrown 
      3       1.1    abrown /*
      4       1.5       uwe  * Copyright (c) 1996
      5       1.1    abrown  *	The President and Fellows of Harvard College. All rights reserved.
      6       1.1    abrown  *
      7       1.1    abrown  * Redistribution and use in source and binary forms, with or without
      8       1.1    abrown  * modification, are permitted provided that the following conditions
      9       1.1    abrown  * are met:
     10       1.1    abrown  * 1. Redistributions of source code must retain the above copyright
     11       1.1    abrown  *    notice, this list of conditions and the following disclaimer.
     12       1.1    abrown  * 2. Redistributions in binary form must reproduce the above copyright
     13       1.1    abrown  *    notice, this list of conditions and the following disclaimer in the
     14       1.1    abrown  *    documentation and/or other materials provided with the distribution.
     15       1.1    abrown  * 3. All advertising materials mentioning features or use of this software
     16       1.1    abrown  *    must display the following acknowledgement:
     17       1.1    abrown  *	This product includes software developed by Harvard University and
     18       1.1    abrown  *	its contributors.
     19       1.1    abrown  * 4. Neither the name of the University nor the names of its contributors
     20       1.1    abrown  *    may be used to endorse or promote products derived from this software
     21       1.1    abrown  *    without specific prior written permission.
     22       1.1    abrown  *
     23       1.1    abrown  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     24       1.1    abrown  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     25       1.1    abrown  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     26       1.1    abrown  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     27       1.1    abrown  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     28       1.1    abrown  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     29       1.1    abrown  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30       1.1    abrown  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     31       1.1    abrown  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     32       1.1    abrown  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     33       1.1    abrown  * SUCH DAMAGE.
     34       1.1    abrown  */
     35       1.6  christos struct sbus_reg {
     36       1.6  christos 	uint32_t	sbr_slot;
     37       1.6  christos 	uint32_t	sbr_offset;
     38       1.6  christos 	uint32_t	sbr_size;
     39       1.6  christos };
     40       1.1    abrown /*
     41       1.1    abrown  * Layout of cg14 hardware colormap
     42       1.1    abrown  */
     43       1.1    abrown union cg14cmap {
     44       1.1    abrown 	u_char  	cm_map[256][4];	/* 256 R/G/B/A entries (B is high)*/
     45       1.5       uwe 	uint32_t   	cm_chip[256];	/* the way the chip gets loaded */
     46       1.1    abrown };
     47       1.1    abrown 
     48       1.1    abrown /*
     49       1.1    abrown  * cg14 hardware cursor colormap
     50       1.1    abrown  */
     51       1.1    abrown union cg14cursor_cmap {		/* colormap, like bt_cmap, but tiny */
     52       1.1    abrown 	u_char		cm_map[2][4];	/* 2 R/G/B/A entries */
     53       1.5       uwe 	uint32_t	cm_chip[2];	/* 2 chip equivalents */
     54       1.1    abrown };
     55       1.1    abrown 
     56       1.1    abrown /*
     57       1.1    abrown  * cg14 hardware cursor status
     58       1.1    abrown  */
     59       1.1    abrown struct cg14_cursor {		/* cg14 hardware cursor status */
     60       1.8  macallan 	int	cc_enable;		/* cursor is enabled */
     61       1.1    abrown 	struct	fbcurpos cc_pos;	/* position */
     62       1.1    abrown 	struct	fbcurpos cc_hot;	/* hot-spot */
     63       1.1    abrown 	struct	fbcurpos cc_size;	/* size of mask & image fields */
     64       1.6  christos 	uint	cc_eplane[32];		/* enable plane */
     65       1.6  christos 	uint	cc_cplane[32];		/* color plane */
     66       1.1    abrown 	union	cg14cursor_cmap cc_color; /* cursor colormap */
     67       1.1    abrown };
     68       1.1    abrown 
     69  1.11.6.1     rmind #define CG14_SET_PIXELMODE	_IOW('M', 3, int)
     70  1.11.6.1     rmind 
     71       1.5       uwe /*
     72       1.1    abrown  * per-cg14 variables/state
     73       1.1    abrown  */
     74       1.1    abrown struct cgfourteen_softc {
     75      1.10  macallan 	device_t	sc_dev;		/* base device */
     76       1.2        pk 	struct fbdevice	sc_fb;		/* frame buffer device */
     77       1.6  christos #ifdef RASTERCONSOLE
     78       1.6  christos 	struct fbdevice	sc_rcfb;	/* sc_fb variant for rcons */
     79       1.6  christos #endif
     80       1.2        pk 	bus_space_tag_t	sc_bustag;
     81       1.6  christos 	struct sbus_reg	sc_physadr[2];	/* phys addrs of h/w */
     82       1.7  macallan 	bus_space_handle_t sc_regh;	/* register space */
     83       1.2        pk #define CG14_CTL_IDX	0
     84       1.2        pk #define CG14_PXL_IDX	1
     85       1.1    abrown 
     86       1.1    abrown 	union	cg14cmap sc_cmap;	/* current colormap */
     87       1.1    abrown 	struct	cg14_cursor sc_cursor;	/* Hardware cursor state */
     88       1.1    abrown 	union 	cg14cmap sc_saveclut; 	/* a place to stash PROM state */
     89       1.7  macallan 	size_t	sc_vramsize;
     90       1.7  macallan #if NWSDISPLAY > 0
     91       1.7  macallan 	struct  vcons_data sc_vd;
     92       1.7  macallan 	struct vcons_screen sc_console_screen;
     93       1.7  macallan 	struct wsscreen_descr sc_defaultscreen_descr;
     94       1.7  macallan 	const struct wsscreen_descr *sc_screens[1];
     95       1.7  macallan 	struct wsscreen_list sc_screenlist;
     96      1.11  macallan 	void *sc_shadowfb;
     97       1.7  macallan 	int sc_mode;	/* wsdisplay mode - EMUL, DUMB etc. */
     98       1.7  macallan 	int sc_depth;	/* current colour depth */
     99       1.7  macallan #endif
    100       1.7  macallan 
    101       1.6  christos 	uint8_t	sc_savexlut[256];
    102       1.6  christos 	uint8_t	sc_savectl;
    103       1.6  christos 	uint8_t	sc_savehwc;
    104       1.1    abrown 
    105       1.1    abrown 	struct	cg14ctl  *sc_ctl; 	/* various registers */
    106       1.1    abrown 	struct	cg14curs *sc_hwc;
    107       1.1    abrown 	struct 	cg14dac	 *sc_dac;
    108       1.1    abrown 	struct	cg14xlut *sc_xlut;
    109       1.1    abrown 	struct 	cg14clut *sc_clut1;
    110       1.1    abrown 	struct	cg14clut *sc_clut2;
    111       1.1    abrown 	struct	cg14clut *sc_clut3;
    112       1.6  christos 	uint	*sc_clutincr;
    113      1.11  macallan 	int	sc_opens;
    114  1.11.6.1     rmind 	off_t	sc_regaddr, sc_fbaddr;
    115       1.1    abrown };
    116  1.11.6.1     rmind 
    117  1.11.6.1     rmind /* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */
    118  1.11.6.1     rmind #define CG14_REGS_VOFF		0x00000000	/* registers */
    119  1.11.6.1     rmind #define CG14_XLUT_VOFF		0x00003000	/* X Look Up Table */
    120  1.11.6.1     rmind #define CG14_CLUT1_VOFF		0x00004000	/* Color Look Up Table */
    121  1.11.6.1     rmind #define CG14_CLUT2_VOFF		0x00005000	/* Color Look Up Table */
    122  1.11.6.1     rmind #define CG14_CLUT3_VOFF		0x00006000	/* Color Look Up Table */
    123  1.11.6.1     rmind #define CG14_DIRECT_VOFF	0x10000000
    124  1.11.6.1     rmind #define CG14_CTLREG_VOFF	0x20000000
    125  1.11.6.1     rmind #define CG14_CURSOR_VOFF	0x30000000
    126  1.11.6.1     rmind #define CG14_SHDW_VRT_VOFF	0x40000000
    127  1.11.6.1     rmind #define CG14_XBGR_VOFF		0x50000000
    128  1.11.6.1     rmind #define CG14_BGR_VOFF		0x60000000
    129  1.11.6.1     rmind #define CG14_X16_VOFF		0x70000000
    130  1.11.6.1     rmind #define CG14_C16_VOFF		0x80000000
    131  1.11.6.1     rmind #define CG14_X32_VOFF		0x90000000
    132  1.11.6.1     rmind #define CG14_B32_VOFF		0xa0000000
    133  1.11.6.1     rmind #define CG14_G32_VOFF		0xb0000000
    134  1.11.6.1     rmind #define CG14_R32_VOFF		0xc0000000
    135