Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/pmax/dev Save colormap when fb device is opened, an...



details:   https://anonhg.NetBSD.org/src/rev/a5922560db5c
branches:  trunk
changeset: 471847:a5922560db5c
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Apr 13 03:22:00 1999 +0000

description:
Save colormap when fb device is opened, and restore upon close. Do not
fbconnect() 'pm' device again at attach time if it is the console.

diffstat:

 sys/arch/pmax/dev/fb_usrreq.c |  18 ++++++++++++++++--
 sys/arch/pmax/dev/pm_ds.c     |  10 ++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diffs (63 lines):

diff -r 259a880561f9 -r a5922560db5c sys/arch/pmax/dev/fb_usrreq.c
--- a/sys/arch/pmax/dev/fb_usrreq.c     Tue Apr 13 03:19:28 1999 +0000
+++ b/sys/arch/pmax/dev/fb_usrreq.c     Tue Apr 13 03:22:00 1999 +0000
@@ -1,4 +1,10 @@
-/*     $NetBSD: fb_usrreq.c,v 1.13 1999/01/16 07:05:05 nisimura Exp $  */
+/*     $NetBSD: fb_usrreq.c,v 1.14 1999/04/13 03:22:00 ad Exp $        */
+
+/* 
+ * XXX this should be stored in 'fbinfo', but that might just break the
+ * staticly linked Xserver.
+ */
+static u_char saved_cmap[NFB][768];
 
 /*ARGSUSED*/
 int
@@ -23,6 +29,9 @@
 
        fi->fi_open = 1;
 
+       if (fi->fi_type.fb_depth == 8)
+               fi->fi_driver->fbd_getcmap(fi, saved_cmap[minor(dev)], 0, 256);
+       
        (*fi->fi_driver->fbd_initcmap)(fi);
 
        /*
@@ -53,7 +62,12 @@
 
        fbtty = fi->fi_glasstty;
        fi->fi_open = 0;
-       (*fi->fi_driver->fbd_initcmap)(fi);
+       
+       if (fi->fi_type.fb_depth == 8)
+               fi->fi_driver->fbd_putcmap(fi, saved_cmap[minor(dev)], 0, 256);
+       else
+               fi->fi_driver->fbd_initcmap(fi);
+       
        genDeconfigMouse();
        fbScreenInit(fi);
 
diff -r 259a880561f9 -r a5922560db5c sys/arch/pmax/dev/pm_ds.c
--- a/sys/arch/pmax/dev/pm_ds.c Tue Apr 13 03:19:28 1999 +0000
+++ b/sys/arch/pmax/dev/pm_ds.c Tue Apr 13 03:22:00 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pm_ds.c,v 1.7 1998/04/19 10:47:06 jonathan Exp $       */
+/*     $NetBSD: pm_ds.c,v 1.8 1999/04/13 03:22:00 ad Exp $     */
 
 /*
  * Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -123,7 +123,13 @@
        /*struct ibus_attach_args *ia = aux;*/
        /*caddr_t pmaddr = (caddr_t)ia->ia_addr;*/
 
-       if (!pminit(&pmfi, 0, 0))
+       /* don't init twice */
+       if (pmfi.fi_pixels != NULL)
+               printf (": (%dx%dx%d) (console)",
+                       pmfi.fi_type.fb_width,
+                       pmfi.fi_type.fb_height,
+                       pmfi.fi_type.fb_depth);
+       else if (!pminit(&pmfi, 0, 0))
                return;
 
        /* no interrupts for PM */



Home | Main Index | Thread Index | Old Index