diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-09-28 21:10:59 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-09-28 21:10:59 +0000 |
commit | 92766ad10904a7fbd712e1399a7d2b4c2130222a (patch) | |
tree | 0aa0bbf9d808a488874e25212b49c757f41861a3 /sys/arch | |
parent | 4c20506fef90ef3b025a656e32f91d45c658b635 (diff) |
Model 332 has a monochrome 98542 on-board, instead of the expected 98544;
that particular model lacks the colormap chips (likely due to physical space
constraints) and lies about its visible geometry, in pure old HP frame buffer
style (before HP engineers realized the usefulness of providing correct data
to the operating system).
Work done by Andrew Gillham (last name on gmail), with unsignificant tweaks
by me.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hp300/dev/diofb.c | 10 | ||||
-rw-r--r-- | sys/arch/hp300/dev/topcat.c | 11 |
2 files changed, 18 insertions, 3 deletions
diff --git a/sys/arch/hp300/dev/diofb.c b/sys/arch/hp300/dev/diofb.c index 45996399714..6cf5b4cd093 100644 --- a/sys/arch/hp300/dev/diofb.c +++ b/sys/arch/hp300/dev/diofb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diofb.c,v 1.18 2010/12/26 15:40:59 miod Exp $ */ +/* $OpenBSD: diofb.c,v 1.19 2013/09/28 21:10:58 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -145,6 +145,14 @@ diofb_fbinquire(struct diofb *fb, int scode, struct diofbreg *fbr) if (fb->dheight > fb->fbheight) fb->dheight = fb->fbheight; + /* + * Some monochrome displays, such as the HP332 internal video + * appear to return a display width of 1024 instead of 512. + */ + if (fbr->num_planes == 1 && fb->dheight == 400) + if (fb->dwidth == 1024) + fb->dwidth = 512; + fb->planes = fbr->num_planes; if (fb->planes > 8) fb->planes = 8; diff --git a/sys/arch/hp300/dev/topcat.c b/sys/arch/hp300/dev/topcat.c index 051c990ea47..0ce35491aea 100644 --- a/sys/arch/hp300/dev/topcat.c +++ b/sys/arch/hp300/dev/topcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: topcat.c,v 1.15 2006/08/11 18:33:13 miod Exp $ */ +/* $OpenBSD: topcat.c,v 1.16 2013/09/28 21:10:58 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -246,7 +246,10 @@ topcat_end_attach(struct topcat_softc *sc, u_int8_t id) case GID_TOPCAT: switch (sc->sc_fb->planes) { case 1: - fbname = "HP98544 topcat"; + if (sc->sc_fb->dheight == 400) + fbname = "HP98542 topcat"; + else + fbname = "HP98544 topcat"; break; case 4: if (sc->sc_fb->dheight == 400) @@ -415,6 +418,10 @@ topcat_setcolor(struct diofb *fb, u_int index) { volatile struct tcboxfb *tc = (struct tcboxfb *)fb->regkva; + /* Monochrome topcat may not have the colormap logic present */ + if (fb->planes <= 1) + return; + if (tc->regs.fbid != GID_TOPCAT) { tccm_waitbusy(tc); tc->plane_mask = 0xff; |