Home | History | Annotate | Line # | Download | only in dev
grfvar.h revision 1.30.14.1
      1  1.30.14.1       tls /*	$NetBSD: grfvar.h,v 1.30.14.1 2012/11/20 03:01:30 tls Exp $	*/
      2        1.3       cgd 
      3        1.1    briggs /*
      4       1.30     rmind  * Copyright (c) 1988 University of Utah.
      5        1.1    briggs  * Copyright (c) 1990 The Regents of the University of California.
      6        1.1    briggs  * All rights reserved.
      7       1.25       agc  *
      8       1.25       agc  * This code is derived from software contributed to Berkeley by
      9       1.25       agc  * the Systems Programming Group of the University of Utah Computer
     10       1.25       agc  * Science Department.
     11       1.25       agc  *
     12       1.25       agc  * Redistribution and use in source and binary forms, with or without
     13       1.25       agc  * modification, are permitted provided that the following conditions
     14       1.25       agc  * are met:
     15       1.25       agc  * 1. Redistributions of source code must retain the above copyright
     16       1.25       agc  *    notice, this list of conditions and the following disclaimer.
     17       1.25       agc  * 2. Redistributions in binary form must reproduce the above copyright
     18       1.25       agc  *    notice, this list of conditions and the following disclaimer in the
     19       1.25       agc  *    documentation and/or other materials provided with the distribution.
     20       1.25       agc  * 3. Neither the name of the University nor the names of its contributors
     21       1.25       agc  *    may be used to endorse or promote products derived from this software
     22       1.25       agc  *    without specific prior written permission.
     23       1.25       agc  *
     24       1.25       agc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     25       1.25       agc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     26       1.25       agc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     27       1.25       agc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     28       1.25       agc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     29       1.25       agc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     30       1.25       agc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     31       1.25       agc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     32       1.25       agc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     33       1.25       agc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     34       1.25       agc  * SUCH DAMAGE.
     35       1.25       agc  *
     36       1.25       agc  * from: Utah $Hdr: grfvar.h 1.9 91/01/21$
     37       1.25       agc  *
     38       1.25       agc  *	@(#)grfvar.h	7.3 (Berkeley) 5/7/91
     39       1.25       agc  */
     40        1.1    briggs 
     41        1.7    briggs #define CARD_NAME_LEN	64
     42       1.10    scottr 
     43       1.10    scottr /*
     44       1.10    scottr  * State info, per hardware instance.
     45       1.10    scottr  */
     46       1.10    scottr struct grfbus_softc {
     47  1.30.14.1       tls 	device_t	sc_dev;
     48        1.7    briggs 	nubus_slot	sc_slot;
     49        1.6    briggs 
     50       1.22    scottr 	bus_addr_t		sc_basepa;	/* base of video space */
     51       1.22    scottr 	bus_addr_t		sc_fbofs;	/* offset to framebuffer */
     52       1.21    scottr 
     53       1.14    briggs 	bus_space_tag_t		sc_tag;
     54       1.16    scottr 	bus_space_handle_t	sc_handle;
     55       1.14    briggs 	bus_space_handle_t	sc_regh;
     56       1.14    briggs 
     57        1.7    briggs 	struct	grfmode curr_mode;	/* hardware desc(for ioctl)	*/
     58       1.14    briggs 	u_int32_t	card_id;	/* DrHW value for nubus cards	*/
     59       1.17    scottr 	bus_size_t	cli_offset;	/* Offset to clear interrupt	*/
     60       1.17    scottr 					/* for cards where that's suff.	*/
     61       1.17    scottr 	u_int32_t	cli_value;	/* Value to write at cli_offset */
     62        1.7    briggs 	nubus_dir	board_dir;	/* Nubus dir for curr board	*/
     63       1.10    scottr };
     64       1.10    scottr 
     65       1.10    scottr /*
     66       1.10    scottr  * State info, per grf instance.
     67       1.10    scottr  */
     68       1.10    scottr struct grf_softc {
     69       1.24    scottr 	char sc_xname[15];		/* name of the device */
     70       1.24    scottr 	struct macfb_softc *mfb_sc;
     71       1.10    scottr };
     72       1.10    scottr 
     73       1.10    scottr /*
     74       1.10    scottr  * Attach grf and ite semantics to Mac video hardware.
     75       1.10    scottr  */
     76       1.10    scottr struct grfbus_attach_args {
     77       1.27       rjs 	const char	*ga_name;	/* name of semantics to attach */
     78       1.21    scottr 	bus_space_tag_t	ga_tag;		/* forwarded ... */
     79       1.16    scottr 	bus_space_handle_t ga_handle;
     80       1.16    scottr 	struct grfmode	*ga_grfmode;
     81       1.10    scottr 	nubus_slot	*ga_slot;
     82       1.22    scottr 	bus_addr_t	ga_phys;
     83       1.24    scottr 	bus_addr_t	ga_fboff;
     84       1.26       chs 	int		(*ga_mode)(struct grf_softc *, int, void *);
     85        1.1    briggs };
     86        1.1    briggs 
     87       1.29  christos typedef	void *(*grf_phys_t)(struct grf_softc *, vaddr_t);
     88        1.9    briggs 
     89        1.1    briggs /* flags */
     90        1.1    briggs #define	GF_ALIVE	0x01
     91        1.1    briggs #define GF_OPEN		0x02
     92        1.1    briggs #define GF_EXCLUDE	0x04
     93        1.1    briggs #define GF_WANTED	0x08
     94        1.1    briggs #define GF_BSDOPEN	0x10
     95        1.1    briggs #define GF_HPUXOPEN	0x20
     96        1.1    briggs 
     97        1.1    briggs /* requests to mode routine */
     98        1.1    briggs #define GM_GRFON	1
     99        1.1    briggs #define GM_GRFOFF	2
    100        1.7    briggs #define GM_CURRMODE	3
    101        1.7    briggs #define GM_LISTMODES	4
    102        1.7    briggs #define GM_NEWMODE	5
    103        1.1    briggs 
    104        1.1    briggs /* minor device interpretation */
    105       1.24    scottr #define GRFUNIT(d)	(minor(d))
    106        1.1    briggs 
    107        1.7    briggs /*
    108        1.7    briggs  * Nubus image data structure.  This is the equivalent of a PixMap in
    109        1.7    briggs  * MacOS programming parlance.  One of these structures exists for each
    110        1.7    briggs  * video mode that a quickdraw compatible card can fit in.
    111        1.7    briggs  */
    112        1.7    briggs struct image_data {
    113        1.7    briggs 	u_int32_t	size;
    114        1.7    briggs 	u_int32_t	offset;
    115        1.7    briggs 	u_int16_t	rowbytes;
    116        1.7    briggs 	u_int16_t	top;
    117        1.7    briggs 	u_int16_t	left;
    118        1.7    briggs 	u_int16_t	bottom;
    119        1.7    briggs 	u_int16_t	right;
    120        1.7    briggs 	u_int16_t	version;
    121        1.7    briggs 	u_int16_t	packType;
    122        1.7    briggs 	u_int32_t	packSize;
    123        1.7    briggs 	u_int32_t	hRes;
    124        1.7    briggs 	u_int32_t	vRes;
    125        1.7    briggs 	u_int16_t	pixelType;
    126        1.7    briggs 	u_int16_t	pixelSize;
    127        1.7    briggs 	u_int16_t	cmpCount;
    128        1.7    briggs 	u_int16_t	cmpSize;
    129        1.7    briggs 	u_int32_t	planeBytes;
    130        1.7    briggs };
    131        1.7    briggs 
    132        1.7    briggs #define VID_PARAMS		1
    133        1.7    briggs #define VID_TABLE_OFFSET	2
    134        1.7    briggs #define VID_PAGE_CNT		3
    135        1.7    briggs #define VID_DEV_TYPE		4
    136        1.9    briggs 
    137       1.26       chs void	grf_attach(struct macfb_softc *, int);
    138       1.10    scottr 
    139       1.26       chs void	grf_establish(struct grfbus_softc *, nubus_slot *,
    140       1.26       chs 	    int (*)(struct grf_softc *, int, void *));
    141       1.26       chs int	grfbusprint(void *, const char *);
    142