summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/hp300/dev/diofb.c10
-rw-r--r--sys/arch/hp300/dev/topcat.c11
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;