Home | History | Annotate | Line # | Download | only in dev
ffbvar.h revision 1.8.80.3
      1  1.8.80.1     rmind /*	$NetBSD: ffbvar.h,v 1.8.80.3 2011/06/12 00:24:08 rmind Exp $	*/
      2       1.1    petrov /*	$OpenBSD: creatorvar.h,v 1.6 2002/07/30 19:48:15 jason Exp $	*/
      3       1.1    petrov 
      4       1.1    petrov /*
      5       1.1    petrov  * Copyright (c) 2002 Jason L. Wright (jason (at) thought.net),
      6       1.1    petrov  *  Federico G. Schwindt (fgsch (at) openbsd.org)
      7       1.1    petrov  * All rights reserved.
      8       1.1    petrov  *
      9       1.1    petrov  * Redistribution and use in source and binary forms, with or without
     10       1.1    petrov  * modification, are permitted provided that the following conditions
     11       1.1    petrov  * are met:
     12       1.1    petrov  * 1. Redistributions of source code must retain the above copyright
     13       1.1    petrov  *    notice, this list of conditions and the following disclaimer.
     14       1.1    petrov  * 2. Redistributions in binary form must reproduce the above copyright
     15       1.1    petrov  *    notice, this list of conditions and the following disclaimer in the
     16       1.1    petrov  *    documentation and/or other materials provided with the distribution.
     17       1.1    petrov  * 3. All advertising materials mentioning features or use of this software
     18       1.1    petrov  *    must display the following acknowledgement:
     19       1.1    petrov  *	This product includes software developed by Jason L. Wright
     20       1.1    petrov  * 4. The name of the author may not be used to endorse or promote products
     21       1.1    petrov  *    derived from this software without specific prior written permission.
     22       1.1    petrov  *
     23       1.1    petrov  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24       1.1    petrov  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     25       1.1    petrov  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     26       1.1    petrov  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
     27       1.1    petrov  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     28       1.1    petrov  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     29       1.1    petrov  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30       1.1    petrov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     31       1.1    petrov  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     32       1.1    petrov  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33       1.1    petrov  * POSSIBILITY OF SUCH DAMAGE.
     34       1.1    petrov  */
     35       1.1    petrov 
     36       1.8    martin #include <dev/wscons/wsdisplay_vconsvar.h>
     37  1.8.80.2     rmind #include <dev/videomode/videomode.h>
     38  1.8.80.2     rmind #include <dev/videomode/edidvar.h>
     39  1.8.80.2     rmind #include <dev/videomode/edidreg.h>
     40  1.8.80.2     rmind 
     41  1.8.80.2     rmind #include <dev/i2c/i2cvar.h>
     42  1.8.80.2     rmind #include <dev/i2c/i2c_bitbang.h>
     43       1.8    martin 
     44       1.1    petrov #define FFB_CREATOR		0
     45       1.1    petrov #define FFB_AFB			1
     46       1.1    petrov 
     47       1.1    petrov #define	FFB_CFFLAG_NOACCEL	0x1
     48       1.1    petrov 
     49  1.8.80.2     rmind #define EDID_DATA_LEN		128
     50  1.8.80.2     rmind 
     51       1.1    petrov struct ffb_softc {
     52  1.8.80.3     rmind 	device_t sc_dev;
     53       1.4    martin 	struct fbdevice sc_fb;
     54       1.1    petrov 	bus_space_tag_t sc_bt;
     55       1.2      heas 	bus_space_handle_t sc_dac_h;
     56       1.1    petrov 	bus_space_handle_t sc_fbc_h;
     57       1.1    petrov 	bus_addr_t sc_addrs[FFB_NREGS];
     58       1.1    petrov 	bus_size_t sc_sizes[FFB_NREGS];
     59       1.1    petrov 	int sc_height, sc_width, sc_linebytes, sc_depth;
     60       1.1    petrov 	int sc_nscreens, sc_nreg;
     61       1.1    petrov 	int sc_console;
     62       1.1    petrov 	int sc_node;
     63       1.1    petrov 	int sc_type;
     64       1.3      heas 	u_int sc_dacrev;
     65  1.8.80.2     rmind 	uint8_t sc_edid_data[EDID_DATA_LEN];
     66  1.8.80.2     rmind 	struct edid_info sc_edid_info;
     67       1.8    martin 	u_int sc_locked;
     68       1.8    martin 	int sc_mode;
     69       1.8    martin 	int sc_accel, sc_needredraw;
     70  1.8.80.1     rmind 	int32_t sc_fifo_cache, sc_fg_cache, sc_bg_cache;
     71  1.8.80.2     rmind 	const char *sc_conf;
     72  1.8.80.1     rmind 
     73  1.8.80.2     rmind 	/* I2C stuff */
     74  1.8.80.2     rmind 	struct i2c_controller sc_i2c;
     75  1.8.80.2     rmind 
     76       1.5  macallan 	/* virtual console stuff */
     77       1.8    martin 	struct vcons_data vd;
     78       1.1    petrov };
     79       1.1    petrov 
     80       1.2      heas #define	DAC_WRITE(sc,r,v) \
     81       1.2      heas     bus_space_write_4((sc)->sc_bt, (sc)->sc_dac_h, (r), (v))
     82       1.2      heas #define	DAC_READ(sc,r) \
     83       1.2      heas     bus_space_read_4((sc)->sc_bt, (sc)->sc_dac_h, (r))
     84       1.1    petrov #define	FBC_WRITE(sc,r,v) \
     85       1.1    petrov     bus_space_write_4((sc)->sc_bt, (sc)->sc_fbc_h, (r), (v))
     86       1.1    petrov #define	FBC_READ(sc,r) \
     87       1.1    petrov     bus_space_read_4((sc)->sc_bt, (sc)->sc_fbc_h, (r))
     88       1.1    petrov 
     89       1.1    petrov void	ffb_attach(struct ffb_softc *);
     90