/* * Load a subset of the current (new) colormap into the Brooktree DAC. */ static void cgeightloadcmap(struct cgeight_softc *sc, int start, int ncolors) { volatile struct bt_regs *bt; u_int *ip; int count; ip = &sc->sc_cmap.cm_chip[BT_D4M3(start)]; /* start/4 * 3 */ count = BT_D4M3(start + ncolors - 1) - BT_D4M3(start) + 3; bt = &sc->sc_fbc->fbc_dac; bt->bt_addr = BT_D4M4(start); while (--count >= 0) bt->bt_cmap = *ip++; }
void cgthree_loadcmap(struct cgthree_softc *sc, u_int start, u_int ncolors) { u_int cstart; int count; cstart = BT_D4M3(start); count = BT_D4M3(start + ncolors - 1) - BT_D4M3(start) + 3; BT_WRITE(sc, BT_ADDR, BT_D4M4(start)); while (--count >= 0) { BT_WRITE(sc, BT_CMAP, sc->sc_cmap.cm_chip[cstart]); cstart++; } }