home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / mips / mips2030.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-18  |  2.4 KB  |  88 lines

  1. /*
  2.  * $XConsortium: mips2030.c,v 1.2 91/07/18 22:57:54 keith Exp $
  3.  *
  4.  * Copyright 1991 MIPS Computer Systems, Inc.
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of MIPS not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  MIPS makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * MIPS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL MIPS
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  */
  23. #ident    "$Header: mips2030.c,v 1.2 91/07/18 22:57:54 keith Exp $"
  24.  
  25. #include <sys/types.h>
  26. #include <sysv/sys/grafreg.h>
  27.  
  28. #include <X.h>
  29. #include <Xproto.h>
  30. #include <misc.h>
  31. #include <colormapst.h>
  32. #include <input.h>
  33. #include <scrnintstr.h>
  34.  
  35. #include "mips.h"
  36. #include "mipsFb.h"
  37. #include "mips2030.h"
  38.  
  39. extern char *mipsMapit();
  40.  
  41. static void Blank2030();
  42.  
  43. Bool
  44. mipsMap2030(pm)
  45.     MipsScreenPtr pm;
  46. {
  47.     if (!pm->fbreg && (
  48.         !(pm->fbnocache = (unsigned char *) mipsMapit((char *) 0,
  49.             GBUFKEY, GRAPHICS_FRAME_SIZE)) ||
  50.         !(pm->fbreg = (unsigned char *) mipsMapit((char *) 0,
  51.             GREGKEY, GRAPHICS_REG_SIZE))))
  52.         return FALSE;
  53.  
  54.     pm->fbnorm = pm->fbnocache;
  55.  
  56.     mipsInitColor(pm);
  57.  
  58.     pm->fb_width = RS2030_BPSL;
  59.     pm->Blank = Blank2030;
  60.  
  61.     {
  62.         struct bt458 *ramdac =
  63.             &((struct rs2030_reg *) pm->fbreg)->ramdac;
  64.  
  65.         /*
  66.          * Set read mask for number of planes populated.
  67.          * XXX The PROM and/or kernel should take care of this.
  68.          */
  69.         ramdac->addr = BT458_READMASK;
  70.         ramdac->ctrl = (1 << pm->depth) - 1;
  71.     }
  72.  
  73.     return TRUE;
  74. }
  75.  
  76. static void
  77. Blank2030(pm, on)
  78.     MipsScreenPtr pm;
  79.     Bool on;
  80. {
  81.     struct rs2030_reg *reg = (struct rs2030_reg *) pm->fbreg;
  82.  
  83.     if (on != SCREEN_SAVER_ON)
  84.         reg->unblank = 0;
  85.     else
  86.         reg->blank = 0;
  87. }
  88.