home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / ddx-mips.zip / FB_IOCTL.H next >
C/C++ Source or Header  |  1992-08-07  |  4KB  |  146 lines

  1. /*
  2.  * |-----------------------------------------------------------|
  3.  * | Copyright (c) 1991 MIPS Computer Systems, Inc.            |
  4.  * | All Rights Reserved                                       |
  5.  * |-----------------------------------------------------------|
  6.  * |          Restricted Rights Legend                         |
  7.  * | Use, duplication, or disclosure by the Government is      |
  8.  * | subject to restrictions as set forth in                   |
  9.  * | subparagraph (c)(1)(ii) of the Rights in Technical        |
  10.  * | Data and Computer Software Clause of DFARS 252.227-7013.  |
  11.  * |         MIPS Computer Systems, Inc.                       |
  12.  * |         950 DeGuigne Avenue                               |
  13.  * |         Sunnyvale, California 94088-3650, USA             |
  14.  * |-----------------------------------------------------------|
  15.  */
  16. /* $Header: fb_ioctl.h,v 1.5 92/08/06 17:10:02 dd Exp $ */
  17. #ifndef _SYS_FB_IOCTL_H
  18. #define    _SYS_FB_IOCTL_H
  19.  
  20. #include <svr4/sys/ioccom.h>
  21.  
  22. /*
  23.  * Interface for simple frame buffers
  24.  */
  25.  
  26. #define    _IOC_FB    ('F' | 128)
  27.  
  28. /*
  29.  * basic information
  30.  */
  31. struct fb_type {
  32.     short type;        /* type code (see below) */
  33.     short flags;        /* defined per-type */
  34.     short width;        /* visible pixels per scan line */
  35.     short height;        /* visible scan lines */
  36. };
  37.  
  38. #define    FB_GET_TYPE        _IOR(_IOC_FB, 0, struct fb_type)
  39.  
  40. #define    FB_TYPE_VDR2    0    /* G300, 2M VRAM */
  41. #define    FB_TYPE_VDR1    1    /* G364, 2M VRAM */
  42. #define    FB_TYPE_MIPS1    0x10    /* G364, 2M VRAM */
  43. #define    FB_TYPE_MIPS2    0x11    /* G365, 2M VRAM */
  44. #define    FB_TYPE_MIPS3    0x12    /* G332, 1M VRAM */
  45.  
  46. /*
  47.  * memory mapping information
  48.  * - depth = -1 returns mmap information for registers, if any
  49.  * - if low byte of mmap_offset is non-zero, it's a shm key (!)
  50.  */
  51. struct fb_mapinfo {
  52.     short depth;        /* bits populated per pixel (in/out) */
  53.     short bits_per_pixel;    /* space occupied per pixel */
  54.     short width;        /* pixels populated per scan line */
  55.     short pixels_per_line;    /* space occupied per scan line */
  56.     short height;        /* scan lines populated */
  57.     short class;        /* visual class (should be elsewhere) */
  58.     off_t mmap_offset;
  59.     size_t mmap_size;    /* for convenience */
  60. };
  61.  
  62. #define    FB_GET_MAPINFO        _IOWR(_IOC_FB, 1, struct fb_mapinfo)
  63.  
  64. /*
  65.  * video control: parameter value 0 = video off, 1 = video on
  66.  */
  67. #define    FB_SET_VIDEO        _IOW(_IOC_FB, 2, int)
  68. #define    FB_GET_VIDEO        _IOR(_IOC_FB, 3, int)
  69.  
  70.  
  71. /*
  72.  * color map access
  73.  */
  74. struct fb_colormap {
  75.     short map;        /* which colormap */
  76.     short index;        /* first element */
  77.     short count;        /* number of elements */
  78.     unsigned char *rgb;    /* RGB values (8 bits each) */
  79. };
  80.  
  81. #define    FB_SET_COLORMAP        _IOW(_IOC_FB, 4, struct fb_colormap)
  82. #define    FB_GET_COLORMAP        _IOW(_IOC_FB, 5, struct fb_colormap)
  83.  
  84.  
  85. /*
  86.  * hardware cursor control
  87.  */
  88.  
  89. struct fb_cursor_xy {
  90.     short x, y;
  91. };
  92.  
  93. struct fb_cursor {
  94.     char set;        /* what to set */
  95. #define    FB_CUR_SETCUR    0x01
  96. #define    FB_CUR_SETPOS    0x02
  97. #define    FB_CUR_SETHOT    0x04
  98. #define    FB_CUR_SETCOLORMAP 0x08
  99. #define    FB_CUR_SETSHAPE    0x10
  100. #define    FB_CUR_SETALL    0x1f
  101.     char enable;        /* cursor on/off */
  102.     unsigned char rgb[6];    /* bg/fg RGB values */
  103.     struct fb_cursor_xy pos; /* cursor position */
  104.     struct fb_cursor_xy hot; /* cursor hot spot */
  105.     int shape_bytes;    /* bytes of data */
  106.     char *shape_data;    /* formatted data */
  107. };
  108.  
  109. /* set/get cursor data */
  110. #define FB_SET_CURSOR        _IOW(_IOC_FB, 6, struct fb_cursor)
  111. #define FB_GET_CURSOR        _IOWR(_IOC_FB, 7, struct fb_cursor)
  112.  
  113. /* get maximum cursor size */
  114. #define    FB_GET_CURSOR_SIZE    _IOR(_IOC_FB, 8, struct fb_cursor_xy)
  115.  
  116. /* set cursor position only */
  117. #define    FB_SET_CURSOR_POSITION    _IOW(_IOC_FB, 9, struct fb_cursor_xy)
  118.  
  119. /* reformat cursor data */
  120. struct fb_cursor_shape {
  121.     struct fb_cursor_xy size; /* cursor bit map size */
  122.     unsigned int *image;    /* cursor image bits (32 bit padded) */
  123.     unsigned int *mask;    /* cursor mask bits (32 bit padded) */
  124.     int shape_bytes;    /* bytes of data */
  125.     char *shape_data;    /* formatted data */
  126. };
  127. #define    FB_FORMAT_CURSOR    _IOWR(_IOC_FB, 10, struct fb_cursor_shape)
  128. #define    FB_UNFORMAT_CURSOR    _IOWR(_IOC_FB, 11, struct fb_cursor_shape)
  129.  
  130.  
  131. /* FB_REMAP is a temporary hack to allow use of large pages on R4000 */
  132. struct fb_map {
  133.     caddr_t addr;
  134.     size_t size;
  135. };
  136.  
  137. #define    FB_REMAP        _IOW(_IOC_FB, 90, struct fb_map)
  138. #define    FB_UNMAP        _IOW(_IOC_FB, 91, struct fb_map)
  139.  
  140. #ifdef MIPS_LOCAL
  141. /* debugging aid */
  142. #define    FB_DUMPTLB        _IO(_IOC_FB, 99)
  143. #endif /* MIPS_LOCAL */
  144.  
  145. #endif /* _SYS_FB_IOCTL_H */
  146.