Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/voyager run the console in 8 bit colour for addi...



details:   https://anonhg.NetBSD.org/src/rev/8637b2a0324b
branches:  trunk
changeset: 771076:8637b2a0324b
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Nov 08 06:56:07 2011 +0000

description:
run the console in 8 bit colour for additional speed
( on Gdium this scrolls more than twice as fast as the 16bit default mode )

diffstat:

 sys/dev/pci/voyager/voyagerfb.c |  22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diffs (79 lines):

diff -r 4fbb62ad07bd -r 8637b2a0324b sys/dev/pci/voyager/voyagerfb.c
--- a/sys/dev/pci/voyager/voyagerfb.c   Tue Nov 08 05:47:00 2011 +0000
+++ b/sys/dev/pci/voyager/voyagerfb.c   Tue Nov 08 06:56:07 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: voyagerfb.c,v 1.7 2011/10/18 17:59:01 macallan Exp $   */
+/*     $NetBSD: voyagerfb.c,v 1.8 2011/11/08 06:56:07 macallan Exp $   */
 
 /*
  * Copyright (c) 2009 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.7 2011/10/18 17:59:01 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyagerfb.c,v 1.8 2011/11/08 06:56:07 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -225,7 +225,7 @@
        sc->sc_dataport = bus_space_vaddr(sc->sc_memt, sc->sc_regh);
        sc->sc_dataport += SM502_DATAPORT;
 
-       reg = bus_space_read_4(sc->sc_memt, sc->sc_regh, SM502_PANEL_DISP_CRTL);
+       reg = bus_space_read_4(sc->sc_memt, sc->sc_regh, SM502_PANEL_DISP_CTRL);
        switch (reg & SM502_PDC_DEPTH_MASK) {
                case SM502_PDC_8BIT:
                        sc->sc_depth = 8;
@@ -277,6 +277,7 @@
        voyagerfb_setup_backlight(sc);
 
        /* init engine here */
+       sc->sc_depth = 8;
        voyagerfb_init(sc);
 
        ri = &sc->sc_console_screen.scr_ri;
@@ -639,6 +640,7 @@
 static void
 voyagerfb_init(struct voyagerfb_softc *sc)
 {
+       int reg;
 
        voyagerfb_wait(sc);
        /* disable colour compare */
@@ -657,21 +659,35 @@
        /* window is screen width */
        bus_space_write_4(sc->sc_memt, sc->sc_regh, SM502_WINDOW_WIDTH,
            sc->sc_width | (sc->sc_width << 16));
+       reg = bus_space_read_4(sc->sc_memt, sc->sc_regh, SM502_PANEL_DISP_CTRL);
+       reg &= ~SM502_PDC_DEPTH_MASK;
+       
        switch (sc->sc_depth) {
                case 8:
                        bus_space_write_4(sc->sc_memt, sc->sc_regh, 
                            SM502_STRETCH, SM502_STRETCH_8BIT);
+                       sc->sc_stride = sc->sc_width;
+                       reg |= SM502_PDC_8BIT;
                        break;
                case 16:
                        bus_space_write_4(sc->sc_memt, sc->sc_regh, 
                            SM502_STRETCH, SM502_STRETCH_16BIT);
+                       sc->sc_stride = sc->sc_width << 1;
+                       reg |= SM502_PDC_16BIT;
                        break;
                case 24:
                case 32:
                        bus_space_write_4(sc->sc_memt, sc->sc_regh, 
                            SM502_STRETCH, SM502_STRETCH_32BIT);
+                       sc->sc_stride = sc->sc_width << 2;
+                       reg |= SM502_PDC_32BIT;
                        break;
        }
+       bus_space_write_4(sc->sc_memt, sc->sc_regh, SM502_PANEL_FB_OFFSET,
+           (sc->sc_stride << 16) | sc->sc_stride);
+       bus_space_write_4(sc->sc_memt, sc->sc_regh, SM502_PANEL_DISP_CTRL,
+           reg);
+
        /* put the cursor at the end of video memory */
        sc->sc_cursor_addr = 16 * 1024 * 1024 - 16 * 64;        /* XXX */
        DPRINTF("%s: %08x\n", __func__, sc->sc_cursor_addr); 



Home | Main Index | Thread Index | Old Index