home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / omron / omronFb.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-29  |  6.9 KB  |  272 lines

  1. /*
  2.  * $XConsortium: omronFb.h,v 1.1 91/06/29 13:48:54 xguest Exp $
  3.  *
  4.  * Copyright 1991 by OMRON Corporation
  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 OMRON not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  OMRON 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.  * OMRON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OMRON
  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.  
  24. #ifdef    luna88k
  25. # include <dev/fbmap.h>
  26. #else    /*  ~luna88k */
  27. #ifdef uniosu
  28. # include <sys/devmap.h>
  29. #else /* ~uniosu */
  30. # ifdef luna2
  31. #  include <dev/fbmap.h>
  32. # else /* ~luna2 */
  33. #  include <om68kdev/fbmap.h>
  34. # endif /* luna2 */
  35. #endif /* uniosu */
  36. #endif /* luna88k */
  37.  
  38. typedef struct _OmronFbProc {
  39.     int        (*CreateProc)();
  40.     int        (*InitProc)();
  41.     void    (*GiveUpProc)();
  42. } OmronFbProc;        
  43.  
  44. typedef struct _OmronFbInfo {
  45.     int        fb_type;
  46.     int        fb_width;
  47.     int        fb_height;
  48.     int        fb_depth;
  49.     int        scr_width;
  50.     int        scr_height;
  51.     char     *plane;
  52.     long    *refresh_reg;    
  53.     int        palfd;    /* pallate */
  54.     int        fbfd1;    /* luna-88k only */    /* /dev/fb */
  55.     int        fbfd2;    /* luna-88k only */    /* /dev/allmapfb */
  56.     int        palmapsize;
  57.     char    *palmap;
  58.     int        fbmapsize;
  59.     char    *fbmap;;
  60.     OmronFbProc    *func;
  61. } OmronFbInfo, *OmronFbInfoPtr;
  62.  
  63. /*    fb_type        */
  64. #define DT_BM         0
  65. #define DT_PLASMA     1
  66. #define DS_BM        2
  67. #define FS_BM        3
  68. #define    DT_BM8        4
  69.  
  70. /* scr_width and scr_height */
  71. /* DT_BM, DS_BM, FS_BM, DT_BM8 */
  72. #define SCREEN_WIDTH                1280
  73. #define SCREEN_HEIGHT                1024
  74. /* DT_PLASMA */
  75. #define PLASMA_SCREEN_WIDTH            1024
  76. #define PLASMA_SCREEN_HEIGHT            768
  77. /* fb_width and fb_height */
  78. #define FB_WIDTH                2048
  79. #define FB_HEIGHT                1024
  80.  
  81. #define COLOR_TV_RESOLUTION              110 
  82. #define MONO_TV_RESOLUTION            125   
  83. #define PLASMA_TV_RESOLUTION            100
  84.  
  85.  
  86. /*
  87. **    color palette memory map
  88. */
  89. union palette {            /* mono and 4 depth color */
  90.     struct {
  91.         unsigned char    addr;        /* palette addres register */
  92.         unsigned char    coldata;    /* palette data register (R G B) */    
  93.     } reg;
  94.     char    pad[4096];
  95. };
  96.  
  97. union palette_bm8 {        /* 8 depth color */
  98.     struct {
  99.         unsigned char    addr;        /* palette addres register */    
  100.         unsigned char    pad11[3];    /* unuse */
  101.         unsigned char    coldata;    /* palette data register (R G B) */
  102.         unsigned char    pad12[3];    /* unuse */
  103.         unsigned char    command;    /* palette control command register */
  104.         unsigned char    pad13[3];    /* unuse */
  105.         unsigned char    ovcdata;    /* palette overlay data (unuse) */
  106.         unsigned char    pad14[3];    /* unuse */
  107.     } reg;
  108.     char    pad[4096];
  109. };
  110.  
  111. union fs_palette {        /* 8 depth color (luna-fs)*/
  112.     struct {
  113.         long    addr;                /* palette addres register */
  114.         long    control;            /* palette data register (R G B) */
  115.         long    coldata;            /* palette control command register */
  116.         long    ovcdata;            /* palette overlay data (unuse) */
  117.     } reg;
  118.     char    pad[0x1000];
  119. };
  120.  
  121. /*
  122. **    frame buffer memory memory map
  123. */
  124. struct bm_one_data {    /* mono frame buffer */
  125.     int         sd[1][1024][64];    /* 2048 x 1024 */
  126. };
  127.  
  128. struct bm_four_data {    /* 4 depth color frame buffer */
  129.     int            sd[4][1024][64];    /* 2048 x 1024 x 4 */
  130. };
  131.  
  132. struct bm_eight_data {    /* 8 depth color frame buffer */
  133.     int            sd[8][1024][64];    /* 2048 x 1024 x 8 */
  134. };
  135.  
  136. /*
  137. ** luna raster operateon hardware memory map
  138. */
  139. union bm_function_set {
  140.         long    op_cont[16];    /* function set register */
  141.         char    pad[0x40000];
  142. };
  143.  
  144. /*
  145. **    luna graphic display control hardware mememory map 
  146. */
  147. typedef struct dt_bm_fbmap {    /* luna and luna-2 */
  148.     union {    
  149.         long    reg;
  150.         char    pad2[0x40000];
  151.     } refresh;        /* display area control register (write only) */
  152.     union {
  153.         long    reg;
  154.         char    pad3[0x40000];
  155.     } pselect;        /* plane select register (write only) */
  156.     /* common frame buffer (write only) */
  157.     struct bm_one_data        cbmplane;
  158.     /* frame buffer (read/write) */
  159.     struct bm_eight_data    bmplane;
  160.     /* luna raster operateon hardware (common frame buffer)  */
  161.     union bm_function_set cplane;
  162.     /* luna raster operateon hardware */
  163.     union bm_function_set planes[8];
  164. } *DtBmMapPtr;
  165.  
  166. typedef struct fs_bm_fbmap {    /* luna-fs */
  167.     /* common frame buffer (write only) */
  168.     struct bm_one_data cbmplane;
  169.     struct bm_one_data pad1[6];    /* unuse */
  170.     /* luna raster operateon hardware (common frame buffer)  */
  171.     union fs_fset {
  172.         long    op_cont[16];
  173.         char    pad2[0x8000];
  174.     } cplane;
  175.     union fs_fset pad3[6];    /* unuse */
  176.     union {
  177.         struct {
  178.             long    addr;    /* acrtc address register */
  179.             long    data;    /* acrtc data register */
  180.         } reg;
  181.         char    pad3[0x4000];
  182.     } acrtc;
  183.     union {
  184.         long    reg;
  185.         char    pad4[0x1000];
  186.     } pselect;          /* plane select register (write only) */
  187.     union {
  188.         long    reg;
  189.         char    pad5[0x2000];
  190.     } refresh;          /* display area control register (write only) */
  191.     /* color palette */
  192.     union fs_palette palette;
  193.     /* frame buffer (read/write) */
  194.     struct bm_eight_data bmplane;
  195.     char pad5[0x600000];    /* unuse */
  196.     /* luna raster operateon hardware */
  197.     union {
  198.         long    op_cont[16];
  199.         char    pad6[0x2000];
  200.     } planes[8];
  201. } *FsBmMapPtr;
  202.  
  203. typedef struct R88k_bm_fbmap {    /* luna-88k frame buffer */
  204.     /* common frame buffer (write only) */
  205.     struct bm_one_data        cbmplane;
  206.     /* frame buffer (read/write) */
  207.     struct bm_eight_data    bmplane;
  208.     /* luna raster operateon hardware (common frame buffer)  */
  209.     union bm_function_set     cplane;
  210.     /* luna raster operateon hardware */
  211.     union bm_function_set    planes[8];
  212. } *R88kBmMapPtr;
  213.  
  214. typedef struct R88k_bm_fbreg {    /* luna-88k control */
  215.     union {
  216.         long    reg;
  217.         char    pad2[0x40000];
  218.     } refresh;    /* display area control register (write only) */
  219.     union {
  220.         long    reg;
  221.         char    pad3[0x40000];
  222.     } pselect;    /* plane select register (write only) */
  223. } *R88kBmRegPtr;
  224.  
  225. struct ds_bm_map {
  226.     union {
  227.         long    op_cont[16];
  228.         char    pad1[0x8000];
  229.     } planes[7];
  230.     union {
  231.         struct {
  232.             long    addr;
  233.             long    data;
  234.         } reg;
  235.         char    pad2[0x4000];
  236.     } acrtc;
  237.     union {
  238.         long    reg;
  239.         char    pad3[0x1000];
  240.     } pselect;
  241.     union {
  242.         long    reg;
  243.         char    pad4[0x2000];
  244.     } refresh;
  245.     union {
  246.         struct {
  247.             long    addr;
  248.             long    control;
  249.             long    coldata;
  250.             long    ovcdata;
  251.         } reg;
  252.         char    pad5[0x1000];
  253.     } palette;
  254. };
  255.  
  256. #ifndef luna88k
  257. # ifdef uniosu
  258. #  ifndef luna2
  259. extern Bool omronFsBmCreate();
  260. extern Bool omronFsBmInit();
  261. extern void omronFsBmGiveUp();
  262. #  endif
  263. # endif /* uniosu */
  264. extern Bool omronDtBmCreate();
  265. extern Bool omronDtBmInit();
  266. extern void omronDtBmGiveUp();
  267. #else /* luna88k */
  268. extern Bool omron88kBmCreate();
  269. extern Bool omron88kBmInit();
  270. extern void omron88kBmGiveUp();
  271. #endif /* luna88k */
  272.