164775Storek /* 2*65800Sbostic * Copyright (c) 1993 3*65800Sbostic * The Regents of the University of California. All rights reserved. 464775Storek * 564775Storek * This software was developed by the Computer Systems Engineering group 664775Storek * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 764775Storek * contributed to Berkeley. 864775Storek * 964775Storek * All advertising materials mentioning features or use of this software 1064775Storek * must display the following acknowledgement: 1164775Storek * This product includes software developed by the University of 1264775Storek * California, Lawrence Berkeley Laboratory. 1364775Storek * 1464775Storek * %sccs.include.redist.c% 1564775Storek * 16*65800Sbostic * @(#)btreg.h 8.2 (Berkeley) 01/21/94 1764775Storek * 1864775Storek * from: $Header: btreg.h,v 1.1 93/10/12 15:28:52 torek Exp $ 1964775Storek */ 2064775Storek 2164775Storek /* 2264775Storek * Several Sun color frame buffers use some kind of Brooktree video 2364775Storek * DAC (e.g., the Bt458, -- in any case, Brooktree make the only 2464775Storek * decent color frame buffer chips). 2564775Storek * 2664775Storek * Color map control on these is a bit funky in a SPARCstation. 2764775Storek * To update the color map one would normally do byte writes, but 2864775Storek * the hardware takes longword writes. Since there are three 2964775Storek * registers for each color map entry (R, then G, then B), we have 3064775Storek * to set color 1 with a write to address 0 (setting 0's R/G/B and 3164775Storek * color 1's R) followed by a second write to address 1 (setting 3264775Storek * color 1's G/B and color 2's R/G). Software must therefore keep 3364775Storek * a copy of the current map. 3464775Storek * 3564775Storek * The colormap address register increments automatically, so the 3664775Storek * above write is done as: 3764775Storek * 3864775Storek * bt->bt_addr = 0; 3964775Storek * bt->bt_cmap = R0G0B0R1; 4064775Storek * bt->bt_cmap = G1B1R2G2; 4164775Storek * ... 4264775Storek * 4364775Storek * Yow! 4464775Storek * 4564775Storek * Bonus complication: on the cg6, only the top 8 bits of each 32 bit 4664775Storek * register matter, even though the cg3 takes all the bits from all 4764775Storek * bytes written to it. 4864775Storek */ 4964775Storek struct bt_regs { 5064775Storek u_int bt_addr; /* map address register */ 5164775Storek u_int bt_cmap; /* colormap data register */ 5264775Storek u_int bt_ctrl; /* control register */ 5364775Storek u_int bt_omap; /* overlay (cursor) map register */ 5464775Storek }; 55