Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sbus - finally fix tcx_clearscreen() and tcx_erasero...



details:   https://anonhg.NetBSD.org/src/rev/fcd732697ce2
branches:  trunk
changeset: 818071:fcd732697ce2
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Sep 23 17:45:25 2016 +0000

description:
- finally fix tcx_clearscreen() and tcx_eraserows() to actually work, and
  not just by accident
- sprinkle volatile in order to force gcc 5.4 to emit ldd/std for 64bit
  accesses - BLIT and STIP spaces require those

diffstat:

 sys/dev/sbus/tcx.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (90 lines):

diff -r 25ac0b20a5ee -r fcd732697ce2 sys/dev/sbus/tcx.c
--- a/sys/dev/sbus/tcx.c        Fri Sep 23 16:55:56 2016 +0000
+++ b/sys/dev/sbus/tcx.c        Fri Sep 23 17:45:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcx.c,v 1.56 2014/07/25 08:10:38 dholland Exp $ */
+/*     $NetBSD: tcx.c,v 1.57 2016/09/23 17:45:25 macallan Exp $ */
 
 /*
  *  Copyright (c) 1996, 1998, 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.56 2014/07/25 08:10:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcx.c,v 1.57 2016/09/23 17:45:25 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,8 +87,8 @@
        bus_space_handle_t sc_bt;       /* Brooktree registers */
        bus_space_handle_t sc_thc;      /* THC registers */
        uint8_t         *sc_fbaddr;     /* framebuffer */
-       uint64_t        *sc_rblit;      /* blitspace */
-       uint64_t        *sc_rstip;      /* stipple space */
+       volatile uint64_t       *sc_rblit;      /* blitspace */
+       volatile uint64_t       *sc_rstip;      /* stipple space */
 
        short           sc_8bit;        /* true if 8-bit hardware */
        short           sc_blanked;     /* true if blanked */
@@ -884,11 +884,11 @@
 tcx_clearscreen(struct tcx_softc *sc, int spc)
 {
        /* ROP in the upper 4bit is necessary, tcx actually uses it */
-       uint64_t bg = 0x30000000ffffffffLL;
-       uint64_t spc64;
+       volatile uint64_t bg = 0x30000000ffffffffLL;
+       volatile uint64_t spc64;
        int i, len;
 
-       spc64 = ((spc & 3) << 24) | sc->sc_bg;
+       spc64 = ((spc & 3) << 24);
        bg |= (spc64 << 32);
 
        len = sc->sc_fb.fb_type.fb_width * sc->sc_fb.fb_type.fb_height;
@@ -947,7 +947,7 @@
        struct rasops_info *ri = cookie;
        struct vcons_screen *scr = ri->ri_hw;
        struct tcx_softc *sc = scr->scr_cookie;
-       uint64_t temp;
+       volatile uint64_t temp;
        int i, last, first, len, leftover;
 
        i = ri->ri_width * ri->ri_font->fontheight * nrows;
@@ -957,14 +957,14 @@
            (ri->ri_font->fontheight * start + ri->ri_yorigin);
        last = first + len;
        temp = 0x30000000ffffffffLL | 
-           ((uint64_t)ri->ri_devcmap[(attr >> 16) & 0xff] << 32);
+           ((uint64_t)((ri->ri_devcmap[(attr >> 16) & 0xff]) & 0xff) << 32);
 
-       for (i = first; i <= last; i+= 32)
-               sc->sc_rblit[i] = temp;
+       for (i = first; i < last; i+= 32)
+               sc->sc_rstip[i] = temp;
 
        if (leftover > 0) {
                temp &= 0xffffffffffffffffLL << (32 - leftover);
-               sc->sc_rblit[i] = temp;
+               sc->sc_rstip[i] = temp;
        }
 }
 /*
@@ -979,7 +979,7 @@
        struct wsdisplay_font *font = PICK_FONT(ri, c);
        struct vcons_screen *scr = ri->ri_hw;
        struct tcx_softc *sc = scr->scr_cookie;
-       uint64_t bg, fg, temp, mask;
+       volatile uint64_t bg, fg, temp, mask;
        int addr, i, uc, shift;
        uint32_t fmask;
        uint8_t *cdata;
@@ -1045,7 +1045,7 @@
                }
        } else {
                /* and now the split case ( man this hardware is dumb ) */
-               uint64_t bgr, maskr, fgr;
+               volatile uint64_t bgr, maskr, fgr;
                uint32_t bork;
 
                shift = addr & 0x1f;



Home | Main Index | Thread Index | Old Index