Home | History | Annotate | Line # | Download | only in tc
sticvar.h revision 1.15
      1  1.15  christos /* 	$NetBSD: sticvar.h,v 1.15 2005/12/11 12:24:00 christos Exp $	*/
      2   1.1  jonathan 
      3   1.4        ad /*-
      4   1.7        ad  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
      5   1.1  jonathan  * All rights reserved.
      6   1.1  jonathan  *
      7   1.4        ad  * This code is derived from software contributed to The NetBSD Foundation
      8   1.4        ad  * by Andrew Doran.
      9   1.4        ad  *
     10   1.1  jonathan  * Redistribution and use in source and binary forms, with or without
     11   1.1  jonathan  * modification, are permitted provided that the following conditions
     12   1.1  jonathan  * are met:
     13   1.1  jonathan  * 1. Redistributions of source code must retain the above copyright
     14   1.1  jonathan  *    notice, this list of conditions and the following disclaimer.
     15   1.1  jonathan  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1  jonathan  *    notice, this list of conditions and the following disclaimer in the
     17   1.1  jonathan  *    documentation and/or other materials provided with the distribution.
     18   1.1  jonathan  * 3. All advertising materials mentioning features or use of this software
     19   1.1  jonathan  *    must display the following acknowledgement:
     20   1.4        ad  *	This product includes software developed by the NetBSD
     21   1.4        ad  *	Foundation, Inc. and its contributors.
     22   1.4        ad  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23   1.4        ad  *    contributors may be used to endorse or promote products derived
     24   1.4        ad  *    from this software without specific prior written permission.
     25   1.1  jonathan  *
     26   1.4        ad  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27   1.4        ad  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28   1.4        ad  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29   1.4        ad  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30   1.4        ad  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31   1.4        ad  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32   1.4        ad  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33   1.4        ad  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34   1.4        ad  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35   1.4        ad  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36   1.4        ad  * POSSIBILITY OF SUCH DAMAGE.
     37   1.1  jonathan  */
     38   1.1  jonathan 
     39   1.1  jonathan #ifndef _TC_STICVAR_H_
     40   1.1  jonathan #define	_TC_STICVAR_H_
     41   1.1  jonathan 
     42   1.4        ad #if defined(pmax)
     43   1.4        ad #define	STIC_KSEG_TO_PHYS(x)	MIPS_KSEG0_TO_PHYS(x)
     44   1.4        ad #elif defined(alpha)
     45   1.8        ad #define	STIC_KSEG_TO_PHYS(x)	ALPHA_K0SEG_TO_PHYS((vaddr_t)x)
     46  1.11       wiz #else
     47  1.11       wiz #error No support for your architecture
     48   1.4        ad #endif
     49   1.4        ad 
     50   1.9        ad #define	STIC_MAXDV	5
     51   1.9        ad 
     52   1.4        ad struct stic_hwcmap256 {
     53   1.4        ad #define	CMAP_SIZE	256	/* 256 R/G/B entries */
     54   1.4        ad 	u_int8_t	r[CMAP_SIZE];
     55   1.4        ad 	u_int8_t	g[CMAP_SIZE];
     56   1.4        ad 	u_int8_t	b[CMAP_SIZE];
     57   1.4        ad };
     58   1.4        ad 
     59   1.4        ad struct stic_hwcursor64 {
     60   1.4        ad 	struct	wsdisplay_curpos cc_pos;
     61   1.4        ad 	struct	wsdisplay_curpos cc_hot;
     62   1.4        ad 	struct	wsdisplay_curpos cc_size;
     63   1.4        ad #define	CURSOR_MAX_SIZE	64
     64   1.4        ad 	u_int8_t	cc_color[6];
     65  1.14       chs 	u_int64_t	cc_image[CURSOR_MAX_SIZE];
     66  1.14       chs 	u_int64_t	cc_mask[CURSOR_MAX_SIZE];
     67   1.4        ad };
     68   1.4        ad 
     69   1.4        ad struct stic_screen {
     70   1.4        ad 	struct	stic_info *ss_si;
     71   1.4        ad 	u_int16_t	*ss_backing;
     72   1.4        ad 	int	ss_flags;
     73   1.4        ad 	int	ss_curx;
     74   1.4        ad 	int	ss_cury;
     75   1.4        ad };
     76   1.4        ad 
     77   1.7        ad #define	SS_ALLOCED		0x01
     78   1.7        ad #define	SS_ACTIVE		0x02
     79   1.8        ad #define	SS_CURENB		0x04
     80   1.4        ad 
     81   1.4        ad struct stic_info {
     82   1.9        ad 	struct device	*si_dv;
     83   1.9        ad 
     84   1.4        ad 	u_int32_t	*si_stamp;
     85   1.6        ad 	u_int32_t	*si_buf;
     86   1.4        ad 	u_int32_t	*si_vdac;
     87   1.4        ad 	u_int32_t	*si_vdac_reset;
     88   1.4        ad 	volatile struct	stic_regs *si_stic;
     89   1.9        ad 	volatile struct stic_xcomm *si_sxc;
     90   1.4        ad 
     91   1.4        ad 	u_int32_t	*(*si_pbuf_get)(struct stic_info *);
     92   1.4        ad 	int	(*si_pbuf_post)(struct stic_info *, u_int32_t *);
     93   1.6        ad 	int	(*si_ioctl)(struct stic_info *, u_long, caddr_t, int,
     94  1.15  christos 			   struct lwp *);
     95   1.4        ad 	int	si_pbuf_select;
     96   1.9        ad 	int	si_hwflags;
     97   1.4        ad 
     98   1.4        ad 	struct	stic_screen *si_curscreen;
     99   1.4        ad 	struct	wsdisplay_font *si_font;
    100   1.4        ad 
    101   1.4        ad 	int	si_consw;
    102   1.4        ad 	int	si_consh;
    103   1.4        ad 	int	si_fontw;
    104   1.4        ad 	int	si_fonth;
    105   1.4        ad 	int	si_stamph;
    106  1.10        ad 	int	si_stamphm;
    107   1.4        ad 	int	si_stampw;
    108   1.4        ad 	int	si_depth;
    109   1.9        ad 	int	si_disptype;
    110   1.9        ad 	int	si_dispmode;
    111   1.9        ad 	int	si_unit;
    112   1.4        ad 
    113   1.4        ad 	tc_addr_t si_slotbase;
    114   1.6        ad 	paddr_t	si_buf_phys;
    115   1.6        ad 	size_t	si_buf_size;
    116   1.4        ad 
    117   1.7        ad 	int	si_flags;
    118   1.7        ad 	struct	stic_hwcursor64 si_cursor;
    119   1.7        ad 	struct	stic_hwcmap256 si_cmap;
    120   1.4        ad 
    121   1.4        ad 	struct	callout si_switch_callout;
    122   1.4        ad 	void	(*si_switchcb)(void *, int, int);
    123   1.4        ad 	void	*si_switchcbarg;
    124   1.4        ad };
    125   1.1  jonathan 
    126   1.7        ad #define	SI_CURENB_CHANGED	0x0001
    127   1.7        ad #define	SI_CURCMAP_CHANGED	0x0002
    128   1.7        ad #define	SI_CURSHAPE_CHANGED	0x0004
    129   1.7        ad #define	SI_CMAP_CHANGED		0x0008
    130   1.7        ad #define	SI_ALL_CHANGED		0x000f
    131   1.9        ad #define	SI_DVOPEN		0x0010
    132   1.7        ad 
    133   1.4        ad void	stic_init(struct stic_info *);
    134   1.4        ad void	stic_attach(struct device *, struct stic_info *, int);
    135   1.4        ad void	stic_cnattach(struct stic_info *);
    136   1.4        ad void	stic_reset(struct stic_info *);
    137   1.4        ad void	stic_flush(struct stic_info *);
    138   1.4        ad 
    139   1.4        ad extern struct stic_info stic_consinfo;
    140   1.2  nisimura 
    141   1.4        ad #endif	/* !_TC_STICVAR_H_ */
    142