Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/luna68k/dev Properly initialize the palette for whi...



details:   https://anonhg.NetBSD.org/src/rev/8cc3bf2ebea9
branches:  trunk
changeset: 788786:8cc3bf2ebea9
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Jul 19 16:35:57 2013 +0000

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

diffstat:

 sys/arch/luna68k/dev/lunafb.c |  29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r 66261e6cd3b9 -r 8cc3bf2ebea9 sys/arch/luna68k/dev/lunafb.c
--- a/sys/arch/luna68k/dev/lunafb.c     Fri Jul 19 16:23:10 2013 +0000
+++ b/sys/arch/luna68k/dev/lunafb.c     Fri Jul 19 16:35:57 2013 +0000
@@ -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 @@
        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;



Home | Main Index | Thread Index | Old Index