diff options
-rw-r--r-- | sys/arch/amiga/dev/grf_ul.c | 76 | ||||
-rw-r--r-- | sys/arch/amiga/dev/grf_ultms.g (renamed from sys/arch/amiga/dev/grf_ul.gsp) | 0 | ||||
-rw-r--r-- | sys/arch/amiga/dev/ite_ul.c | 6 |
3 files changed, 69 insertions, 13 deletions
diff --git a/sys/arch/amiga/dev/grf_ul.c b/sys/arch/amiga/dev/grf_ul.c index 6e6c36401d7..919c074946f 100644 --- a/sys/arch/amiga/dev/grf_ul.c +++ b/sys/arch/amiga/dev/grf_ul.c @@ -1,4 +1,4 @@ -/* $NetBSD: grf_ul.c,v 1.7.2.1 1995/11/10 19:29:54 chopps Exp $ */ +/* $NetBSD: grf_ul.c,v 1.10 1995/12/27 07:24:27 chopps Exp $ */ #define UL_DEBUG /* @@ -59,6 +59,7 @@ int ul_ioctl __P((struct grf_softc *, u_long, void *, dev_t)); int ul_getcmap __P((struct grf_softc *, struct grf_colormap *, dev_t)); int ul_putcmap __P((struct grf_softc *, struct grf_colormap *, dev_t)); int ul_bitblt __P((struct grf_softc *, struct grf_bitblt *, dev_t)); +int ul_blank __P((struct grf_softc *, int *, dev_t)); /* * marked true early so that ulowell_cnprobe() can tell if we are alive. @@ -273,10 +274,7 @@ ul_load_code(gp) /* font info was uploaded in ite_ul.c(ite_ulinit). */ - /* unflush cache, unhalt cpu -> nmi starts to run */ - ba->ctrl &= ~(HLT|CF); - -#if 0 +#if 1 /* XXX load image palette with some initial values, slightly hacky */ ba->hstadrh = 0xfe80; @@ -293,17 +291,50 @@ ul_load_code(gp) /* * XXX load shadow overlay palette with what the TMS code will load - * into the real one some time after the TMS code is started above. - * This is a rude hack. + * into the real one some time after the TMS code is started below. + * This might be considered a rude hack. */ bcopy(ul_ovl_palette, gup->gus_ovcmap, 3*4); + + /* + * Unflush cache, unhalt cpu -> nmi starts to run. This MUST NOT BE + * DONE before the image color map initialization above, to guarantee + * the index register in the bt478 is not used by more than one CPU + * at once. + * + * XXX For the same reason, we'll have to rething ul_putcmap(). For + * details, look at comment there. + */ + ba->ctrl &= ~(HLT|CF); + #else - /* XXX This version will work for the overlay, if our queue codes + /* + * XXX I wonder why this partially ever worked. + * + * This can't possibly work this way, as we are copyin()ing data in + * ul_putcmap. + * + * I guess this partially worked because SFC happened to point to + * to supervisor data space on 68030 machines coming from the old + * boot loader. + * + * While this looks more correct than the hack in the other part of the + * loop, we would have to do our own version of the loop through + * colormap entries, set up command buffer, and call gsp_write(), or + * factor out some code. + */ + + /* + * XXX This version will work for the overlay, if our queue codes * initial conditions are set at load time (not start time). * It further assumes that ul_putcmap only uses the * GRFIMDEV/GRFOVDEV bits of the dev parameter. */ + + /* unflush cache, unhalt cpu first -> nmi starts to run */ + ba->ctrl &= ~(HLT|CF); + gcm.index = 0; gcm.count = 16; gcm.red = ul_std_palette + 0; @@ -721,6 +752,9 @@ ul_ioctl (gp, cmd, data, dev) case GRFIOCBITBLT: return ul_bitblt (gp, (struct grf_bitblt *) data, dev); + + case GRFIOCBLANK: + return ul_blank (gp, (int *) data, dev); } return EINVAL; @@ -810,6 +844,14 @@ ul_putcmap (gp, cmap, dev) /* then write from there to the hardware */ ba = (struct gspregs *)gp->g_regkva; + /* + * XXX This is a bad thing to do. + * We should always use the gsp call, or have a means to arbitrate + * the usage of the BT478 index register. Else there might be a + * race condition (when writing both colormaps at nearly the same + * time), where one CPU changes the index register when the other + * one has not finished using it. + */ if (mxidx > 4) { /* image color map: we can write, with a hack, directly */ ba->ctrl = LBL; @@ -840,6 +882,24 @@ ul_putcmap (gp, cmap, dev) return 0; } +int +ul_blank(gp, onoff, dev) + struct grf_softc *gp; + int *onoff; + dev_t dev; +{ + struct gspregs *gsp; + gsp = (struct gspregs *)gp->g_regkva; + gsp->ctrl = (gsp->ctrl & ~(INCR|INCW) | LBL); + gsp->hstadrh = 0xC000; + gsp->hstadrl = 0x0080; + if (*onoff) + gsp->data |= 0x9000; + else + gsp->data &= ~0x9000; + + return 0; +} /* * !!! THIS AREA UNDER CONSTRUCTION !!! */ diff --git a/sys/arch/amiga/dev/grf_ul.gsp b/sys/arch/amiga/dev/grf_ultms.g index 502af7b3323..502af7b3323 100644 --- a/sys/arch/amiga/dev/grf_ul.gsp +++ b/sys/arch/amiga/dev/grf_ultms.g diff --git a/sys/arch/amiga/dev/ite_ul.c b/sys/arch/amiga/dev/ite_ul.c index e5d302c755f..1bfd57a1825 100644 --- a/sys/arch/amiga/dev/ite_ul.c +++ b/sys/arch/amiga/dev/ite_ul.c @@ -1,4 +1,4 @@ -/* $NetBSD: ite_ul.c,v 1.1 1995/08/18 16:15:48 chopps Exp $ */ +/* $NetBSD: ite_ul.c,v 1.2 1995/12/27 08:09:51 chopps Exp $ */ /* * Copyright (c) 1995 Ignatios Souvatzis @@ -226,7 +226,6 @@ void ulowell_cursor(struct ite_softc *ip, int flag) { struct gspregs *ba; u_int16_t cmd[7]; - int pos; ba = (struct gspregs *)ip->grf->g_regkva; @@ -375,7 +374,6 @@ void ulowell_deinit(struct ite_softc *ip) void ulowell_putc(struct ite_softc *ip, int c, int dy, int dx, int mode) { struct gspregs *ba; - register u_int8_t attr; u_int16_t cmd[8]; ba = (struct gspregs *)ip->grf->g_regkva; @@ -416,8 +414,6 @@ void ulowell_clear(struct ite_softc *ip, int sy, int sx, int h, int w) void ulowell_scroll(struct ite_softc *ip, int sy, int sx, int count, int dir) { struct gspregs *ba; - - register int height, dy, i; u_int16_t cmd[7]; ba = (struct gspregs *)ip->grf->g_regkva; |