fbio.h 9.1 KB

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