summaryrefslogtreecommitdiff
path: root/sys/arch/luna88k/dev/lunafb.c
diff options
context:
space:
mode:
authorKenji Aoyama <aoyama@cvs.openbsd.org>2021-09-17 12:02:32 +0000
committerKenji Aoyama <aoyama@cvs.openbsd.org>2021-09-17 12:02:32 +0000
commit802ce3b4d5d2814edfd4266a88c36247eeca0427 (patch)
treeacf101bb5a984a447fe8ef2b9f5d36c433e0e2b7 /sys/arch/luna88k/dev/lunafb.c
parenta8ce551f6bb01100afb3c7ca03336979fc8a4aa6 (diff)
Sync 1bpp initial palette setting with NetBSD/luna68k.
Tested by me on 1bpp framebuffer got recently.
Diffstat (limited to 'sys/arch/luna88k/dev/lunafb.c')
-rw-r--r--sys/arch/luna88k/dev/lunafb.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/arch/luna88k/dev/lunafb.c b/sys/arch/luna88k/dev/lunafb.c
index f7c56172f60..5b7a9320c6c 100644
--- a/sys/arch/luna88k/dev/lunafb.c
+++ b/sys/arch/luna88k/dev/lunafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lunafb.c,v 1.27 2020/05/25 09:55:48 jsg Exp $ */
+/* $OpenBSD: lunafb.c,v 1.28 2021/09/17 12:02:31 aoyama Exp $ */
/* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */
/*-
@@ -599,7 +599,27 @@ omfb_set_default_cmap(struct om_hwdevconfig *dc)
{
int i;
- if ((hwplanebits == 1) || (hwplanebits == 4)) {
+ if (hwplanebits == 1) {
+ struct bt454 *odac = (struct bt454 *)OMFB_RAMDAC;
+ /*
+ * On 1bpp framebuffer, only plane P0 has framebuffer memory
+ * and other planes seems pulled up, i.e. always 1.
+ * Set white only for a palette (P0,P1,P2,P3) = (1,1,1,1).
+ */
+ odac->bt_addr = 0;
+ for (i = 0; i < 15; i++) {
+ odac->bt_cmap = dc->dc_cmap.r[i] = 0;
+ odac->bt_cmap = dc->dc_cmap.g[i] = 0;
+ odac->bt_cmap = dc->dc_cmap.b[i] = 0;
+ }
+ /*
+ * The B/W video connector is connected to IOG of Bt454,
+ * and IOR and IOB are unused.
+ */
+ odac->bt_cmap = dc->dc_cmap.r[15] = 0;
+ odac->bt_cmap = dc->dc_cmap.g[15] = 255;
+ odac->bt_cmap = dc->dc_cmap.b[15] = 0;
+ } else if (hwplanebits == 4) {
struct bt454 *odac = (struct bt454 *)OMFB_RAMDAC;
odac->bt_addr = 0;