fbio.h 7.7 KB

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