Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * sisfb.h - definitions for the SiS framebuffer driver
0004  *
0005  * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
0006  *
0007  * This program is free software; you can redistribute it and/or modify
0008  * it under the terms of the GNU General Public License as published by
0009  * the Free Software Foundation; either version 2 of the named License,
0010  * or any later version.
0011  *
0012  * This program is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0015  * GNU General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU General Public License
0018  * along with this program; if not, write to the Free Software
0019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
0020  */
0021 
0022 #ifndef _UAPI_LINUX_SISFB_H_
0023 #define _UAPI_LINUX_SISFB_H_
0024 
0025 #include <linux/types.h>
0026 #include <asm/ioctl.h>
0027 
0028 /**********************************************/
0029 /*                   PUBLIC                   */
0030 /**********************************************/
0031 
0032 /* vbflags, public (others in sis.h) */
0033 #define CRT2_DEFAULT        0x00000001
0034 #define CRT2_LCD        0x00000002
0035 #define CRT2_TV         0x00000004
0036 #define CRT2_VGA        0x00000008
0037 #define TV_NTSC         0x00000010
0038 #define TV_PAL          0x00000020
0039 #define TV_HIVISION     0x00000040
0040 #define TV_YPBPR        0x00000080
0041 #define TV_AVIDEO       0x00000100
0042 #define TV_SVIDEO       0x00000200
0043 #define TV_SCART        0x00000400
0044 #define TV_PALM         0x00001000
0045 #define TV_PALN         0x00002000
0046 #define TV_NTSCJ        0x00001000
0047 #define TV_CHSCART      0x00008000
0048 #define TV_CHYPBPR525I      0x00010000
0049 #define CRT1_VGA        0x00000000
0050 #define CRT1_LCDA       0x00020000
0051 #define VGA2_CONNECTED          0x00040000
0052 #define VB_DISPTYPE_CRT1    0x00080000  /* CRT1 connected and used */
0053 #define VB_SINGLE_MODE      0x20000000  /* CRT1 or CRT2; determined by DISPTYPE_CRTx */
0054 #define VB_MIRROR_MODE      0x40000000  /* CRT1 + CRT2 identical (mirror mode) */
0055 #define VB_DUALVIEW_MODE    0x80000000  /* CRT1 + CRT2 independent (dual head mode) */
0056 
0057 /* Aliases: */
0058 #define CRT2_ENABLE     (CRT2_LCD | CRT2_TV | CRT2_VGA)
0059 #define TV_STANDARD     (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
0060 #define TV_INTERFACE        (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
0061 
0062 /* Only if TV_YPBPR is set: */
0063 #define TV_YPBPR525I        TV_NTSC
0064 #define TV_YPBPR525P        TV_PAL
0065 #define TV_YPBPR750P        TV_PALM
0066 #define TV_YPBPR1080I       TV_PALN
0067 #define TV_YPBPRALL         (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
0068 
0069 #define VB_DISPTYPE_DISP2   CRT2_ENABLE
0070 #define VB_DISPTYPE_CRT2    CRT2_ENABLE
0071 #define VB_DISPTYPE_DISP1   VB_DISPTYPE_CRT1
0072 #define VB_DISPMODE_SINGLE  VB_SINGLE_MODE
0073 #define VB_DISPMODE_MIRROR  VB_MIRROR_MODE
0074 #define VB_DISPMODE_DUAL    VB_DUALVIEW_MODE
0075 #define VB_DISPLAY_MODE     (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
0076 
0077 /* Structure argument for SISFB_GET_INFO ioctl  */
0078 struct sisfb_info {
0079     __u32   sisfb_id;       /* for identifying sisfb */
0080 #ifndef SISFB_ID
0081 #define SISFB_ID      0x53495346    /* Identify myself with 'SISF' */
0082 #endif
0083     __u32   chip_id;        /* PCI-ID of detected chip */
0084     __u32   memory;         /* total video memory in KB */
0085     __u32   heapstart;      /* heap start offset in KB */
0086     __u8    fbvidmode;      /* current sisfb mode */
0087 
0088     __u8    sisfb_version;
0089     __u8    sisfb_revision;
0090     __u8    sisfb_patchlevel;
0091 
0092     __u8    sisfb_caps;     /* sisfb capabilities */
0093 
0094     __u32   sisfb_tqlen;        /* turbo queue length (in KB) */
0095 
0096     __u32   sisfb_pcibus;       /* The card's PCI ID */
0097     __u32   sisfb_pcislot;
0098     __u32   sisfb_pcifunc;
0099 
0100     __u8    sisfb_lcdpdc;       /* PanelDelayCompensation */
0101 
0102     __u8    sisfb_lcda;     /* Detected status of LCDA for low res/text modes */
0103 
0104     __u32   sisfb_vbflags;
0105     __u32   sisfb_currentvbflags;
0106 
0107     __u32   sisfb_scalelcd;
0108     __u32   sisfb_specialtiming;
0109 
0110     __u8    sisfb_haveemi;
0111     __u8    sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
0112     __u8    sisfb_haveemilcd;
0113 
0114     __u8    sisfb_lcdpdca;      /* PanelDelayCompensation for LCD-via-CRT1 */
0115 
0116     __u16   sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */
0117 
0118     __u32   sisfb_heapsize;     /* heap size (in KB) */
0119     __u32   sisfb_videooffset;  /* Offset of viewport in video memory (in bytes) */
0120 
0121     __u32   sisfb_curfstn;      /* currently running FSTN/DSTN mode */
0122     __u32   sisfb_curdstn;
0123 
0124     __u16   sisfb_pci_vendor;   /* PCI vendor (SiS or XGI) */
0125 
0126     __u32   sisfb_vbflags2;     /* ivideo->vbflags2 */
0127 
0128     __u8    sisfb_can_post;     /* sisfb can POST this card */
0129     __u8    sisfb_card_posted;  /* card is POSTED */
0130     __u8    sisfb_was_boot_device;  /* This card was the boot video device (ie is primary) */
0131 
0132     __u8    reserved[183];      /* for future use */
0133 };
0134 
0135 #define SISFB_CMD_GETVBFLAGS    0x55AA0001  /* no arg; result[1] = vbflags */
0136 #define SISFB_CMD_SWITCHCRT1    0x55AA0010  /* arg[0]: 99 = query, 0 = off, 1 = on */
0137 /* more to come */
0138 
0139 #define SISFB_CMD_ERR_OK    0x80000000  /* command succeeded */
0140 #define SISFB_CMD_ERR_LOCKED    0x80000001  /* sisfb is locked */
0141 #define SISFB_CMD_ERR_EARLY 0x80000002  /* request before sisfb took over gfx system */
0142 #define SISFB_CMD_ERR_NOVB  0x80000003  /* No video bridge */
0143 #define SISFB_CMD_ERR_NOCRT2    0x80000004  /* can't change CRT1 status, CRT2 disabled */
0144 /* more to come */
0145 #define SISFB_CMD_ERR_UNKNOWN   0x8000ffff  /* Unknown command */
0146 #define SISFB_CMD_ERR_OTHER 0x80010000  /* Other error */
0147 
0148 /* Argument for SISFB_CMD ioctl */
0149 struct sisfb_cmd {
0150     __u32  sisfb_cmd;
0151     __u32  sisfb_arg[16];
0152     __u32  sisfb_result[4];
0153 };
0154 
0155 /* Additional IOCTLs for communication sisfb <> X driver                */
0156 /* If changing this, vgatypes.h must also be changed (for X driver)    */
0157 
0158 /* ioctl for identifying and giving some info (esp. memory heap start) */
0159 #define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32)
0160 #define SISFB_GET_INFO      _IOR(0xF3,0x01,struct sisfb_info)
0161 
0162 /* ioctrl to get current vertical retrace status */
0163 #define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
0164 
0165 /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
0166 #define SISFB_GET_AUTOMAXIMIZE  _IOR(0xF3,0x03,__u32)
0167 #define SISFB_SET_AUTOMAXIMIZE  _IOW(0xF3,0x03,__u32)
0168 
0169 /* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
0170 #define SISFB_GET_TVPOSOFFSET   _IOR(0xF3,0x04,__u32)
0171 #define SISFB_SET_TVPOSOFFSET   _IOW(0xF3,0x04,__u32)
0172 
0173 /* ioctl for internal sisfb commands (sisfbctrl) */
0174 #define SISFB_COMMAND       _IOWR(0xF3,0x05,struct sisfb_cmd)
0175 
0176 /* ioctl for locking sisfb (no register access during lock) */
0177 /* As of now, only used to avoid register access during
0178  * the ioctls listed above.
0179  */
0180 #define SISFB_SET_LOCK      _IOW(0xF3,0x06,__u32)
0181 
0182 /* ioctls 0xF3 up to 0x3F reserved for sisfb */
0183 
0184 /****************************************************************/
0185 /* The following are deprecated and should not be used anymore: */
0186 /****************************************************************/
0187 /* ioctl for identifying and giving some info (esp. memory heap start) */
0188 #define SISFB_GET_INFO_OLD     _IOR('n',0xF8,__u32)
0189 /* ioctrl to get current vertical retrace status */
0190 #define SISFB_GET_VBRSTATUS_OLD    _IOR('n',0xF9,__u32)
0191 /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
0192 #define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
0193 #define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
0194 /****************************************************************/
0195 /*               End of deprecated ioctl numbers                */
0196 /****************************************************************/
0197 
0198 /* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
0199 struct sis_memreq {
0200     __u32   offset;
0201     __u32   size;
0202 };
0203 
0204 /**********************************************/
0205 /*                  PRIVATE                   */
0206 /*         (for IN-KERNEL usage only)         */
0207 /**********************************************/
0208 
0209 
0210 #endif /* _UAPI_LINUX_SISFB_H_ */