| 1 |
|
| 2 | |
| 3 | * sisfb.h - definitions for the SiS framebuffer driver
|
| 4 | *
|
| 5 | * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
|
| 6 | *
|
| 7 | * This program is free software; you can redistribute it and/or modify
|
| 8 | * it under the terms of the GNU General Public License as published by
|
| 9 | * the Free Software Foundation; either version 2 of the named License,
|
| 10 | * or any later version.
|
| 11 | *
|
| 12 | * This program is distributed in the hope that it will be useful,
|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 | * GNU General Public License for more details.
|
| 16 | *
|
| 17 | * You should have received a copy of the GNU General Public License
|
| 18 | * along with this program; if not, write to the Free Software
|
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
|
| 20 |
|
| 21 |
|
| 22 | #ifndef _UAPI_LINUX_SISFB_H_
|
| 23 | #define _UAPI_LINUX_SISFB_H_
|
| 24 |
|
| 25 | #include <linux/types.h>
|
| 26 | #include <asm/ioctl.h>
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 | #define CRT2_DEFAULT 0x00000001
|
| 34 | #define CRT2_LCD 0x00000002
|
| 35 | #define CRT2_TV 0x00000004
|
| 36 | #define CRT2_VGA 0x00000008
|
| 37 | #define TV_NTSC 0x00000010
|
| 38 | #define TV_PAL 0x00000020
|
| 39 | #define TV_HIVISION 0x00000040
|
| 40 | #define TV_YPBPR 0x00000080
|
| 41 | #define TV_AVIDEO 0x00000100
|
| 42 | #define TV_SVIDEO 0x00000200
|
| 43 | #define TV_SCART 0x00000400
|
| 44 | #define TV_PALM 0x00001000
|
| 45 | #define TV_PALN 0x00002000
|
| 46 | #define TV_NTSCJ 0x00001000
|
| 47 | #define TV_CHSCART 0x00008000
|
| 48 | #define TV_CHYPBPR525I 0x00010000
|
| 49 | #define CRT1_VGA 0x00000000
|
| 50 | #define CRT1_LCDA 0x00020000
|
| 51 | #define VGA2_CONNECTED 0x00040000
|
| 52 | #define VB_DISPTYPE_CRT1 0x00080000
|
| 53 | #define VB_SINGLE_MODE 0x20000000
|
| 54 | #define VB_MIRROR_MODE 0x40000000
|
| 55 | #define VB_DUALVIEW_MODE 0x80000000
|
| 56 |
|
| 57 |
|
| 58 | #define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA)
|
| 59 | #define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ)
|
| 60 | #define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I)
|
| 61 |
|
| 62 |
|
| 63 | #define TV_YPBPR525I TV_NTSC
|
| 64 | #define TV_YPBPR525P TV_PAL
|
| 65 | #define TV_YPBPR750P TV_PALM
|
| 66 | #define TV_YPBPR1080I TV_PALN
|
| 67 | #define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I)
|
| 68 |
|
| 69 | #define VB_DISPTYPE_DISP2 CRT2_ENABLE
|
| 70 | #define VB_DISPTYPE_CRT2 CRT2_ENABLE
|
| 71 | #define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1
|
| 72 | #define VB_DISPMODE_SINGLE VB_SINGLE_MODE
|
| 73 | #define VB_DISPMODE_MIRROR VB_MIRROR_MODE
|
| 74 | #define VB_DISPMODE_DUAL VB_DUALVIEW_MODE
|
| 75 | #define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
|
| 76 |
|
| 77 |
|
| 78 | struct sisfb_info {
|
| 79 | __u32 sisfb_id;
|
| 80 | #ifndef SISFB_ID
|
| 81 | #define SISFB_ID 0x53495346
|
| 82 | #endif
|
| 83 | __u32 chip_id;
|
| 84 | __u32 memory;
|
| 85 | __u32 heapstart;
|
| 86 | __u8 fbvidmode;
|
| 87 |
|
| 88 | __u8 sisfb_version;
|
| 89 | __u8 sisfb_revision;
|
| 90 | __u8 sisfb_patchlevel;
|
| 91 |
|
| 92 | __u8 sisfb_caps;
|
| 93 |
|
| 94 | __u32 sisfb_tqlen;
|
| 95 |
|
| 96 | __u32 sisfb_pcibus;
|
| 97 | __u32 sisfb_pcislot;
|
| 98 | __u32 sisfb_pcifunc;
|
| 99 |
|
| 100 | __u8 sisfb_lcdpdc;
|
| 101 |
|
| 102 | __u8 sisfb_lcda;
|
| 103 |
|
| 104 | __u32 sisfb_vbflags;
|
| 105 | __u32 sisfb_currentvbflags;
|
| 106 |
|
| 107 | __u32 sisfb_scalelcd;
|
| 108 | __u32 sisfb_specialtiming;
|
| 109 |
|
| 110 | __u8 sisfb_haveemi;
|
| 111 | __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
|
| 112 | __u8 sisfb_haveemilcd;
|
| 113 |
|
| 114 | __u8 sisfb_lcdpdca;
|
| 115 |
|
| 116 | __u16 sisfb_tvxpos, sisfb_tvypos;
|
| 117 |
|
| 118 | __u32 sisfb_heapsize;
|
| 119 | __u32 sisfb_videooffset;
|
| 120 |
|
| 121 | __u32 sisfb_curfstn;
|
| 122 | __u32 sisfb_curdstn;
|
| 123 |
|
| 124 | __u16 sisfb_pci_vendor;
|
| 125 |
|
| 126 | __u32 sisfb_vbflags2;
|
| 127 |
|
| 128 | __u8 sisfb_can_post;
|
| 129 | __u8 sisfb_card_posted;
|
| 130 | __u8 sisfb_was_boot_device;
|
| 131 |
|
| 132 | __u8 reserved[183];
|
| 133 | };
|
| 134 |
|
| 135 | #define SISFB_CMD_GETVBFLAGS 0x55AA0001
|
| 136 | #define SISFB_CMD_SWITCHCRT1 0x55AA0010
|
| 137 |
|
| 138 |
|
| 139 | #define SISFB_CMD_ERR_OK 0x80000000
|
| 140 | #define SISFB_CMD_ERR_LOCKED 0x80000001
|
| 141 | #define SISFB_CMD_ERR_EARLY 0x80000002
|
| 142 | #define SISFB_CMD_ERR_NOVB 0x80000003
|
| 143 | #define SISFB_CMD_ERR_NOCRT2 0x80000004
|
| 144 |
|
| 145 | #define SISFB_CMD_ERR_UNKNOWN 0x8000ffff
|
| 146 | #define SISFB_CMD_ERR_OTHER 0x80010000
|
| 147 |
|
| 148 |
|
| 149 | struct sisfb_cmd {
|
| 150 | __u32 sisfb_cmd;
|
| 151 | __u32 sisfb_arg[16];
|
| 152 | __u32 sisfb_result[4];
|
| 153 | };
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 | #define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32)
|
| 160 | #define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info)
|
| 161 |
|
| 162 |
|
| 163 | #define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32)
|
| 164 |
|
| 165 |
|
| 166 | #define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32)
|
| 167 | #define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32)
|
| 168 |
|
| 169 |
|
| 170 | #define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32)
|
| 171 | #define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32)
|
| 172 |
|
| 173 |
|
| 174 | #define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd)
|
| 175 |
|
| 176 |
|
| 177 | |
| 178 | * the ioctls listed above.
|
| 179 |
|
| 180 | #define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32)
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 | #define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32)
|
| 189 |
|
| 190 | #define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32)
|
| 191 |
|
| 192 | #define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
|
| 193 | #define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 | struct sis_memreq {
|
| 200 | __u32 offset;
|
| 201 | __u32 size;
|
| 202 | };
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 | #endif
|