diff options
author | 2005-05-08 01:51:45 +0000 | |
---|---|---|
committer | 2005-05-08 01:51:45 +0000 | |
commit | 1b7884d7bf2375caa9f1ef0ec90bf8946ae0a857 (patch) | |
tree | 3f977ec895f4e809537900ead0661bd75945f4b5 | |
parent | PS/2 style and older style HIL keyboards have different layouts in their (diff) | |
download | wireguard-openbsd-1b7884d7bf2375caa9f1ef0ec90bf8946ae0a857.tar.xz wireguard-openbsd-1b7884d7bf2375caa9f1ef0ec90bf8946ae0a857.zip |
For 4bpp and 6bpp frame buffers, advertize highligting and colors capabilities
back after rasops has initialized, as it will treat anything < 8bpp as mono.
-rw-r--r-- | sys/arch/hp300/dev/diofb.c | 31 |
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) { |