From b57a927948b35976c223c87b0e42ce62c1285227 Mon Sep 17 00:00:00 2001 From: Martin Reindl Date: Tue, 27 Sep 2005 07:15:20 +0000 Subject: missing pieces for RBV video handling from NetBSD --- sys/arch/mac68k/dev/grf_iv.c | 41 +++++++++++++++++++++++++++++++++++++++- sys/arch/mac68k/include/viareg.h | 4 ++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/sys/arch/mac68k/dev/grf_iv.c b/sys/arch/mac68k/dev/grf_iv.c index 14341318213..152a64bfb6d 100644 --- a/sys/arch/mac68k/dev/grf_iv.c +++ b/sys/arch/mac68k/dev/grf_iv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grf_iv.c,v 1.29 2005/09/26 15:44:05 martin Exp $ */ +/* $OpenBSD: grf_iv.c,v 1.30 2005/09/27 07:15:19 martin Exp $ */ /* $NetBSD: grf_iv.c,v 1.17 1997/02/20 00:23:27 scottr Exp $ */ /* @@ -182,6 +182,12 @@ grfiv_match(parent, vcf, aux) bus_space_unmap(oa->oa_tag, bsh, 0x1000); break; + case MACH_CLASSIIci: + case MACH_CLASSIIsi: + if (mac68k_vidlen == 0 || + (via2_reg(rMonitor) & RBVMonitorMask) == RBVMonIDNone) + found = 0; + break; default: if (mac68k_vidlen == 0) found = 0; @@ -282,6 +288,39 @@ grfiv_attach(parent, self, aux) printf(" @ %lx", sc->sc_basepa + sc->sc_fbofs); #endif printf(": Civic\n"); + break; + case MACH_CLASSIIci: + case MACH_CLASSIIsi: + sc->sc_basepa = trunc_page(mac68k_vidphys); + sc->sc_fbofs = m68k_page_offset(mac68k_vidphys); + length = mac68k_vidlen + sc->sc_fbofs; + +#ifdef DEBUG + printf(" @ %lx", sc->sc_basepa + sc->sc_fbofs); +#endif + printf(": RBV"); +#ifdef DEBUG + switch (via2_reg(rMonitor) & RBVMonitorMask) { + case RBVMonIDBWP: + printf(": 15\" monochrome portrait"); + break; + case RBVMonIDRGB12: + printf(": 12\" color"); + break; + case RBVMonIDRGB15: + printf(": 15\" color"); + break; + case RBVMonIDStd: + printf(": Macintosh II"); + break; + default: + printf(": unrecognized"); + break; + } + printf(" display"); +#endif + printf("\n"); + break; default: sc->sc_basepa = trunc_page(mac68k_vidphys); diff --git a/sys/arch/mac68k/include/viareg.h b/sys/arch/mac68k/include/viareg.h index c9bd825960e..27ec412fe65 100644 --- a/sys/arch/mac68k/include/viareg.h +++ b/sys/arch/mac68k/include/viareg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: viareg.h,v 1.15 2005/02/06 19:51:35 martin Exp $ */ +/* $OpenBSD: viareg.h,v 1.16 2005/09/27 07:15:19 martin Exp $ */ /* $NetBSD: viareg.h,v 1.6 1997/02/28 07:41:41 scottr Exp $ */ /*- @@ -179,7 +179,7 @@ extern int VIA2; #define RBVMonitorMask 0x38 /* Type numbers */ #define RBVOff 0x40 /* Monitor turned off */ #define RBVMonIDBWP 0x08 /* 15 inch BW portrait */ -#define RBVMonIDRGB 0x10 /* 12 inch colorr */ +#define RBVMonIDRGB12 0x10 /* 12 inch color */ #define RBVMonIDRGB15 0x28 /* 15 inch RGB */ #define RBVMonIDStd 0x30 /* 12 inch BW or 13 inch color */ #define RBVMonIDNone 0x38 /* No monitor connected */ -- cgit v1.2.3