fbio.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. #ifndef _UAPI__LINUX_FBIO_H
  2. #define _UAPI__LINUX_FBIO_H
  3. #include <linux/compiler.h>
  4. #include <linux/types.h>
  5. /* Constants used for fbio SunOS compatibility */
  6. /* (C) 1996 Miguel de Icaza */
  7. /* Frame buffer types */
  8. #define FBTYPE_NOTYPE -1
  9. #define FBTYPE_SUN1BW 0 /* mono */
  10. #define FBTYPE_SUN1COLOR 1
  11. #define FBTYPE_SUN2BW 2
  12. #define FBTYPE_SUN2COLOR 3
  13. #define FBTYPE_SUN2GP 4
  14. #define FBTYPE_SUN5COLOR 5
  15. #define FBTYPE_SUN3COLOR 6
  16. #define FBTYPE_MEMCOLOR 7
  17. #define FBTYPE_SUN4COLOR 8
  18. #define FBTYPE_NOTSUN1 9
  19. #define FBTYPE_NOTSUN2 10
  20. #define FBTYPE_NOTSUN3 11
  21. #define FBTYPE_SUNFAST_COLOR 12 /* cg6 */
  22. #define FBTYPE_SUNROP_COLOR 13
  23. #define FBTYPE_SUNFB_VIDEO 14
  24. #define FBTYPE_SUNGIFB 15
  25. #define FBTYPE_SUNGPLAS 16
  26. #define FBTYPE_SUNGP3 17
  27. #define FBTYPE_SUNGT 18
  28. #define FBTYPE_SUNLEO 19 /* zx Leo card */
  29. #define FBTYPE_MDICOLOR 20 /* cg14 */
  30. #define FBTYPE_TCXCOLOR 21 /* SUNW,tcx card */
  31. #define FBTYPE_LASTPLUSONE 21 /* This is not last + 1 in fact... */
  32. /* Does not seem to be listed in the Sun file either */
  33. #define FBTYPE_CREATOR 22
  34. #define FBTYPE_PCI_IGA1682 23
  35. #define FBTYPE_P9100COLOR 24
  36. #define FBTYPE_PCI_GENERIC 1000
  37. #define FBTYPE_PCI_MACH64 1001
  38. /* fbio ioctls */
  39. /* Returned by FBIOGTYPE */
  40. struct fbtype {
  41. int fb_type; /* fb type, see above */
  42. int fb_height; /* pixels */
  43. int fb_width; /* pixels */
  44. int fb_depth;
  45. int fb_cmsize; /* color map entries */
  46. int fb_size; /* fb size in bytes */
  47. };
  48. #define FBIOGTYPE _IOR('F', 0, struct fbtype)
  49. struct fbcmap {
  50. int index; /* first element (0 origin) */
  51. int count;
  52. unsigned char __user *red;
  53. unsigned char __user *green;
  54. unsigned char __user *blue;
  55. };
  56. #ifndef __KERNEL__
  57. #define FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
  58. #define FBIOGETCMAP _IOW('F', 4, struct fbcmap)
  59. #endif
  60. /* # of device specific values */
  61. #define FB_ATTR_NDEVSPECIFIC 8
  62. /* # of possible emulations */
  63. #define FB_ATTR_NEMUTYPES 4
  64. struct fbsattr {
  65. int flags;
  66. int emu_type; /* -1 if none */
  67. int dev_specific[FB_ATTR_NDEVSPECIFIC];
  68. };
  69. struct fbgattr {
  70. int real_type; /* real frame buffer type */
  71. int owner; /* unknown */
  72. struct fbtype fbtype; /* real frame buffer fbtype */
  73. struct fbsattr sattr;
  74. int emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */
  75. };
  76. #define FBIOSATTR _IOW('F', 5, struct fbgattr) /* Unsupported: */
  77. #define FBIOGATTR _IOR('F', 6, struct fbgattr) /* supported */
  78. #define FBIOSVIDEO _IOW('F', 7, int)
  79. #define FBIOGVIDEO _IOR('F', 8, int)
  80. struct fbcursor {
  81. short set; /* what to set, choose from the list above */
  82. short enable; /* cursor on/off */
  83. struct fbcurpos pos; /* cursor position */
  84. struct fbcurpos hot; /* cursor hot spot */
  85. struct fbcmap cmap; /* color map info */
  86. struct fbcurpos size; /* cursor bit map size */
  87. char __user *image; /* cursor image bits */
  88. char __user *mask; /* cursor mask bits */
  89. };
  90. /* set/get cursor attributes/shape */
  91. #define FBIOSCURSOR _IOW('F', 24, struct fbcursor)
  92. #define FBIOGCURSOR _IOWR('F', 25, struct fbcursor)
  93. /* set/get cursor position */
  94. #define FBIOSCURPOS _IOW('F', 26, struct fbcurpos)
  95. #define FBIOGCURPOS _IOW('F', 27, struct fbcurpos)
  96. /* get max cursor size */
  97. #define FBIOGCURMAX _IOR('F', 28, struct fbcurpos)
  98. /* wid manipulation */
  99. struct fb_wid_alloc {
  100. #define FB_WID_SHARED_8 0
  101. #define FB_WID_SHARED_24 1
  102. #define FB_WID_DBL_8 2
  103. #define FB_WID_DBL_24 3
  104. __u32 wa_type;
  105. __s32 wa_index; /* Set on return */
  106. __u32 wa_count;
  107. };
  108. struct fb_wid_item {
  109. __u32 wi_type;
  110. __s32 wi_index;
  111. __u32 wi_attrs;
  112. __u32 wi_values[32];
  113. };
  114. struct fb_wid_list {
  115. __u32 wl_flags;
  116. __u32 wl_count;
  117. struct fb_wid_item *wl_list;
  118. };
  119. #define FBIO_WID_ALLOC _IOWR('F', 30, struct fb_wid_alloc)
  120. #define FBIO_WID_FREE _IOW('F', 31, struct fb_wid_alloc)
  121. #define FBIO_WID_PUT _IOW('F', 32, struct fb_wid_list)
  122. #define FBIO_WID_GET _IOWR('F', 33, struct fb_wid_list)
  123. /* Creator ioctls */
  124. #define FFB_IOCTL ('F'<<8)
  125. #define FFB_SYS_INFO (FFB_IOCTL|80)
  126. #define FFB_CLUTREAD (FFB_IOCTL|81)
  127. #define FFB_CLUTPOST (FFB_IOCTL|82)
  128. #define FFB_SETDIAGMODE (FFB_IOCTL|83)
  129. #define FFB_GETMONITORID (FFB_IOCTL|84)
  130. #define FFB_GETVIDEOMODE (FFB_IOCTL|85)
  131. #define FFB_SETVIDEOMODE (FFB_IOCTL|86)
  132. #define FFB_SETSERVER (FFB_IOCTL|87)
  133. #define FFB_SETOVCTL (FFB_IOCTL|88)
  134. #define FFB_GETOVCTL (FFB_IOCTL|89)
  135. #define FFB_GETSAXNUM (FFB_IOCTL|90)
  136. #define FFB_FBDEBUG (FFB_IOCTL|91)
  137. /* Cg14 ioctls */
  138. #define MDI_IOCTL ('M'<<8)
  139. #define MDI_RESET (MDI_IOCTL|1)
  140. #define MDI_GET_CFGINFO (MDI_IOCTL|2)
  141. #define MDI_SET_PIXELMODE (MDI_IOCTL|3)
  142. # define MDI_32_PIX 32
  143. # define MDI_16_PIX 16
  144. # define MDI_8_PIX 8
  145. struct mdi_cfginfo {
  146. int mdi_ncluts; /* Number of implemented CLUTs in this MDI */
  147. int mdi_type; /* FBTYPE name */
  148. int mdi_height; /* height */
  149. int mdi_width; /* width */
  150. int mdi_size; /* available ram */
  151. int mdi_mode; /* 8bpp, 16bpp or 32bpp */
  152. int mdi_pixfreq; /* pixel clock (from PROM) */
  153. };
  154. /* SparcLinux specific ioctl for the MDI, should be replaced for
  155. * the SET_XLUT/SET_CLUTn ioctls instead
  156. */
  157. #define MDI_CLEAR_XLUT (MDI_IOCTL|9)
  158. /* leo & ffb ioctls */
  159. struct fb_clut_alloc {
  160. __u32 clutid; /* Set on return */
  161. __u32 flag;
  162. __u32 index;
  163. };
  164. struct fb_clut {
  165. #define FB_CLUT_WAIT 0x00000001 /* Not yet implemented */
  166. __u32 flag;
  167. __u32 clutid;
  168. __u32 offset;
  169. __u32 count;
  170. char * red;
  171. char * green;
  172. char * blue;
  173. };
  174. struct fb_clut32 {
  175. __u32 flag;
  176. __u32 clutid;
  177. __u32 offset;
  178. __u32 count;
  179. __u32 red;
  180. __u32 green;
  181. __u32 blue;
  182. };
  183. #define LEO_CLUTALLOC _IOWR('L', 53, struct fb_clut_alloc)
  184. #define LEO_CLUTFREE _IOW('L', 54, struct fb_clut_alloc)
  185. #define LEO_CLUTREAD _IOW('L', 55, struct fb_clut)
  186. #define LEO_CLUTPOST _IOW('L', 56, struct fb_clut)
  187. #define LEO_SETGAMMA _IOW('L', 68, int) /* Not yet implemented */
  188. #define LEO_GETGAMMA _IOR('L', 69, int) /* Not yet implemented */
  189. /* These are exported to userland for applications to use */
  190. /* Mappable offsets for the cg14: control registers */
  191. #define MDI_DIRECT_MAP 0x10000000
  192. #define MDI_CTLREG_MAP 0x20000000
  193. #define MDI_CURSOR_MAP 0x30000000
  194. #define MDI_SHDW_VRT_MAP 0x40000000
  195. /* Mappable offsets for the cg14: frame buffer resolutions */
  196. /* 32 bits */
  197. #define MDI_CHUNKY_XBGR_MAP 0x50000000
  198. #define MDI_CHUNKY_BGR_MAP 0x60000000
  199. /* 16 bits */
  200. #define MDI_PLANAR_X16_MAP 0x70000000
  201. #define MDI_PLANAR_C16_MAP 0x80000000
  202. /* 8 bit is done as CG3 MMAP offset */
  203. /* 32 bits, planar */
  204. #define MDI_PLANAR_X32_MAP 0x90000000
  205. #define MDI_PLANAR_B32_MAP 0xa0000000
  206. #define MDI_PLANAR_G32_MAP 0xb0000000
  207. #define MDI_PLANAR_R32_MAP 0xc0000000
  208. /* Mappable offsets on leo */
  209. #define LEO_SS0_MAP 0x00000000
  210. #define LEO_LC_SS0_USR_MAP 0x00800000
  211. #define LEO_LD_SS0_MAP 0x00801000
  212. #define LEO_LX_CURSOR_MAP 0x00802000
  213. #define LEO_SS1_MAP 0x00803000
  214. #define LEO_LC_SS1_USR_MAP 0x01003000
  215. #define LEO_LD_SS1_MAP 0x01004000
  216. #define LEO_UNK_MAP 0x01005000
  217. #define LEO_LX_KRN_MAP 0x01006000
  218. #define LEO_LC_SS0_KRN_MAP 0x01007000
  219. #define LEO_LC_SS1_KRN_MAP 0x01008000
  220. #define LEO_LD_GBL_MAP 0x01009000
  221. #define LEO_UNK2_MAP 0x0100a000
  222. #endif /* _UAPI__LINUX_FBIO_H */