Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/hpc Abort redrawing when screen switch was requested.



details:   https://anonhg.NetBSD.org/src/rev/552c3a48ffa0
branches:  trunk
changeset: 513435:552c3a48ffa0
user:      sato <sato%NetBSD.org@localhost>
date:      Tue Jul 31 10:50:06 2001 +0000

description:
Abort redrawing when screen switch was requested.
Set virtual text vram when other one is drawing framebuffer.

diffstat:

 sys/dev/hpc/hpcfb.c |  57 ++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 46 insertions(+), 11 deletions(-)

diffs (190 lines):

diff -r 176be6ee0e37 -r 552c3a48ffa0 sys/dev/hpc/hpcfb.c
--- a/sys/dev/hpc/hpcfb.c       Tue Jul 31 10:37:49 2001 +0000
+++ b/sys/dev/hpc/hpcfb.c       Tue Jul 31 10:50:06 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpcfb.c,v 1.11 2001/07/22 09:56:41 takemura Exp $      */
+/*     $NetBSD: hpcfb.c,v 1.12 2001/07/31 10:50:06 sato Exp $  */
 
 /*-
  * Copyright (c) 1999
@@ -46,7 +46,7 @@
 static const char _copyright[] __attribute__ ((unused)) =
     "Copyright (c) 1999 Shin Takemura.  All rights reserved.";
 static const char _rcsid[] __attribute__ ((unused)) =
-    "$NetBSD: hpcfb.c,v 1.11 2001/07/22 09:56:41 takemura Exp $";
+    "$NetBSD: hpcfb.c,v 1.12 2001/07/31 10:50:06 sato Exp $";
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -141,10 +141,15 @@
 #define HPCFB_DC_SCRTHREAD             0x20    /* in scroll thread or callout */
 #define HPCFB_DC_UPDATEALL             0x40    /* need to redraw all */
 #define HPCFB_DC_ABORT                 0x80    /* abort redrawing */
+#define        HPCFB_DC_SWITCHREQ              0x100   /* switch request exist */
        int     dc_memsize;
        u_char *dc_fbaddr;
 };
 
+#define IS_DRAWABLE(dc) \
+       (((dc)->dc_state&HPCFB_DC_CURRENT)&& \
+        (((dc)->dc_state&(HPCFB_DC_DRAWING|HPCFB_DC_SWITCHREQ)) == 0))
+
 #define HPCFB_MAX_SCREEN 5
 #define HPCFB_MAX_JUMP 5
 
@@ -776,6 +781,11 @@
                hpcfb_refresh_screen(sc);
                return (0);
        }
+       odc->dc_state |= HPCFB_DC_SWITCHREQ;
+
+       if ((odc->dc_state&HPCFB_DC_DRAWING) != 0) {
+               odc->dc_state |= HPCFB_DC_ABORT;
+       }
 
        sc->sc_wantedscreen = cookie;
        sc->sc_switchcb = cb;
@@ -802,11 +812,14 @@
 
        if (!dc) {
                (*sc->sc_switchcb)(sc->sc_switchcbarg, EIO, 0);
+               odc->dc_state &= ~HPCFB_DC_SWITCHREQ;
                return;
        }
 
-       if (odc == dc)
+       if (odc == dc) {
+               odc->dc_state &= ~HPCFB_DC_SWITCHREQ;
                return;
+       }
 
        if (odc) {
 #ifdef HPCFB_JUMP
@@ -824,6 +837,7 @@
        }
        /* switch screen to new one */
        dc->dc_state |= HPCFB_DC_CURRENT;
+       dc->dc_state &= ~HPCFB_DC_ABORT;
        dc->dc_rinfo.ri_bits = dc->dc_fbaddr;
        sc->sc_dc = dc;
 
@@ -834,6 +848,8 @@
        if (sc->sc_switchcb)
                (*sc->sc_switchcb)(sc->sc_switchcbarg, 0, 0);
 
+       odc->dc_state &= ~HPCFB_DC_SWITCHREQ;
+       dc->dc_state &= ~HPCFB_DC_SWITCHREQ;
        return;
 }
 
@@ -892,8 +908,9 @@
                return;
        }
 #endif /* HPCFB_JUMP */
-       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+       if (!IS_DRAWABLE(dc)) {
                return;
+       }
 
        if (ri->ri_bits == NULL)
                return;
@@ -980,8 +997,10 @@
        }
 #endif /* HPCFB_JUMP */
 
-       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+       if (!IS_DRAWABLE(dc)) {
                return;
+       }
+
        if (ri->ri_bits == NULL)
                return;
 
@@ -1054,8 +1073,10 @@
                return;
        }
 #endif /* HPCFB_JUMP */
-       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+       if (!IS_DRAWABLE(dc)) {
                return;
+       }
+
        if (ri->ri_bits == NULL)
                return;
 
@@ -1124,8 +1145,10 @@
                return;
        }
 #endif /* HPCFB_JUMP */
-       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+       if (!IS_DRAWABLE(dc)) {
                return;
+       }
+
        if (ri->ri_bits == NULL)
                return;
 
@@ -1223,11 +1246,13 @@
 
        dc->dc_state &= ~HPCFB_DC_ABORT;
 
-       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
-               return;
        if (vscn == 0)
                return;
 
+       if (!IS_DRAWABLE(dc)) {
+               return;
+       }
+
        if (ri->ri_bits == NULL)
                return;
 
@@ -1236,10 +1261,14 @@
        for (i = 0; i < num; i++) {
                if (dc->dc_state&HPCFB_DC_ABORT)
                        break;
+               if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+                       break;
                cols = vscn[row+i].maxcol;
                for (j = 0; j <= cols; j++) {
                        if (dc->dc_state&HPCFB_DC_ABORT)
                                continue;
+                       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+                               continue;
                        svc = &vscn[row+i].col[j];
                        rasops_emul.putchar(ri, row + i, j, svc->c, svc->attr);
                }
@@ -1250,6 +1279,8 @@
                for (; j <= cols; j++) {
                        if (dc->dc_state&HPCFB_DC_ABORT)
                                continue;
+                       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+                               continue;
                        rasops_emul.putchar(ri, row + i, j, ' ', 0);
                }
                vscn[row+i].spacecol = 0;
@@ -1337,8 +1368,10 @@
 
        hpcfb_tv_copyrows(cookie, src, dst, num);
 
-       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+       if (!IS_DRAWABLE(dc)) {
                return;
+       }
+
        if (ri->ri_bits == NULL)
                return;
 
@@ -1440,8 +1473,10 @@
                return;
        }
 #endif /* HPCFB_JUMP */
-       if ((dc->dc_state&HPCFB_DC_CURRENT) == 0)
+       if (!IS_DRAWABLE(dc)) {
                return;
+       }
+
        if (ri->ri_bits == NULL)
                return;
 



Home | Main Index | Thread Index | Old Index