diff options
author | Eric Jackson <ericj@cvs.openbsd.org> | 2000-08-04 16:00:58 +0000 |
---|---|---|
committer | Eric Jackson <ericj@cvs.openbsd.org> | 2000-08-04 16:00:58 +0000 |
commit | cd9fdc9b3a19df70fc87508b201a9b4c67ed8978 (patch) | |
tree | f2266bad9a413e3695dc394b880ab17a20c9fc46 /sys/dev/pci/tgavar.h | |
parent | 09a5aedeafa9517b34812070bee31278c9b1f18c (diff) |
add support for tga2; from NetBSD
Diffstat (limited to 'sys/dev/pci/tgavar.h')
-rw-r--r-- | sys/dev/pci/tgavar.h | 146 |
1 files changed, 62 insertions, 84 deletions
diff --git a/sys/dev/pci/tgavar.h b/sys/dev/pci/tgavar.h index 59d9b1017af..89b108f2c5f 100644 --- a/sys/dev/pci/tgavar.h +++ b/sys/dev/pci/tgavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: tgavar.h,v 1.4 1998/08/18 08:23:46 thorpej Exp $ */ +/* $NetBSD: tgavar.h,v 1.8 2000/04/02 19:01:11 nathanw Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -27,6 +27,7 @@ * rights to redistribute these changes. */ +#include <dev/ic/ramdac.h> #include <dev/pci/tgareg.h> #include <dev/rcons/raster.h> #include <dev/wscons/wsconsio.h> @@ -37,119 +38,96 @@ struct fbcmap; struct fbcursor; struct fbcurpos; -struct tga_ramdac_conf { - char *tgar_name; - void (*tgar_init) __P((struct tga_devconfig *, int)); - int (*tgar_intr) __P((void *)); - int (*tgar_set_cmap) __P((struct tga_devconfig *, - struct wsdisplay_cmap *)); - int (*tgar_get_cmap) __P((struct tga_devconfig *, - struct wsdisplay_cmap *)); - int (*tgar_set_cursor) __P((struct tga_devconfig *, - struct wsdisplay_cursor *)); - int (*tgar_get_cursor) __P((struct tga_devconfig *, - struct wsdisplay_cursor *)); - int (*tgar_set_curpos) __P((struct tga_devconfig *, - struct wsdisplay_curpos *)); - int (*tgar_get_curpos) __P((struct tga_devconfig *, - struct wsdisplay_curpos *)); - int (*tgar_get_curmax) __P((struct tga_devconfig *, - struct wsdisplay_curpos *)); - - /* Only called from the TGA built-in cursor handling code. */ - int (*tgar_check_curcmap) __P((struct tga_devconfig *, - struct wsdisplay_cursor *)); - void (*tgar_set_curcmap) __P((struct tga_devconfig *, - struct wsdisplay_cursor *)); - int (*tgar_get_curcmap) __P((struct tga_devconfig *, - struct wsdisplay_cursor *)); -}; - struct tga_conf { - char *tgac_name; /* name for this board type */ + char *tgac_name; /* name for this board type */ - const struct tga_ramdac_conf - *tgac_ramdac; /* the RAMDAC type; see above */ - int tgac_phys_depth; /* physical frame buffer depth */ - vsize_t tgac_cspace_size; /* core space size */ - vsize_t tgac_vvbr_units; /* what '1' in the VVBR means */ + struct ramdac_funcs *(*ramdac_funcs) __P((void)); - int tgac_ndbuf; /* number of display buffers */ - vaddr_t tgac_dbuf[2]; /* display buffer offsets/addresses */ - vsize_t tgac_dbufsz[2]; /* display buffer sizes */ + int tgac_phys_depth; /* physical frame buffer depth */ + vsize_t tgac_cspace_size; /* core space size */ + vsize_t tgac_vvbr_units; /* what '1' in the VVBR means */ - int tgac_nbbuf; /* number of display buffers */ - vaddr_t tgac_bbuf[2]; /* back buffer offsets/addresses */ - vsize_t tgac_bbufsz[2]; /* back buffer sizes */ + int tgac_ndbuf; /* number of display buffers */ + vaddr_t tgac_dbuf[2]; /* display buffer offsets/addresses */ + vsize_t tgac_dbufsz[2]; /* display buffer sizes */ + + int tgac_nbbuf; /* number of display buffers */ + vaddr_t tgac_bbuf[2]; /* back buffer offsets/addresses */ + vsize_t tgac_bbufsz[2]; /* back buffer sizes */ }; struct tga_devconfig { - bus_space_tag_t dc_memt; + bus_space_tag_t dc_memt; pci_chipset_tag_t dc_pc; + pcitag_t dc_pcitag; /* PCI tag */ + bus_addr_t dc_pcipaddr; /* PCI phys addr. */ - pcitag_t dc_pcitag; /* PCI tag */ - bus_addr_t dc_pcipaddr; /* PCI phys addr. */ + tga_reg_t *dc_regs; /* registers; XXX: need aliases */ + int dc_tga_type; /* the device type; see below */ + int dc_tga2; /* True if it is a TGA2 */ + const struct tga_conf *dc_tgaconf; /* device buffer configuration */ - tga_reg_t *dc_regs; /* registers; XXX: need aliases */ + struct ramdac_funcs + *dc_ramdac_funcs; /* The RAMDAC functions */ + struct ramdac_cookie + *dc_ramdac_cookie; /* the RAMDAC type; see above */ - int dc_tga_type; /* the device type; see below */ - const struct tga_conf *dc_tgaconf; /* device buffer configuration */ + vaddr_t dc_vaddr; /* memory space virtual base address */ + paddr_t dc_paddr; /* memory space physical base address */ - vaddr_t dc_vaddr; /* memory space virtual base address */ - paddr_t dc_paddr; /* memory space physical base address */ + int dc_wid; /* width of frame buffer */ + int dc_ht; /* height of frame buffer */ + int dc_rowbytes; /* bytes in a FB scan line */ - int dc_wid; /* width of frame buffer */ - int dc_ht; /* height of frame buffer */ - int dc_rowbytes; /* bytes in a FB scan line */ + vaddr_t dc_videobase; /* base of flat frame buffer */ - vaddr_t dc_videobase; /* base of flat frame buffer */ + struct raster dc_raster; /* raster description */ + struct rcons dc_rcons; /* raster blitter control info */ - struct raster dc_raster; /* raster description */ - struct rcons dc_rcons; /* raster blitter control info */ + int dc_blanked; /* currently had video disabled */ + void *dc_ramdac_private; /* RAMDAC private storage */ - int dc_blanked; /* currently had video disabled */ - void *dc_ramdac_private; /* RAMDAC private storage */ + void (*dc_ramdac_intr) __P((void *)); + int dc_intrenabled; /* can we depend on interrupts yet? */ }; - + struct tga_softc { - struct device sc_dev; + struct device sc_dev; - struct tga_devconfig *sc_dc; /* device configuration */ - void *sc_intr; /* interrupt handler info */ - /* XXX should record intr fns/arg */ + struct tga_devconfig *sc_dc; /* device configuration */ + void *sc_intr; /* interrupt handler info */ + /* XXX should record intr fns/arg */ - int nscreens; + int nscreens; }; -#define TGA_TYPE_T8_01 0 /* 8bpp, 1MB */ -#define TGA_TYPE_T8_02 1 /* 8bpp, 2MB */ -#define TGA_TYPE_T8_22 2 /* 8bpp, 4MB */ -#define TGA_TYPE_T8_44 3 /* 8bpp, 8MB */ -#define TGA_TYPE_T32_04 4 /* 32bpp, 4MB */ -#define TGA_TYPE_T32_08 5 /* 32bpp, 8MB */ -#define TGA_TYPE_T32_88 6 /* 32bpp, 16MB */ -#define TGA_TYPE_UNKNOWN 7 /* unknown */ +#define TGA_TYPE_T8_01 0 /* 8bpp, 1MB */ +#define TGA_TYPE_T8_02 1 /* 8bpp, 2MB */ +#define TGA_TYPE_T8_22 2 /* 8bpp, 4MB */ +#define TGA_TYPE_T8_44 3 /* 8bpp, 8MB */ +#define TGA_TYPE_T32_04 4 /* 32bpp, 4MB */ +#define TGA_TYPE_T32_08 5 /* 32bpp, 8MB */ +#define TGA_TYPE_T32_88 6 /* 32bpp, 16MB */ +#define TGA_TYPE_UNKNOWN 7 /* unknown */ -#define DEVICE_IS_TGA(class, id) \ - ((PCI_VENDOR(id) == PCI_VENDOR_DEC && \ - PCI_PRODUCT(id) == PCI_PRODUCT_DEC_21030) ? 10 : 0) +#define DEVICE_IS_TGA(class, id) \ + (((PCI_VENDOR(id) == PCI_VENDOR_DEC && \ + PCI_PRODUCT(id) == PCI_PRODUCT_DEC_21030) || \ + PCI_PRODUCT(id) == PCI_PRODUCT_DEC_PBXGB) ? 10 : 0) int tga_cnattach __P((bus_space_tag_t, bus_space_tag_t, pci_chipset_tag_t, - int, int, int)); + int, int, int)); -int tga_identify __P((tga_reg_t *)); +int tga_identify __P((tga_reg_t *)); const struct tga_conf *tga_getconf __P((int)); -extern const struct tga_ramdac_conf tga_ramdac_bt463; -extern const struct tga_ramdac_conf tga_ramdac_bt485; - int tga_builtin_set_cursor __P((struct tga_devconfig *, - struct wsdisplay_cursor *)); + struct wsdisplay_cursor *)); int tga_builtin_get_cursor __P((struct tga_devconfig *, - struct wsdisplay_cursor *)); + struct wsdisplay_cursor *)); int tga_builtin_set_curpos __P((struct tga_devconfig *, - struct wsdisplay_curpos *)); + struct wsdisplay_curpos *)); int tga_builtin_get_curpos __P((struct tga_devconfig *, - struct wsdisplay_curpos *)); + struct wsdisplay_curpos *)); int tga_builtin_get_curmax __P((struct tga_devconfig *, - struct wsdisplay_curpos *)); + struct wsdisplay_curpos *)); |