Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Finish with fixing the SOFTCURSOR stuff.



details:   https://anonhg.NetBSD.org/src/rev/1d9f53f76509
branches:  trunk
changeset: 481235:1d9f53f76509
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Jan 25 02:44:03 2000 +0000

description:
Finish with fixing the SOFTCURSOR stuff.

diffstat:

 sys/dev/ic/pcdisplay_subr.c |  34 ++++++++++++++++++++++++++--------
 sys/dev/ic/pcdisplayvar.h   |   4 ++--
 sys/dev/ic/vga.c            |  10 ++--------
 sys/dev/ic/vga_subr.c       |   8 ++------
 sys/dev/isa/ega.c           |  10 ++--------
 sys/dev/isa/pcdisplay.c     |   5 ++---
 6 files changed, 36 insertions(+), 35 deletions(-)

diffs (182 lines):

diff -r fffbec5ca0be -r 1d9f53f76509 sys/dev/ic/pcdisplay_subr.c
--- a/sys/dev/ic/pcdisplay_subr.c       Tue Jan 25 02:39:52 2000 +0000
+++ b/sys/dev/ic/pcdisplay_subr.c       Tue Jan 25 02:44:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcdisplay_subr.c,v 1.13 2000/01/12 14:42:21 ad Exp $ */
+/* $NetBSD: pcdisplay_subr.c,v 1.14 2000/01/25 02:44:03 ad Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -41,14 +41,34 @@
 #include <dev/wscons/wsdisplayvar.h>
 
 void
-pcdisplay_cursor_init(scr)
+pcdisplay_cursor_init(scr, existing)
        struct pcdisplayscreen *scr;
+       int existing;
 {
+#ifdef PCDISPLAY_SOFTCURSOR
+       bus_space_tag_t memt;
+       bus_space_handle_t memh;
+       int off;
 
-#ifdef PCDISPLAY_SOFTCURSOR
        pcdisplay_6845_write(scr->hdl, curstart, 0x10);
        pcdisplay_6845_write(scr->hdl, curend, 0x10);
+       
+       if (existing) {
+               /*
+                * This is the first screen. At this point, scr->active is
+                * false and scr->mem is NULL (no backing store), so we
+                * can't use pcdisplay_cursor() to do this.
+                */
+               memt = scr->hdl->ph_memt;
+               memh = scr->hdl->ph_memh;
+               off = (scr->vc_crow * scr->type->ncols + scr->vc_ccol) * 2 +
+                   scr->dispoffset;
+
+               scr->cursortmp = bus_space_read_2(memt, memh, off);
+               bus_space_write_2(memt, memh, off, scr->cursortmp ^ 0x7700);
+       }
 #endif
+       scr->cursoron = 1;
 }
 
 void
