Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/sun Initialize the FBC mode register in cg6attach().



details:   https://anonhg.NetBSD.org/src/rev/f17b78f9c826
branches:  trunk
changeset: 502009:f17b78f9c826
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Jan 10 13:26:52 2001 +0000

description:
Initialize the FBC mode register in cg6attach().
Values are taken from sunGX.[ch] in xsrc.

Now RASTERCONSOLE works properly on my SS1+ with old 2-slot sbus cg6.

diffstat:

 sys/dev/sun/cgsix.c    |  40 +++++++++++++++++++++++++++++++++++++++-
 sys/dev/sun/cgsixreg.h |   5 +++--
 2 files changed, 42 insertions(+), 3 deletions(-)

diffs (87 lines):

diff -r 3921ac2588e5 -r f17b78f9c826 sys/dev/sun/cgsix.c
--- a/sys/dev/sun/cgsix.c       Wed Jan 10 13:20:17 2001 +0000
+++ b/sys/dev/sun/cgsix.c       Wed Jan 10 13:26:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsix.c,v 1.4 2000/11/05 22:59:27 chs Exp $ */
+/*     $NetBSD: cgsix.c,v 1.5 2001/01/10 13:26:52 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -159,6 +159,26 @@
  * Magic values for blitter
  */
 
+/* Values for the mode register */
+#define CG6_MODE       (                                               \
+         0x00200000 /* GX_BLIT_SRC */                                  \
+       | 0x00020000 /* GX_MODE_COLOR8 */                               \
+       | 0x00008000 /* GX_DRAW_RENDER */                               \
+       | 0x00002000 /* GX_BWRITE0_ENABLE */                            \
+       | 0x00001000 /* GX_BWRITE1_DISABLE */                           \
+       | 0x00000200 /* GX_BREAD_0 */                                   \
+       | 0x00000080 /* GX_BDISP_0 */                                   \
+)
+#define CG6_MODE_MASK  (                                               \
+         0x00300000 /* GX_BLIT_ALL */                                  \
+       | 0x00060000 /* GX_MODE_ALL */                                  \
+       | 0x00018000 /* GX_DRAW_ALL */                                  \
+       | 0x00006000 /* GX_BWRITE0_ALL */                               \
+       | 0x00001800 /* GX_BWRITE1_ALL */                               \
+       | 0x00000600 /* GX_BREAD_ALL */                                 \
+       | 0x00000180 /* GX_BDISP_ALL */                                 \
+)
+
 /* Value for the alu register for screen-to-screen copies */
 #define CG6_ALU_COPY   (                                               \
          0x80000000 /* GX_PLANE_ONES (ignore planemask register) */    \
@@ -224,6 +244,23 @@
                /*EMPTY*/;                                              \
 } while (0)
 
+static void cg6_ras_init(struct cgsix_softc *);
+static void cg6_ras_copyrows(void *, int, int, int);
+static void cg6_ras_copycols(void *, int, int, int, int);
+static void cg6_ras_erasecols(void *, int, int, int, long int);
+static void cg6_ras_eraserows(void *, int, int, long int);
+static void cg6_ras_do_cursor(struct rasops_info *);
+
+static void
+cg6_ras_init(struct cgsix_softc *sc)
+{
+       volatile struct cg6_fbc *fbc = sc->sc_fbc;
+
+       CG6_DRAIN(fbc);
+       fbc->fbc_mode &= ~CG6_MODE_MASK;
+       fbc->fbc_mode |= CG6_MODE;
+}
+
 static void
 cg6_ras_copyrows(void *cookie, int src, int dst, int n)
 {
@@ -478,6 +515,7 @@
                        sc->sc_fb.fb_rinfo.ri_ops.erasecols = cg6_ras_erasecols;
                        sc->sc_fb.fb_rinfo.ri_ops.eraserows = cg6_ras_eraserows;
                        sc->sc_fb.fb_rinfo.ri_do_cursor = cg6_ras_do_cursor;
+                       cg6_ras_init(sc);
                }
 #endif
        }
diff -r 3921ac2588e5 -r f17b78f9c826 sys/dev/sun/cgsixreg.h
--- a/sys/dev/sun/cgsixreg.h    Wed Jan 10 13:20:17 2001 +0000
+++ b/sys/dev/sun/cgsixreg.h    Wed Jan 10 13:26:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgsixreg.h,v 1.2 2000/08/26 16:06:22 eeh Exp $ */
+/*     $NetBSD: cgsixreg.h,v 1.3 2001/01/10 13:26:52 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1993
@@ -166,7 +166,8 @@
  * stuff canned values in them (eg, offx).
  */
 struct cg6_fbc {
-       u_int32_t fbc_pad1[2];
+       u_int32_t fbc_pad1[1];
+       u_int32_t fbc_mode;             /* mode setting */
        u_int32_t fbc_clip;             /* function unknown */
        u_int32_t fbc_pad2[1];
        u_int32_t fbc_s;                /* global status */



Home | Main Index | Thread Index | Old Index