Module Name:    src
Committed By:   tsutsui
Date:           Fri Jul 19 16:35:57 UTC 2013

Modified Files:
        src/sys/arch/luna68k/dev: lunafb.c

Log Message:
Properly initialize the palette for while on black even on 1bpp framebuffer.
Preparing for demonstration in Open Source Conference 2013 Kyoto.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/luna68k/dev/lunafb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/luna68k/dev/lunafb.c
diff -u src/sys/arch/luna68k/dev/lunafb.c:1.26 src/sys/arch/luna68k/dev/lunafb.c:1.27
--- src/sys/arch/luna68k/dev/lunafb.c:1.26	Fri Jul 20 19:31:53 2012
+++ src/sys/arch/luna68k/dev/lunafb.c	Fri Jul 19 16:35:57 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: lunafb.c,v 1.26 2012/07/20 19:31:53 tsutsui Exp $ */
+/* $NetBSD: lunafb.c,v 1.27 2013/07/19 16:35:57 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.26 2012/07/20 19:31:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.27 2013/07/19 16:35:57 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -379,9 +379,30 @@ omfb_getdevconfig(paddr_t paddr, struct 
 	dc->dc_videobase = paddr;
 
 	/* WHITE on BLACK */
-	if (hwplanemask == 0x0f) {
-		/* XXX Need Bt454 more initialization */
+	if (hwplanemask == 0x01) {
+		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 = 0;
+			odac->bt_cmap = 0;
+			odac->bt_cmap = 0;
+		}
+		/*
+		 * The B/W video connector is connected to IOG of Bt454,
+		 * and IOR and IOB are unused.
+		 */
+		odac->bt_cmap = 0;
+		odac->bt_cmap = 255;
+		odac->bt_cmap = 0;
+	} else if (hwplanemask == 0x0f) {
 		struct bt454 *odac = (struct bt454 *)OMFB_RAMDAC;
+
 		odac->bt_addr = 0;
 		odac->bt_cmap = 0;
 		odac->bt_cmap = 0;

Reply via email to