@@ -80,11 +100,9 @@
 
        off = (scr->vc_crow * scr->type->ncols + scr->vc_ccol);
        if (scr->active) {
-               off <<= 1;
-               scr->cursortmp = bus_space_read_2(memt, memh, 
-                   scr->dispoffset + off);
-               bus_space_write_2(memt, memh, scr->dispoffset + off,
-                   scr->cursortmp ^ 0x7700);
+               off = off * 2 + scr->dispoffset;
+               scr->cursortmp = bus_space_read_2(memt, memh, off);
+               bus_space_write_2(memt, memh, off, scr->cursortmp ^ 0x7700);
        } else {
                scr->cursortmp = scr->mem[off];
                scr->mem[off] = scr->cursortmp ^ 0x7700;
diff -r fffbec5ca0be -r 1d9f53f76509 sys/dev/ic/pcdisplayvar.h
--- a/sys/dev/ic/pcdisplayvar.h Tue Jan 25 02:39:52 2000 +0000
+++ b/sys/dev/ic/pcdisplayvar.h Tue Jan 25 02:44:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcdisplayvar.h,v 1.7 2000/01/05 16:14:35 ad Exp $ */
+/* $NetBSD: pcdisplayvar.h,v 1.8 2000/01/25 02:44:03 ad Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -83,7 +83,7 @@
 #define pcdisplay_6845_write(ph, reg, val) \
        _pcdisplay_6845_write(ph, offsetof(struct reg_mc6845, reg), val)
 
-void   pcdisplay_cursor_init __P((struct pcdisplayscreen *));
+void   pcdisplay_cursor_init __P((struct pcdisplayscreen *, int));
 void   pcdisplay_cursor __P((void *, int, int, int));
 #if 0
 unsigned int pcdisplay_mapchar_simple __P((void *, int));
diff -r fffbec5ca0be -r 1d9f53f76509 sys/dev/ic/vga.c
--- a/sys/dev/ic/vga.c  Tue Jan 25 02:39:52 2000 +0000
+++ b/sys/dev/ic/vga.c  Tue Jan 25 02:44:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vga.c,v 1.24 2000/01/05 16:14:35 ad Exp $ */
+/* $NetBSD: vga.c,v 1.25 2000/01/25 02:44:03 ad Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -415,8 +415,6 @@
                if (scr->pcs.dispoffset < scr->mindispoffset ||
                    scr->pcs.dispoffset > scr->maxdispoffset)
                        scr->pcs.dispoffset = scr->mindispoffset;
-                       
-               pcdisplay_cursor_init(&scr->pcs);
        } else {
                cpos = 0;
                scr->pcs.dispoffset = scr->mindispoffset;
@@ -424,11 +422,7 @@
 
        scr->pcs.vc_crow = cpos / type->ncols;
        scr->pcs.vc_ccol = cpos % type->ncols;
-#ifdef PCDISPLAY_SOFTCURSOR
-       scr->pcs.cursoron = 0;
-#else
-       scr->pcs.cursoron = 1;
-#endif
+       pcdisplay_cursor_init(&scr->pcs, existing);
 
 #ifdef __alpha__
        if (!vc->hdl.vh_mono)
diff -r fffbec5ca0be -r 1d9f53f76509 sys/dev/ic/vga_subr.c
--- a/sys/dev/ic/vga_subr.c     Tue Jan 25 02:39:52 2000 +0000
+++ b/sys/dev/ic/vga_subr.c     Tue Jan 25 02:44:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vga_subr.c,v 1.5 1999/09/19 21:48:08 ad Exp $ */
+/* $NetBSD: vga_subr.c,v 1.6 2000/01/25 02:44:03 ad Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -141,11 +141,7 @@
        /* lo byte */
        vga_6845_write(vh, vde, type->fontheight * type->nrows - 1);
 
-#ifdef PCDISPLAY_SOFTCURSOR
-       /* disable hardware cursor */
-       vga_6845_write(vh, curstart, 0x10);
-       vga_6845_write(vh, curend, 0x10);
-#else
+#ifndef PCDISPLAY_SOFTCURSOR
        /* set cursor to last 2 lines */
        vga_6845_write(vh, curstart, type->fontheight - 2);
        vga_6845_write(vh, curend, type->fontheight - 1);
diff -r fffbec5ca0be -r 1d9f53f76509 sys/dev/isa/ega.c
--- a/sys/dev/isa/ega.c Tue Jan 25 02:39:52 2000 +0000
+++ b/sys/dev/isa/ega.c Tue Jan 25 02:44:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ega.c,v 1.2 2000/01/05 18:27:47 ad Exp $ */
+/* $NetBSD: ega.c,v 1.3 2000/01/25 02:44:04 ad Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -373,8 +373,6 @@
                if (scr->pcs.dispoffset < scr->mindispoffset ||
                    scr->pcs.dispoffset > scr->maxdispoffset)
                        scr->pcs.dispoffset = scr->mindispoffset;
-
-               pcdisplay_cursor_init(&scr->pcs);
        } else {
                cpos = 0;
                scr->pcs.dispoffset = scr->mindispoffset;
@@ -382,11 +380,7 @@
 
        scr->pcs.vc_crow = cpos / type->ncols;
        scr->pcs.vc_ccol = cpos % type->ncols;
-#ifdef PCDISPLAY_SOFTCURSOR
-       scr->pcs.cursoron = 0;
-#else
-       scr->pcs.cursoron = 1;
-#endif
+       pcdisplay_cursor_init(&scr->pcs, existing);
 
        res = ega_alloc_attr(scr, 0, 0, 0, attrp);
 #ifdef DIAGNOSTIC
diff -r fffbec5ca0be -r 1d9f53f76509 sys/dev/isa/pcdisplay.c
--- a/sys/dev/isa/pcdisplay.c   Tue Jan 25 02:39:52 2000 +0000
+++ b/sys/dev/isa/pcdisplay.c   Tue Jan 25 02:44:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcdisplay.c,v 1.8 2000/01/05 16:14:36 ad Exp $ */
+/* $NetBSD: pcdisplay.c,v 1.9 2000/01/25 02:44:04 ad Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -211,8 +211,7 @@
 
        dc->pcs.vc_crow = cpos / pcdisplay_scr.ncols;
        dc->pcs.vc_ccol = cpos % pcdisplay_scr.ncols;
-       dc->pcs.cursoron = 1;
-       pcdisplay_cursor_init(&dc->pcs);
+       pcdisplay_cursor_init(&dc->pcs, 1);
 }
 
 int



Home | Main Index | Thread Index | Old Index