Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcmips Built in video supports get/set color map.



details:   https://anonhg.NetBSD.org/src/rev/914c61ec9823
branches:  trunk
changeset: 483897:914c61ec9823
user:      takemura <takemura%NetBSD.org@localhost>
date:      Mon Mar 20 12:45:41 2000 +0000

description:
Built in video supports get/set color map.

diffstat:

 sys/arch/hpcmips/conf/files.hpcmips |   3 ++-
 sys/arch/hpcmips/dev/bivideo.c      |  27 +++++++--------------------
 2 files changed, 9 insertions(+), 21 deletions(-)

diffs (83 lines):

diff -r 9f7b94811c4b -r 914c61ec9823 sys/arch/hpcmips/conf/files.hpcmips
--- a/sys/arch/hpcmips/conf/files.hpcmips       Mon Mar 20 12:26:11 2000 +0000
+++ b/sys/arch/hpcmips/conf/files.hpcmips       Mon Mar 20 12:45:41 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcmips,v 1.27 2000/03/13 18:56:40 uch Exp $
+#      $NetBSD: files.hpcmips,v 1.28 2000/03/20 12:45:41 takemura Exp $
 
 # maxpartitions must be first item in files.${ARCH}.
 maxpartitions 8
@@ -77,6 +77,7 @@
 
 device bivideo: hpcfbif
 file   arch/hpcmips/dev/bivideo.c      bivideo needs-flag
+file   arch/hpcmips/dev/hpccmap.c      bivideo
 attach bivideo at mainbus
 
 device btnmgr: wskbddev
diff -r 9f7b94811c4b -r 914c61ec9823 sys/arch/hpcmips/dev/bivideo.c
--- a/sys/arch/hpcmips/dev/bivideo.c    Mon Mar 20 12:26:11 2000 +0000
+++ b/sys/arch/hpcmips/dev/bivideo.c    Mon Mar 20 12:45:41 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bivideo.c,v 1.4 2000/03/20 10:47:33 takemura Exp $     */
+/*     $NetBSD: bivideo.c,v 1.5 2000/03/20 12:45:42 takemura Exp $     */
 
 /*-
  * Copyright (c) 1999
@@ -37,7 +37,7 @@
 static const char _copyright[] __attribute__ ((unused)) =
     "Copyright (c) 1999 Shin Takemura.  All rights reserved.";
 static const char _rcsid[] __attribute__ ((unused)) =
-    "$Id: bivideo.c,v 1.4 2000/03/20 10:47:33 takemura Exp $";
+    "$Id: bivideo.c,v 1.5 2000/03/20 12:45:42 takemura Exp $";
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -61,6 +61,7 @@
 #include <arch/hpcmips/dev/hpcfbvar.h>
 #include <arch/hpcmips/dev/hpcfbio.h>
 #include <arch/hpcmips/dev/bivideovar.h>
+#include <arch/hpcmips/dev/hpccmapvar.h>
 
 /*
  *  function prototypes
@@ -270,12 +271,10 @@
        int flag;
        struct proc *p;
 {
-       int i;
        struct bivideo_softc *sc = (struct bivideo_softc *)v;
        struct hpcfb_fbconf *fbconf;
        struct hpcfb_dspconf *dspconf;
        struct wsdisplay_cmap *cmap;
-       static u_char compo6[6] = {   0,  51, 102, 153, 204, 255 };
 
        switch (cmd) {
        case WSDISPLAYIO_GETCMAP:
@@ -292,22 +291,10 @@
                    !uvm_useracc(cmap->blue, cmap->count, B_WRITE))
                        return (EFAULT);
 
-               for (i = cmap->index; i < cmap->index + cmap->count; i++) {
-                       if (i < 32) {
-                               cmap->red[i] = i;
-                               cmap->green[i] = i;
-                               cmap->blue[i] = i;
-                       } else
-                       if (i < 32 + 6 * 6 * 6) {
-                               cmap->red[i] = compo6[(i - 32) / 36];
-                               cmap->green[i] = compo6[((i - 32) / 6) % 6];
-                               cmap->blue[i] = compo6[(i - 32) % 6];
-                       } else {
-                               cmap->red[i] = 255;
-                               cmap->green[i] = 255;
-                               cmap->blue[i] = 255;
-                       }
-               }
+               copyout(&bivideo_cmap_r[cmap->index], cmap->red, cmap->count);
+               copyout(&bivideo_cmap_g[cmap->index], cmap->green,cmap->count);
+               copyout(&bivideo_cmap_b[cmap->index], cmap->blue, cmap->count);
+
                return (0);
 
        case WSDISPLAYIO_PUTCMAP:



Home | Main Index | Thread Index | Old Index