home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextDeveloper / Headers / bsd / dev / sparc / fbio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-15  |  10.3 KB  |  334 lines

  1. /*    @(#)fbio.h 5.49 91/06/28 SMI    */
  2.  
  3. /*
  4.  * Copyright 1986 by Sun Microsystems, Inc.
  5.  */
  6.  
  7. #ifndef    _sun_fbio_h
  8. #define    _sun_fbio_h
  9. #include <sys/types.h>
  10.  
  11. #ifndef ASM
  12. /*
  13.  * Frame buffer descriptor.
  14.  * Returned by FBIOGTYPE ioctl on frame buffer devices.
  15.  */
  16. struct    fbtype {
  17.     int    fb_type;    /* as defined below */
  18.     int    fb_height;    /* in pixels */
  19.     int    fb_width;    /* in pixels */
  20.     int    fb_depth;    /* bits per pixel */
  21.     int    fb_cmsize;    /* size of color map (entries) */
  22.     int    fb_size;    /* total size in bytes */
  23. };
  24.  
  25. #define    FBIOGTYPE _IOR('F', 0, struct fbtype)
  26.  
  27. #ifdef  KERNEL
  28. struct  fbpixrect {
  29.     struct  pixrect *fbpr_pixrect;  /* Pixrect of dev returned here */
  30. };
  31.  
  32. #define    FBIOGPIXRECT _IOWR('F', 1, struct fbpixrect)
  33. #endif    KERNEL
  34.  
  35. /*
  36.  * General purpose structure for passing info in and out of frame buffers
  37.  * (used for gp1)
  38.  */
  39. struct    fbinfo {
  40.     int        fb_physaddr;    /* physical frame buffer address */
  41.     int        fb_hwwidth;    /* fb board width */
  42.     int        fb_hwheight;    /* fb board height */
  43.     int        fb_addrdelta;    /* phys addr diff between boards */
  44.     unsigned char    *fb_ropaddr;    /* fb va thru kernelmap */
  45.     int        fb_unit;    /* minor devnum of fb */
  46. };
  47.  
  48. #define    FBIOGINFO _IOR('F', 2, struct fbinfo)
  49.  
  50. /*
  51.  * Color map I/O.  See also fbcmap_i below.
  52.  */
  53. struct    fbcmap {
  54.     int        index;        /* first element (0 origin) */
  55.     int        count;        /* number of elements */
  56.     unsigned char    *red;        /* red color map elements */
  57.     unsigned char    *green;        /* green color map elements */
  58.     unsigned char    *blue;        /* blue color map elements */
  59. };
  60.  
  61. #define    FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
  62. #define    FBIOGETCMAP _IOW('F', 4, struct fbcmap)
  63. #define    FBIOMAPFB _IOR('F', 50, unsigned int)
  64.  
  65. /*
  66.  * Set/Get attributes
  67.  */
  68. #define    FB_ATTR_NDEVSPECIFIC    8    /* no. of device specific values */
  69. #define    FB_ATTR_NEMUTYPES    4    /* no. of emulation types */
  70.  
  71. struct fbsattr {
  72.     int    flags;            /* misc flags */
  73. #define    FB_ATTR_AUTOINIT    1    /* emulation auto init flag */
  74. #define    FB_ATTR_DEVSPECIFIC    2    /* dev. specific stuff valid flag */
  75.     int    emu_type;        /* emulation type (-1 if unused) */
  76.     int    dev_specific[FB_ATTR_NDEVSPECIFIC];    /* catchall */
  77. };
  78.  
  79. struct fbgattr {
  80.     int    real_type;        /* real device type */
  81.     int    owner;            /* PID of owner, 0 if myself */
  82.     struct fbtype fbtype;        /* fbtype info for real device */
  83.     struct fbsattr sattr;        /* see above */
  84.     int    emu_types[FB_ATTR_NEMUTYPES];    /* possible emulations */
  85.                         /* (-1 if unused) */
  86. };
  87.  
  88. #define    FBIOSATTR    _IOW('F', 5, struct fbsattr)
  89. #define    FBIOGATTR    _IOR('F', 6, struct fbgattr)
  90.  
  91.  
  92. /*
  93.  * Video control
  94.  * (the unused bits are reserved for future use)
  95.  */
  96. #define    FBVIDEO_OFF    0
  97. #define    FBVIDEO_ON    1
  98.  
  99. #define    FBIOSVIDEO    _IOW('F', 7, int)
  100. #define    FBIOGVIDEO    _IOR('F', 8, int)
  101.  
  102. /* Vertical retrace support. */
  103. #define    FBIOVERTICAL    _IOW('F', 9, int)
  104. #define    GRABPAGEALLOC   _IOR('F', 10, caddr_t)
  105. #define    GRABPAGEFREE    _IOW('F', 11, caddr_t)
  106. #define    GRABATTACH    _IOW('F', 12, caddr_t)
  107.  
  108. #define    FBIOGPLNGRP    _IOR('F', 13, int)
  109. #define    FBIOGCMSIZE    _IOR('F', 14, int)
  110. #define    FBIOSCMSIZE    _IOW('F', 15, int)
  111. #define    FBIOSCMS    _IOW('F', 16, int)
  112. #define    FBIOAVAILPLNGRP    _IOR('F', 17, int)
  113.  
  114.  
  115. /*
  116.  * Structure to pass double buffering state back and forth the device.
  117.  */
  118.  
  119. /* used in devstate */
  120. #define    FBDBL_AVAIL    0x80000000
  121. #define    FBDBL_DONT_BLOCK 0x40000000
  122. #define    FBDBL_AVAIL_PG    0x20000000
  123.  
  124. /* used in read/write/display */
  125. #define    FBDBL_A     0x1
  126. #define    FBDBL_B     0x2
  127. #define    FBDBL_BOTH    (FBDBL_A | FBDBL_B)
  128. #define    FBDBL_NONE    0x4
  129.  
  130. struct fbdblinfo {
  131.     unsigned int    dbl_devstate;
  132.     unsigned int    dbl_read;
  133.     unsigned int    dbl_write;
  134.     unsigned int    dbl_display;
  135.     int        dbl_depth;
  136.     char        dbl_wid;
  137. };
  138.  
  139. #define    FBIODBLGINFO    _IOR('F', 18, struct fbdblinfo)
  140. #define    FBIODBLSINFO    _IOW('F', 19, struct fbdblinfo)
  141.  
  142. /* 8-bit emulation in 24-bit ioctls */
  143.  
  144. #define    FBIOSWINFD    _IOR('F', 20, int)
  145. #define    FBIOSAVWINFD    _IOR('F', 21, int)
  146. #define    FBIORESWINFD    _IOR('F', 22, int)
  147. #define    FBIOSRWINFD    _IOR('F', 23, int)
  148.  
  149. /*
  150.  * hardware cursor control
  151.  */
  152.  
  153. struct fbcurpos {
  154.         short x, y;
  155. };
  156.  
  157. struct fbcursor {
  158.         short set;              /* what to set */
  159. #define FB_CUR_SETCUR   0x01
  160. #define FB_CUR_SETPOS   0x02
  161. #define FB_CUR_SETHOT   0x04
  162. #define FB_CUR_SETCMAP  0x08
  163. #define FB_CUR_SETSHAPE 0x10
  164. #define FB_CUR_SETALL   0x1F
  165.         short enable;           /* cursor on/off */
  166.         struct fbcurpos pos;    /* cursor position */
  167.         struct fbcurpos hot;    /* cursor hot spot */
  168.         struct fbcmap cmap;     /* color map info */
  169.         struct fbcurpos size;   /* cursor bit map size */
  170.         char *image;            /* cursor image bits */
  171.         char *mask;             /* cursor mask bits */
  172. };
  173.  
  174. /* set/get cursor attributes/shape */
  175. #define FBIOSCURSOR     _IOW('F', 24, struct fbcursor)
  176. #define FBIOGCURSOR     _IOWR('F', 25, struct fbcursor)
  177.  
  178. /* set/get cursor position */
  179. #define FBIOSCURPOS     _IOW('F', 26, struct fbcurpos)
  180. #define FBIOGCURPOS     _IOW('F', 27, struct fbcurpos)
  181.  
  182. /* get max cursor size */
  183. #define FBIOGCURMAX     _IOR('F', 28, struct fbcurpos)
  184.  
  185. /* Window Grabber info ioctl */
  186. #define GRABLOCKINFO    _IOR('F', 29, caddr_t)
  187.  
  188. /*
  189.  * Window Identification (wid) defines, structures, and ioctls.
  190.  *
  191.  * Some wids need to be unique when used for things such as double
  192.  * buffering or rendering clipping.  Some wids can be shared when
  193.  * used for display attributes only.  What can be shared and how
  194.  * may be device dependent.  The fb_wid_alloc.wa_type and fb_wid_item
  195.  * structure members will be left to device specific interpretation.
  196.  */
  197.  
  198. #define    FB_WID_SHARED_8        0
  199. #define    FB_WID_SHARED_24    1
  200. #define    FB_WID_DBL_8        2
  201. #define    FB_WID_DBL_24        3
  202.  
  203. struct fb_wid_alloc
  204. {
  205.     unsigned int    wa_type;    /* special attributes        */
  206.     int            wa_index;    /* base wid returned        */
  207.     unsigned int    wa_count;    /* how many contiguous wids    */
  208. };
  209.  
  210. struct fb_wid_item
  211. {
  212.     unsigned int    wi_type;    /* special attributes        */
  213.     int            wi_index;    /* which lut            */
  214.     unsigned int    wi_attrs;    /* which attributes        */
  215.     unsigned int    wi_values[NBBY*sizeof(int)]; /* the attr values    */
  216. };
  217.  
  218. struct fb_wid_list
  219. {
  220.     unsigned int    wl_flags;
  221.     unsigned int    wl_count;
  222.     struct fb_wid_item    *wl_list;
  223. };
  224.  
  225. struct fb_wid_dbl_info
  226. {
  227.     struct fb_wid_alloc    dbl_wid;
  228.     char        dbl_fore;
  229.     char        dbl_back;
  230.     char        dbl_read_state;
  231.     char        dbl_write_state;
  232. };
  233.  
  234. #define    FBIO_WID_ALLOC    _IOWR('F', 30, struct fb_wid_alloc)
  235. #define FBIO_WID_FREE    _IOW('F', 31, struct fb_wid_alloc)
  236. #define    FBIO_WID_PUT    _IOW('F', 32, struct fb_wid_list)
  237. #define    FBIO_WID_GET    _IOW('F', 33, struct fb_wid_list)
  238.  
  239. #define    FBIO_DEVID    _IOR('F', 34, int)
  240. #define    FBIO_U_RST    _IOW('F', 35, int)
  241. #define    FBIO_FULLSCREEN_ELIMINATION_GROUPS    _IOR('F', 36, unsigned char *)
  242. #define FBIO_WID_DBL_SET        _IO('F', 37)
  243. #define    FBIOVRTOFFSET    _IOR('F', 38, int)
  244.  
  245. struct cg6_info {
  246.       u_short     accessible_width;       /* accessible bytes in scanline */
  247.       u_short     accessible_height;      /* number of accessible scanlines */
  248.       u_short     line_bytes;             /* number of bytes/scanline */
  249.       u_short     hdb_capable;            /* can this thing hardware db? */
  250.       u_short     vmsize;                 /* this is Mb of video memory */
  251.       u_char      boardrev;               /* board revision # */
  252.       u_char      slot;                   /* sbus slot # */
  253.       u_long      pad1;                   /* expansion */
  254. } ;
  255.  
  256. #define MON_TYPE_STEREO         0x8     /* stereo display */
  257. #define MON_TYPE_0_OFFSET       0x4     /* black level 0 ire instead of 7.5 */
  258. #define MON_TYPE_OVERSCAN       0x2     /* overscan */
  259. #define MON_TYPE_GRAY           0x1     /* greyscale monitor */
  260.  
  261. struct mon_info {
  262.       u_long      mon_type;               /* bit array: defined above */
  263.       u_long      pixfreq;                /* pixel frequency in Hz */
  264.       u_long      hfreq;                  /* horizontal freq in Hz */
  265.       u_long      vfreq;                  /* vertical freq in Hz */
  266.       u_long      vsync;                  /* vertical sync in scanlines */
  267.       u_long      hsync;                  /* horizontal sync in pixels */
  268.                                           /* these are in pixel units */
  269.       u_short     hfporch;                /* horizontal front porch */
  270.       u_short     hbporch;                /* horizontal back porch */
  271.       u_short     vfporch;                /* vertical front porch */
  272.       u_short     vbporch;                /* vertical back porch */
  273. } ;
  274.  
  275.  
  276. #define FBIOGXINFO      _IOR('F', 39, struct cg6_info)
  277. #define FBIOMONINFO     _IOR('F', 40, struct mon_info)
  278.  
  279. /*
  280.  * Color map I/O.  
  281.  */
  282. struct    fbcmap_i {
  283.     unsigned int    flags;        /* see below */
  284.     int        id;        /* colormap id for multiple cmaps */
  285.     int        index;        /* first element (0 origin) */
  286.     int        count;        /* number of elements */
  287.     unsigned char    *red;        /* red color map elements */
  288.     unsigned char    *green;        /* green color map elements */
  289.     unsigned char    *blue;        /* blue color map elements */
  290. };
  291.  
  292. #define    FB_CMAP_BLOCK    0x1    /* wait for vrt before returning */
  293. #define    FB_CMAP_KERNEL    0x2    /* called within kernel */
  294.  
  295. #define    FBIOPUTCMAPI _IOW('F', 41, struct fbcmap_i)
  296. #define    FBIOGETCMAPI _IOW('F', 42, struct fbcmap_i)
  297.  
  298. /* assigning a given window id to a pixrect - special for PHIGS */
  299. #define FBIO_ASSIGNWID          _IOWR('F', 43, struct fb_wid_alloc)
  300.  
  301. /* assigning a given window to be stereo */
  302. #define FBIO_STEREO         _IOWR('F', 44, int)
  303. #define    FB_WIN_STEREO        0x2
  304.  
  305. #endif !ASM
  306.  
  307. /* frame buffer type codes */
  308. #define    FBTYPE_SUN1BW        0    /* Multibus mono */
  309. #define    FBTYPE_SUN1COLOR    1    /* Multibus color */
  310. #define    FBTYPE_SUN2BW        2    /* memory mono */
  311. #define    FBTYPE_SUN2COLOR    3    /* color w/rasterop chips */
  312. #define    FBTYPE_SUN2GP        4    /* GP1/GP2 */
  313. #define    FBTYPE_SUN5COLOR    5    /* RoadRunner accelerator */
  314. #define    FBTYPE_SUN3COLOR    6    /* memory color */
  315. #define    FBTYPE_MEMCOLOR        7    /* memory 24-bit */
  316. #define    FBTYPE_SUN4COLOR    8    /* memory color w/overlay */
  317.  
  318. #define    FBTYPE_NOTSUN1        9    /* reserved for customer */
  319. #define    FBTYPE_NOTSUN2        10    /* reserved for customer */
  320. #define    FBTYPE_NOTSUN3        11    /* reserved for customer */
  321.  
  322. #define    FBTYPE_SUNFAST_COLOR    12    /* accelerated 8bit */
  323. #define    FBTYPE_SUNROP_COLOR    13    /* MEMCOLOR with rop h/w */
  324. #define    FBTYPE_SUNFB_VIDEO    14    /* Simple video mixing */
  325. #define    FBTYPE_SUNGIFB        15    /* medical image */
  326. #define    FBTYPE_SUNGPLAS        16    /* plasma panel */
  327. #define    FBTYPE_SUNGP3        17    /* cg12 running gpsi microcode */
  328. #define    FBTYPE_SUNGT        18    /* gt graphics accelerator */
  329. #define    FBTYPE_RESERVED1    19    /* reserved, do not use */
  330.  
  331. #define    FBTYPE_LASTPLUSONE    20    /* max number of fbs (change as add) */
  332.  
  333. #endif    /*!_sun_fbio_h*/
  334.