Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 #ifndef _UAPI__LINUX_FBIO_H
0003 #define _UAPI__LINUX_FBIO_H
0004 
0005 #include <linux/compiler.h>
0006 #include <linux/types.h>
0007 
0008 /* Constants used for fbio SunOS compatibility */
0009 /* (C) 1996 Miguel de Icaza */
0010 
0011 /* Frame buffer types */
0012 #define FBTYPE_NOTYPE           -1
0013 #define FBTYPE_SUN1BW           0   /* mono */
0014 #define FBTYPE_SUN1COLOR        1 
0015 #define FBTYPE_SUN2BW           2 
0016 #define FBTYPE_SUN2COLOR        3 
0017 #define FBTYPE_SUN2GP           4 
0018 #define FBTYPE_SUN5COLOR        5 
0019 #define FBTYPE_SUN3COLOR        6 
0020 #define FBTYPE_MEMCOLOR         7 
0021 #define FBTYPE_SUN4COLOR        8 
0022  
0023 #define FBTYPE_NOTSUN1          9 
0024 #define FBTYPE_NOTSUN2          10
0025 #define FBTYPE_NOTSUN3          11
0026  
0027 #define FBTYPE_SUNFAST_COLOR    12  /* cg6 */
0028 #define FBTYPE_SUNROP_COLOR     13
0029 #define FBTYPE_SUNFB_VIDEO      14
0030 #define FBTYPE_SUNGIFB          15
0031 #define FBTYPE_SUNGPLAS         16
0032 #define FBTYPE_SUNGP3           17
0033 #define FBTYPE_SUNGT            18
0034 #define FBTYPE_SUNLEO           19      /* zx Leo card */
0035 #define FBTYPE_MDICOLOR         20      /* cg14 */
0036 #define FBTYPE_TCXCOLOR     21  /* SUNW,tcx card */
0037 
0038 #define FBTYPE_LASTPLUSONE      21  /* This is not last + 1 in fact... */
0039 
0040 /* Does not seem to be listed in the Sun file either */
0041 #define FBTYPE_CREATOR          22
0042 #define FBTYPE_PCI_IGA1682  23
0043 #define FBTYPE_P9100COLOR   24
0044 
0045 #define FBTYPE_PCI_GENERIC  1000
0046 #define FBTYPE_PCI_MACH64   1001
0047 
0048 /* fbio ioctls */
0049 /* Returned by FBIOGTYPE */
0050 struct  fbtype {
0051         int     fb_type;        /* fb type, see above */
0052         int     fb_height;      /* pixels */
0053         int     fb_width;       /* pixels */
0054         int     fb_depth;
0055         int     fb_cmsize;      /* color map entries */
0056         int     fb_size;        /* fb size in bytes */
0057 };
0058 #define FBIOGTYPE _IOR('F', 0, struct fbtype)
0059 
0060 struct  fbcmap {
0061         int             index;          /* first element (0 origin) */
0062         int             count;
0063         unsigned char   __user *red;
0064         unsigned char   __user *green;
0065         unsigned char   __user *blue;
0066 };
0067 
0068 #ifndef __KERNEL__
0069 #define FBIOPUTCMAP _IOW('F', 3, struct fbcmap)
0070 #define FBIOGETCMAP _IOW('F', 4, struct fbcmap)
0071 #endif
0072 
0073 /* # of device specific values */
0074 #define FB_ATTR_NDEVSPECIFIC    8
0075 /* # of possible emulations */
0076 #define FB_ATTR_NEMUTYPES       4
0077  
0078 struct fbsattr {
0079         int     flags;
0080         int     emu_type;   /* -1 if none */
0081         int     dev_specific[FB_ATTR_NDEVSPECIFIC];
0082 };
0083  
0084 struct fbgattr {
0085         int     real_type;  /* real frame buffer type */
0086         int     owner;      /* unknown */
0087         struct fbtype fbtype;   /* real frame buffer fbtype */
0088         struct fbsattr sattr;   
0089         int     emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */
0090 };
0091 #define FBIOSATTR  _IOW('F', 5, struct fbgattr) /* Unsupported: */
0092 #define FBIOGATTR  _IOR('F', 6, struct fbgattr) /* supported */
0093 
0094 #define FBIOSVIDEO _IOW('F', 7, int)
0095 #define FBIOGVIDEO _IOR('F', 8, int)
0096 
0097 struct fbcursor {
0098         short set;              /* what to set, choose from the list above */
0099         short enable;           /* cursor on/off */
0100         struct fbcurpos pos;    /* cursor position */
0101         struct fbcurpos hot;    /* cursor hot spot */
0102         struct fbcmap cmap;     /* color map info */
0103         struct fbcurpos size;   /* cursor bit map size */
0104         char __user *image;     /* cursor image bits */
0105         char __user *mask;      /* cursor mask bits */
0106 };
0107 
0108 /* set/get cursor attributes/shape */
0109 #define FBIOSCURSOR     _IOW('F', 24, struct fbcursor)
0110 #define FBIOGCURSOR     _IOWR('F', 25, struct fbcursor)
0111  
0112 /* set/get cursor position */
0113 #define FBIOSCURPOS     _IOW('F', 26, struct fbcurpos)
0114 #define FBIOGCURPOS     _IOW('F', 27, struct fbcurpos)
0115  
0116 /* get max cursor size */
0117 #define FBIOGCURMAX     _IOR('F', 28, struct fbcurpos)
0118 
0119 /* wid manipulation */
0120 struct fb_wid_alloc {
0121 #define FB_WID_SHARED_8     0
0122 #define FB_WID_SHARED_24    1
0123 #define FB_WID_DBL_8        2
0124 #define FB_WID_DBL_24       3
0125     __u32   wa_type;
0126     __s32   wa_index;   /* Set on return */
0127     __u32   wa_count;   
0128 };
0129 struct fb_wid_item {
0130     __u32   wi_type;
0131     __s32   wi_index;
0132     __u32   wi_attrs;
0133     __u32   wi_values[32];
0134 };
0135 struct fb_wid_list {
0136     __u32   wl_flags;
0137     __u32   wl_count;
0138     struct fb_wid_item  *wl_list;
0139 };
0140 
0141 #define FBIO_WID_ALLOC  _IOWR('F', 30, struct fb_wid_alloc)
0142 #define FBIO_WID_FREE   _IOW('F', 31, struct fb_wid_alloc)
0143 #define FBIO_WID_PUT    _IOW('F', 32, struct fb_wid_list)
0144 #define FBIO_WID_GET    _IOWR('F', 33, struct fb_wid_list)
0145 
0146 /* Creator ioctls */
0147 #define FFB_IOCTL   ('F'<<8)
0148 #define FFB_SYS_INFO        (FFB_IOCTL|80)
0149 #define FFB_CLUTREAD        (FFB_IOCTL|81)
0150 #define FFB_CLUTPOST        (FFB_IOCTL|82)
0151 #define FFB_SETDIAGMODE     (FFB_IOCTL|83)
0152 #define FFB_GETMONITORID    (FFB_IOCTL|84)
0153 #define FFB_GETVIDEOMODE    (FFB_IOCTL|85)
0154 #define FFB_SETVIDEOMODE    (FFB_IOCTL|86)
0155 #define FFB_SETSERVER       (FFB_IOCTL|87)
0156 #define FFB_SETOVCTL        (FFB_IOCTL|88)
0157 #define FFB_GETOVCTL        (FFB_IOCTL|89)
0158 #define FFB_GETSAXNUM       (FFB_IOCTL|90)
0159 #define FFB_FBDEBUG     (FFB_IOCTL|91)
0160 
0161 /* Cg14 ioctls */
0162 #define MDI_IOCTL          ('M'<<8)
0163 #define MDI_RESET          (MDI_IOCTL|1)
0164 #define MDI_GET_CFGINFO    (MDI_IOCTL|2)
0165 #define MDI_SET_PIXELMODE  (MDI_IOCTL|3)
0166 #    define MDI_32_PIX     32
0167 #    define MDI_16_PIX     16
0168 #    define MDI_8_PIX      8
0169 
0170 struct mdi_cfginfo {
0171     int     mdi_ncluts;     /* Number of implemented CLUTs in this MDI */
0172         int     mdi_type;       /* FBTYPE name */
0173         int     mdi_height;     /* height */
0174         int     mdi_width;      /* width */
0175         int     mdi_size;       /* available ram */
0176         int     mdi_mode;       /* 8bpp, 16bpp or 32bpp */
0177         int     mdi_pixfreq;    /* pixel clock (from PROM) */
0178 };
0179 
0180 /* SparcLinux specific ioctl for the MDI, should be replaced for
0181  * the SET_XLUT/SET_CLUTn ioctls instead
0182  */
0183 #define MDI_CLEAR_XLUT       (MDI_IOCTL|9)
0184 
0185 /* leo & ffb ioctls */
0186 struct fb_clut_alloc {
0187     __u32   clutid; /* Set on return */
0188     __u32   flag;
0189     __u32   index;
0190 };
0191 
0192 struct fb_clut {
0193 #define FB_CLUT_WAIT    0x00000001  /* Not yet implemented */
0194     __u32   flag;
0195     __u32   clutid;
0196     __u32   offset;
0197     __u32   count;
0198     char *  red;
0199     char *  green;
0200     char *  blue;
0201 };
0202 
0203 struct fb_clut32 {
0204     __u32   flag;
0205     __u32   clutid;
0206     __u32   offset;
0207     __u32   count;
0208     __u32   red;
0209     __u32   green;
0210     __u32   blue;
0211 };
0212 
0213 #define LEO_CLUTALLOC   _IOWR('L', 53, struct fb_clut_alloc)
0214 #define LEO_CLUTFREE    _IOW('L', 54, struct fb_clut_alloc)
0215 #define LEO_CLUTREAD    _IOW('L', 55, struct fb_clut)
0216 #define LEO_CLUTPOST    _IOW('L', 56, struct fb_clut)
0217 #define LEO_SETGAMMA    _IOW('L', 68, int) /* Not yet implemented */
0218 #define LEO_GETGAMMA    _IOR('L', 69, int) /* Not yet implemented */
0219 
0220 
0221 /* These are exported to userland for applications to use */
0222 /* Mappable offsets for the cg14: control registers */
0223 #define MDI_DIRECT_MAP 0x10000000
0224 #define MDI_CTLREG_MAP 0x20000000
0225 #define MDI_CURSOR_MAP 0x30000000
0226 #define MDI_SHDW_VRT_MAP 0x40000000
0227 
0228 /* Mappable offsets for the cg14: frame buffer resolutions */
0229 /* 32 bits */
0230 #define MDI_CHUNKY_XBGR_MAP 0x50000000
0231 #define MDI_CHUNKY_BGR_MAP 0x60000000
0232 
0233 /* 16 bits */
0234 #define MDI_PLANAR_X16_MAP 0x70000000
0235 #define MDI_PLANAR_C16_MAP 0x80000000
0236 
0237 /* 8 bit is done as CG3 MMAP offset */
0238 /* 32 bits, planar */
0239 #define MDI_PLANAR_X32_MAP 0x90000000
0240 #define MDI_PLANAR_B32_MAP 0xa0000000
0241 #define MDI_PLANAR_G32_MAP 0xb0000000
0242 #define MDI_PLANAR_R32_MAP 0xc0000000
0243 
0244 /* Mappable offsets on leo */
0245 #define LEO_SS0_MAP            0x00000000
0246 #define LEO_LC_SS0_USR_MAP     0x00800000
0247 #define LEO_LD_SS0_MAP         0x00801000
0248 #define LEO_LX_CURSOR_MAP      0x00802000
0249 #define LEO_SS1_MAP            0x00803000
0250 #define LEO_LC_SS1_USR_MAP     0x01003000
0251 #define LEO_LD_SS1_MAP         0x01004000
0252 #define LEO_UNK_MAP            0x01005000
0253 #define LEO_LX_KRN_MAP         0x01006000
0254 #define LEO_LC_SS0_KRN_MAP     0x01007000
0255 #define LEO_LC_SS1_KRN_MAP     0x01008000
0256 #define LEO_LD_GBL_MAP         0x01009000
0257 #define LEO_UNK2_MAP           0x0100a000
0258 
0259 
0260 #endif /* _UAPI__LINUX_FBIO_H */