Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sun - don't use defattr before it actually contains ...



details:   https://anonhg.NetBSD.org/src/rev/0dc28c8d3dca
branches:  trunk
changeset: 325073:0dc28c8d3dca
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Dec 03 17:01:04 2013 +0000

description:
- don't use defattr before it actually contains something useful
- clear the screen only once, when we know what colour to use
- set up the colour map only once, when we know which one to use
-> no more funky colour flashing while cgsix attaches on my U1

diffstat:

 sys/dev/sun/cgsix.c |  25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diffs (67 lines):

diff -r 85a7c8512f84 -r 0dc28c8d3dca sys/dev/sun/cgsix.c
--- a/sys/dev/sun/cgsix.c       Tue Dec 03 16:15:22 2013 +0000
+++ b/sys/dev/sun/cgsix.c       Tue Dec 03 17:01:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $ */
+/*     $NetBSD: cgsix.c,v 1.63 2013/12/03 17:01:04 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.62 2013/09/12 12:42:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix.c,v 1.63 2013/12/03 17:01:04 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -614,9 +614,6 @@
        vcons_init(&sc->vd, sc, &cgsix_defaultscreen, &cgsix_accessops);
        sc->vd.init_screen = cgsix_init_screen;
 
-       cg6_setup_palette(sc);
-       cgsix_clearscreen(sc);
-
        sc->sc_gc.gc_bitblt = cgsix_bitblt;
        sc->sc_gc.gc_blitcookie = sc;
        sc->sc_gc.gc_rop = CG6_ALU_COPY;
@@ -625,6 +622,19 @@
                /* we mess with cg6_console_screen only once */
                vcons_init_screen(&sc->vd, &cg6_console_screen, 1,
                    &defattr);
+               sc->sc_bg = (defattr >> 16) & 0xf; /* yes, this is an index into devcmap */
+               
+               /*
+                * XXX
+                * Is this actually necessary? We're going to use the blitter later on anyway.
+                */ 
+               /* We need unaccelerated initial screen clear on old revisions */
+               if (sc->sc_fhcrev < 2) {
+                       memset(sc->sc_fb.fb_pixels, ri->ri_devcmap[sc->sc_bg],
+                           sc->sc_stride * sc->sc_height);
+               } else
+                       cgsix_clearscreen(sc);
+
                cg6_console_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
                
                cgsix_defaultscreen.textops = &ri->ri_ops;
@@ -655,6 +665,7 @@
                            &defattr);
                } else
                        (*ri->ri_ops.allocattr)(ri, 0, 0, 0, &defattr);
+               sc->sc_bg = (defattr >> 16) & 0xf;
                if (ri->ri_flg & RI_ENABLE_ALPHA) {
                        glyphcache_init(&sc->sc_gc, sc->sc_height + 5,
                                (sc->sc_ramsize / sc->sc_stride) - 
@@ -1297,10 +1308,6 @@
        }
        ri->ri_bits = sc->sc_fb.fb_pixels;
        
-       /* We need unaccelerated initial screen clear on old revisions */
-       if (sc->sc_fhcrev < 2)
-               memset(sc->sc_fb.fb_pixels, (*defattr >> 16) & 0xff,
-                   sc->sc_stride * sc->sc_height);
        rasops_init(ri, 0, 0);
        ri->ri_caps = WSSCREEN_WSCOLORS | WSSCREEN_REVERSE;
        rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,



Home | Main Index | Thread Index | Old Index