add support for 12-bit color displays, from Timm Wetzel w/ changes by

me.  closes 10741.
This commit is contained in:
deberg 2000-09-29 06:35:57 +00:00
parent a295f43fb1
commit 623e319553
4 changed files with 37 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nextcons.c,v 1.2 1999/04/29 14:51:20 bad Exp $ */
/* $NetBSD: nextcons.c,v 1.3 2000/09/29 06:35:57 deberg Exp $ */
/*
* Copyright (c) 1999 Darrin B. Jewell
@ -67,7 +67,9 @@ nextcnprobe(struct consdev *cp)
{
if ((rom_machine_type == NeXT_WARP9)
|| (rom_machine_type == NeXT_X15))
|| (rom_machine_type == NeXT_X15)
|| (rom_machine_type == NeXT_WARP9C)
|| (rom_machine_type == NeXT_TURBO_COLOR))
cp->cn_pri = CN_INTERNAL;
else
cp->cn_pri = CN_DEAD;

View File

@ -1,4 +1,4 @@
/* $NetBSD: nextdisplay.c,v 1.4 2000/06/26 04:55:52 simonb Exp $ */
/* $NetBSD: nextdisplay.c,v 1.5 2000/09/29 06:35:57 deberg Exp $ */
/*
* Copyright (c) 1998 Matt DeBergalis
@ -141,7 +141,9 @@ nextdisplay_match(parent, match, aux)
void *aux;
{
if ((rom_machine_type == NeXT_WARP9)
|| (rom_machine_type == NeXT_X15))
|| (rom_machine_type == NeXT_X15)
|| (rom_machine_type == NeXT_WARP9C)
|| (rom_machine_type == NeXT_TURBO_COLOR))
return (1);
else
return (0);
@ -168,9 +170,9 @@ nextdisplay_init(dc, color)
dc->dc_paddr = color ? COLORP(addr) : MONOP(addr);
dc->dc_size = color ? NEXT_P_C16_VIDEOSIZE : NEXT_P_VIDEOSIZE;
dc->dc_wid = 1152; /* XXX color */
dc->dc_ht = 832; /* XXX color */
dc->dc_depth = color ? 8 : 2;
dc->dc_wid = color ? 1152 : 1152;
dc->dc_ht = color ? 832 : 832;
dc->dc_depth = color ? 16 : 2;
dc->dc_rowbytes = dc->dc_wid * dc->dc_depth / 8;
dc->dc_videobase = dc->dc_vaddr;
@ -194,12 +196,15 @@ nextdisplay_init(dc, color)
/* clear the screen */
for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t))
*(u_int32_t *)(dc->dc_videobase + i) = 0xffffffff;
*(u_int32_t *)(dc->dc_videobase + i) =
(color ? 0x0 : 0xffffffff);
printf("done clearing\n", dc->dc_videobase);
rap = &dc->dc_raster;
rap->width = dc->dc_wid;
rap->height = dc->dc_ht;
rap->depth = color ? 8 : 2;
rap->depth = color ? 16 : 2;
rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
rap->pixels = (u_int32_t *)dc->dc_videobase;
@ -234,7 +239,8 @@ nextdisplay_attach(parent, self, aux)
sc = (struct nextdisplay_softc *)self;
if (rom_machine_type == NeXT_WARP9C) {
if ((rom_machine_type == NeXT_WARP9C)
|| (rom_machine_type == NeXT_TURBO_COLOR)) {
iscolor = 1;
addr = (paddr_t)colorbase;
} else {
@ -338,7 +344,9 @@ nextdisplay_alloc_screen(v, type, cookiep, curxp, curyp, defattrp)
*curxp = 0;
*curyp = 0;
rcons_alloc_attr(&sc->sc_dc->dc_rcons, 0, 0,
WSATTR_REVERSE, &defattr);
(strcmp(type->name, "color") == 0)
? 0
: WSATTR_REVERSE, &defattr);
*defattrp = defattr;
sc->nscreens++;
#if 0
@ -388,7 +396,8 @@ nextdisplay_cnattach(void)
long defattr;
int iscolor;
if (rom_machine_type == NeXT_WARP9C) {
if ((rom_machine_type == NeXT_WARP9C)
|| (rom_machine_type == NeXT_TURBO_COLOR)) {
iscolor = 1;
nextdisplay_consaddr = (paddr_t)colorbase;
} else {
@ -399,7 +408,8 @@ nextdisplay_cnattach(void)
/* set up the display */
nextdisplay_init(&nextdisplay_console_dc, iscolor);
rcons_alloc_attr(&dc->dc_rcons, 0, 0, WSATTR_REVERSE, &defattr);
rcons_alloc_attr(&dc->dc_rcons, 0, 0,
iscolor ? 0 : WSATTR_REVERSE, &defattr);
wsdisplay_cnattach(iscolor ? &nextdisplay_color : &nextdisplay_mono,
&dc->dc_rcons, 0, 0, defattr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus_space.h,v 1.5 1999/04/10 14:06:27 drochner Exp $ */
/* $NetBSD: bus_space.h,v 1.6 2000/09/29 06:35:57 deberg Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -83,9 +83,11 @@ typedef u_long bus_space_handle_t;
#define NEXT68K_INTIO_BUS_SPACE intiobase
/*
* Value for the next68k mono video bus space tag, not to be used directly by MI code.
* Values for the next68k video bus space tags, not to be used directly
* by MI code.
*/
#define NEXT68K_MONO_VIDEO_BUS_SPACE monobase
#define NEXT68K_COLOR_VIDEO_BUS_SPACE colorbase
/*
* Mapping and unmapping operations.
@ -95,7 +97,8 @@ typedef u_long bus_space_handle_t;
((*(hp)=(bus_space_handle_t)((t)+((a)-INTIOBASE))),0) : \
((((a)>=MONOBASE)&&((a)+(s)<MONOTOP)) ? \
((*(hp)=(bus_space_handle_t)((t)+((a)-MONOBASE))),0) : \
(-1)))
((((a)>=COLORBASE)&&((a)+(s)<COLORTOP)) ? \
((*(hp)=(bus_space_handle_t)((t)+((a)-COLORBASE))),0) : (-1))))
#define bus_space_unmap(t, h, s)

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.13 2000/08/25 01:04:10 thorpej Exp $ */
/* $NetBSD: cpu.h,v 1.14 2000/09/29 06:35:57 deberg Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -299,7 +299,10 @@ void child_return __P((void *));
#define NEXT_P_MEMSIZE 0x04000000
#define NEXT_P_VIDEOMEM (NEXT_SLOT_ID+0x0b000000)
#define NEXT_P_VIDEOSIZE 0x0003a800
#if 0
#define NEXT_P_C16_VIDEOMEM (NEXT_SLOT_ID+0x06000000) /* COLOR_FB */
#endif
#define NEXT_P_C16_VIDEOMEM (0x2c000000)
#define NEXT_P_C16_VIDEOSIZE 0x001D4000 /* COLOR_FB */
#define NEXT_P_WF4VIDEO (NEXT_SLOT_ID+0x0c000000) /* w A+B-AB function */
#define NEXT_P_WF3VIDEO (NEXT_SLOT_ID+0x0d000000) /* w (1-A)B function */
@ -390,8 +393,8 @@ void child_return __P((void *));
#define INTIOTOP (0x02120000)
#define MONOBASE (0x0b000000)
#define MONOTOP (0x0b03a800)
#define COLORBASE (0x06000000)
#define COLORTOP (0x061D4000)
#define COLORBASE (0x2c000000)
#define COLORTOP (0x2c1D4000)
#define NEXT_INTR_BITS \
"\20\40NMI\37PFAIL\36TIMER\35ENETX_DMA\34ENETR_DMA\33SCSI_DMA\32DISK_DMA\31PRINTER_DMA\30SOUND_OUT_DMA\27SOUND_IN_DMA\26SCC_DMA\25DSP_DMA\24M2R_DMA\23R2M_DMA\22SCC\21REMOTE\20BUS\17DSP_4\16DISK|C16_VIDEO\15SCSI\14PRINTER\13ENETX\12ENETR\11SOUND_OVRUN\10PHONE\07DSP_3\06VIDEO\05MONITOR\04KYBD_MOUSE\03POWER\02SOFTINT1\01SOFTINT0"