diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-04-29 01:34:59 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-04-29 01:34:59 +0000 |
commit | 41f629f6c097e2eba9dd560f31eee480f2424323 (patch) | |
tree | 44387b91351cc4688054563e370255370497bd83 /sys/arch | |
parent | 57884f4efb08fbe90bf520fd768d975b874948a9 (diff) |
Change macppc vgafb from rcons to rasops, a faster color supporting virtual
terminal emulator for gfx console. tested by mattheiu, miod.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/macppc/conf/files.macppc | 8 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/ofw_machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/macppc/pci/vgafb.c | 71 | ||||
-rw-r--r-- | sys/arch/macppc/pci/vgafb_pci.c | 10 | ||||
-rw-r--r-- | sys/arch/macppc/pci/vgafbvar.h | 8 |
5 files changed, 44 insertions, 59 deletions
diff --git a/sys/arch/macppc/conf/files.macppc b/sys/arch/macppc/conf/files.macppc index beca1aa3f29..2c632f2cc09 100644 --- a/sys/arch/macppc/conf/files.macppc +++ b/sys/arch/macppc/conf/files.macppc @@ -1,4 +1,4 @@ -# $OpenBSD: files.macppc,v 1.7 2002/04/29 00:21:26 drahn Exp $ +# $OpenBSD: files.macppc,v 1.8 2002/04/29 01:34:58 drahn Exp $ # # macppc-specific configuration info @@ -190,8 +190,12 @@ file arch/macppc/dev/wdc_obio.c wdc_obio attach wi at macobio with wi_obio file arch/macppc/dev/if_wi_obio.c wi_obio +# Raster operations +include "dev/rasops/files.rasops" +include "dev/wsfont/files.wsfont" + # VGA framebuffer -device vgafb: wsemuldisplaydev, wsrasteremulops +device vgafb: wsemuldisplaydev, rasops8, rasops16, rasops32 file arch/macppc/pci/vgafb.c vgafb & vgafb_pci # Generic VGA Framebuffer version diff --git a/sys/arch/macppc/macppc/ofw_machdep.c b/sys/arch/macppc/macppc/ofw_machdep.c index 84d72163b8d..300785be0a7 100644 --- a/sys/arch/macppc/macppc/ofw_machdep.c +++ b/sys/arch/macppc/macppc/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.8 2002/03/14 01:26:36 millert Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.9 2002/04/29 01:34:58 drahn Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */ /* @@ -547,8 +547,8 @@ of_display_console() printf(": consaddr %x, ", cons_addr); printf(": ioaddr %x, size %x", addr[1].phys_lo, addr[1].size_lo); printf(": memtag %x, iotag %x", memtag, iotag); - printf(": cons_width %d cons_linebytes %d cons_height %d\n", - cons_width, cons_linebytes, cons_height); + printf(": width %d linebytes %d height %d depth %d\n", + cons_width, cons_linebytes, cons_height, cons_depth); #endif { diff --git a/sys/arch/macppc/pci/vgafb.c b/sys/arch/macppc/pci/vgafb.c index 20394762530..7be0b71e577 100644 --- a/sys/arch/macppc/pci/vgafb.c +++ b/sys/arch/macppc/pci/vgafb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb.c,v 1.9 2002/04/20 16:42:42 matthieu Exp $ */ +/* $OpenBSD: vgafb.c,v 1.10 2002/04/29 01:34:58 drahn Exp $ */ /* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */ /* @@ -44,7 +44,8 @@ #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/wscons/wscons_raster.h> -#include <dev/rcons/raster.h> +#include <dev/rasops/rasops.h> +#include <dev/wsfont/wsfont.h> #include <arch/macppc/pci/vgafbvar.h> @@ -63,22 +64,13 @@ struct cfdriver vgafb_cd = { NULL, "vgafb", DV_DULL, }; -void vgafb_cursor(void *, int, int, int); -void vgafb_putchar(void *, int, int, u_int, long); -void vgafb_copycols(void *, int, int, int, int); -void vgafb_erasecols(void *, int, int, int); -void vgafb_copyrows(void *, int, int, int); -void vgafb_eraserows(void *, int, int); -void vgafb_alloc_attr(void *c, int fg, int bg, int flags, long *); - void vgafb_setcolor(struct vgafb_config *vc, unsigned int index, u_int8_t r, u_int8_t g, u_int8_t b); struct vgafb_devconfig { - struct rcons dc_ri; + struct rasops_info dc_rinfo; /* raster display data */ + int dc_blanked; /* currently had video disabled */ }; -struct raster vgafb_raster; - struct vgafb_devconfig vgafb_console_dc; @@ -87,7 +79,7 @@ struct wsscreen_descr vgafb_stdscreen = { 0, 0, /* will be filled in -- XXX shouldn't, it's global */ 0, 0, 0, - WSSCREEN_REVERSE + WSSCREEN_REVERSE|WSSCREEN_WSCOLORS }; const struct wsscreen_descr *vgafb_scrlist[] = { &vgafb_stdscreen, @@ -99,24 +91,14 @@ struct wsscreen_list vgafb_screenlist = { }; -struct wsdisplay_emulops vgafb_emulops = { - rcons_cursor, - rcons_mapchar, - rcons_putchar, - rcons_copycols, - rcons_erasecols, - rcons_copyrows, - rcons_eraserows, - rcons_alloc_attr -}; - struct wsdisplay_accessops vgafb_accessops = { vgafb_ioctl, vgafb_mmap, vgafb_alloc_screen, vgafb_free_screen, vgafb_show_screen, - 0 /* load_font */ + 0, /* load_font */ + 0 /* scrollback */ }; int vgafb_getcmap(struct vgafb_config *vc, struct wsdisplay_cmap *cm); @@ -473,7 +455,8 @@ vgafb_cnattach(iot, memt, pc, bus, device, function) long defattr; struct vgafb_devconfig *dc = &vgafb_console_dc; - struct rcons *ri = &dc->dc_ri; + struct rasops_info *ri = &dc->dc_rinfo; +#if 0 ri->rc_sp = &vgafb_raster; ri->rc_sp->width = cons_width; @@ -481,27 +464,25 @@ vgafb_cnattach(iot, memt, pc, bus, device, function) ri->rc_sp->depth = cons_depth; ri->rc_sp->linelongs = cons_linebytes /4; /* XXX */ ri->rc_sp->pixels = (void *)cons_display_mem_h; + ri->rc_crow = ri->rc_ccol = -1; ri->rc_crowp = &ri->rc_crow; ri->rc_ccolp = &ri->rc_ccol; - - rcons_init(ri, 160, 160); - - vgafb_stdscreen.nrows = ri->rc_maxrow; - vgafb_stdscreen.ncols = ri->rc_maxcol; - vgafb_stdscreen.textops = &vgafb_emulops; - rcons_alloc_attr(ri, 0, 0, 0, &defattr); - - #if 0 - { - int i; - for (i = 0; i < cons_width * cons_height; i++) { - bus_space_write_1(cons_membus, - cons_display_mem_h, i, 0x1); - - } - } - #endif +#endif + ri->ri_flg = RI_CENTER; + ri->ri_depth = cons_depth; + ri->ri_bits = (void *)cons_display_mem_h; + ri->ri_width = cons_width; + ri->ri_height = cons_height; + ri->ri_stride = cons_linebytes; + ri->ri_hw = dc; + + rasops_init(ri, 160, 160); + + vgafb_stdscreen.nrows = ri->ri_rows; + vgafb_stdscreen.ncols = ri->ri_cols; + vgafb_stdscreen.textops = &ri->ri_ops; + ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr); wsdisplay_cnattach(&vgafb_stdscreen, ri, 0, 0, defattr); } diff --git a/sys/arch/macppc/pci/vgafb_pci.c b/sys/arch/macppc/pci/vgafb_pci.c index 7b2aaa9f27d..817b75ed218 100644 --- a/sys/arch/macppc/pci/vgafb_pci.c +++ b/sys/arch/macppc/pci/vgafb_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb_pci.c,v 1.6 2002/03/27 20:54:42 drahn Exp $ */ +/* $OpenBSD: vgafb_pci.c,v 1.7 2002/04/29 01:34:58 drahn Exp $ */ /* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */ /* @@ -44,10 +44,11 @@ #include <dev/pci/pcivar.h> #include <dev/pci/pcidevs.h> -#include <dev/rcons/raster.h> #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/wscons/wscons_raster.h> +#include <dev/rasops/rasops.h> +#include <dev/wsfont/wsfont.h> #include <arch/macppc/pci/vgafbvar.h> #include <arch/macppc/pci/vgafb_pcivar.h> @@ -425,10 +426,11 @@ vgafb_alloc_screen(v, type, cookiep, curxp, curyp, attrp) if (sc->nscreens > 0) return (ENOMEM); - *cookiep = &sc->sc_vc->dc_rcons; /* one and only for now */ + *cookiep = &sc->sc_vc->dc_rinfo; /* one and only for now */ *curxp = 0; *curyp = 0; - rcons_alloc_attr(&sc->sc_vc->dc_rcons, 0, 0, 0, &defattr); + sc->sc_vc->dc_rinfo.ri_ops.alloc_attr(&sc->sc_vc->dc_rinfo, + 0, 0, 0, &defattr); *attrp = defattr; sc->nscreens++; return (0); diff --git a/sys/arch/macppc/pci/vgafbvar.h b/sys/arch/macppc/pci/vgafbvar.h index 58ca2de2305..2cdb95a9af6 100644 --- a/sys/arch/macppc/pci/vgafbvar.h +++ b/sys/arch/macppc/pci/vgafbvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafbvar.h,v 1.5 2002/03/26 16:51:43 drahn Exp $ */ +/* $OpenBSD: vgafbvar.h,v 1.6 2002/04/29 01:34:58 drahn Exp $ */ /* $NetBSD: vgavar.h,v 1.2 1996/11/23 06:06:43 cgd Exp $ */ /* @@ -54,10 +54,8 @@ struct vgafb_config { int (*vc_ioctl)(void *, u_long, caddr_t, int, struct proc *); paddr_t (*vc_mmap)(void *, off_t, int); - #if 0 - struct raster dc_raster; /* raster description */ - #endif - struct rcons dc_rcons; /* raster blitter control info */ + + struct rasops_info dc_rinfo; /* raster display data*/ bus_addr_t iobase; bus_size_t iosize; |