summaryrefslogtreecommitdiff
path: root/sys/arch/hp300/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-05-08 01:51:46 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-05-08 01:51:46 +0000
commitfc4743b33616494e99c1c362e3e135e57d8304ae (patch)
tree09ee3cbdad31eaadab6e2fc9b0f5d9253052477a /sys/arch/hp300/dev
parent37ec9eda4acf1dab4cec13bf7e177bc21061b2d1 (diff)
For 4bpp and 6bpp frame buffers, advertize highligting and colors capabilities
back after rasops has initialized, as it will treat anything < 8bpp as mono.
Diffstat (limited to 'sys/arch/hp300/dev')
-rw-r--r--sys/arch/hp300/dev/diofb.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/sys/arch/hp300/dev/diofb.c b/sys/arch/hp300/dev/diofb.c
index 1e6595b4172..2b0098baae2 100644
--- a/sys/arch/hp300/dev/diofb.c
+++ b/sys/arch/hp300/dev/diofb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diofb.c,v 1.6 2005/01/24 21:36:39 miod Exp $ */
+/* $OpenBSD: diofb.c,v 1.7 2005/05/08 01:51:45 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -79,6 +79,9 @@
#include <hp300/dev/diofbreg.h>
#include <hp300/dev/diofbvar.h>
+extern int rasops_alloc_cattr(void *, int, int, int, long *);
+
+int diofb_alloc_attr(void *, int, int, int, long *);
void diofb_copycols(void *, int, int, int, int);
void diofb_erasecols(void *, int, int, int, long);
void diofb_copyrows(void *, int, int, int);
@@ -183,10 +186,19 @@ diofb_fbsetup(struct diofb *fb)
diofb_resetcmap(fb);
- if (fb->planes <= 4)
- ri->ri_caps &= ~WSSCREEN_HILIT;
- if (fb->planes < 4)
- ri->ri_caps &= ~WSSCREEN_WSCOLORS;
+ /*
+ * Rasops is too conservative here, and will constrain
+ * less-than-8bpp frame buffers to mono mode.
+ * We know better and override here.
+ */
+ if (fb->planes >= 4) {
+ ri->ri_ops.alloc_attr = diofb_alloc_attr;
+ ri->ri_caps |= WSSCREEN_WSCOLORS;
+ }
+ if (fb->planes > 4) {
+ ri->ri_ops.alloc_attr = rasops_alloc_cattr;
+ ri->ri_caps |= WSSCREEN_HILIT;
+ }
ri->ri_ops.copycols = diofb_copycols;
ri->ri_ops.copyrows = diofb_copyrows;
@@ -320,6 +332,15 @@ diofb_end_attach(void *sc, struct wsdisplay_accessops *accessops,
* Common wsdisplay emulops for DIO frame buffers
*/
+int
+diofb_alloc_attr(void *cookie, int fg, int bg, int flg, long *attr)
+{
+ if ((flg & (WSATTR_BLINK | WSATTR_HILIT)) != 0)
+ return (EINVAL);
+
+ return (rasops_alloc_cattr(cookie, fg, bg, flg, attr));
+}
+
void
diofb_copycols(void *cookie, int row, int src, int dst, int n)
{