fbio.h 9.0 KB

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