2 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation;
8 * either version 2, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
12 * the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE.See the GNU General Public License
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /* VIAFB IOCTL definition */
30 #define VIAFB_GET_INFO_SIZE 0x56494101 /* 'VIA\01' */
31 #define VIAFB_GET_INFO 0x56494102 /* 'VIA\02' */
32 #define VIAFB_HOTPLUG 0x56494103 /* 'VIA\03' */
33 #define VIAFB_SET_HOTPLUG_FLAG 0x56494104 /* 'VIA\04' */
34 #define VIAFB_GET_RESOLUTION 0x56494105 /* 'VIA\05' */
35 #define VIAFB_GET_SAMM_INFO 0x56494107 /* 'VIA\07' */
36 #define VIAFB_TURN_ON_OUTPUT_DEVICE 0x56494108 /* 'VIA\08' */
37 #define VIAFB_TURN_OFF_OUTPUT_DEVICE 0x56494109 /* 'VIA\09' */
38 #define VIAFB_SET_DEVICE 0x5649410A
39 #define VIAFB_GET_DEVICE 0x5649410B
40 #define VIAFB_GET_DRIVER_VERSION 0x56494112 /* 'VIA\12' */
41 #define VIAFB_GET_CHIP_INFO 0x56494113 /* 'VIA\13' */
42 #define VIAFB_SET_DEVICE_INFO 0x56494114
43 #define VIAFB_GET_DEVICE_INFO 0x56494115
45 #define VIAFB_GET_DEVICE_SUPPORT 0x56494118
46 #define VIAFB_GET_DEVICE_CONNECT 0x56494119
47 #define VIAFB_GET_PANEL_SUPPORT_EXPAND 0x5649411A
48 #define VIAFB_GET_DRIVER_NAME 0x56494122
49 #define VIAFB_GET_DEVICE_SUPPORT_STATE 0x56494123
50 #define VIAFB_GET_GAMMA_LUT 0x56494124
51 #define VIAFB_SET_GAMMA_LUT 0x56494125
52 #define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126
53 #define VIAFB_SET_VIDEO_DEVICE 0x56494127
54 #define VIAFB_GET_VIDEO_DEVICE 0x56494128
55 #define VIAFB_SET_SECOND_MODE 0x56494129
56 #define VIAFB_SYNC_SURFACE 0x56494130
57 #define VIAFB_GET_DRIVER_CAPS 0x56494131
58 #define VIAFB_GET_IGA_SCALING_INFO 0x56494132
59 #define VIAFB_GET_PANEL_MAX_SIZE 0x56494133
60 #define VIAFB_GET_PANEL_MAX_POSITION 0x56494134
61 #define VIAFB_SET_PANEL_SIZE 0x56494135
62 #define VIAFB_SET_PANEL_POSITION 0x56494136
63 #define VIAFB_GET_PANEL_POSITION 0x56494137
64 #define VIAFB_GET_PANEL_SIZE 0x56494138
66 #define None_Device 0x00
67 #define CRT_Device 0x01
68 #define LCD_Device 0x02
69 #define DVI_Device 0x08
70 #define CRT2_Device 0x10
71 #define LCD2_Device 0x40
73 #define OP_LCD_CENTERING 0x01
74 #define OP_LCD_PANEL_ID 0x02
75 #define OP_LCD_MODE 0x03
77 /*SAMM operation flag*/
80 #define LCD_PANEL_ID_MAXIMUM 22
84 #define STATE_DEFAULT 0xFFFF
86 #define MAX_ACTIVE_DEV_NUM 2
92 unsigned short samm
:1;
93 unsigned short lcd_dsp_cent
:1;
94 unsigned char lcd_mode
:1;
95 unsigned short epia_dvi
:1;
96 unsigned short lcd_dual_edge
:1;
97 unsigned short lcd2
:1;
99 unsigned short primary_dev
;
100 unsigned char lcd_panel_id
;
101 unsigned short xres
, yres
;
102 unsigned short xres1
, yres1
;
103 unsigned short refresh
;
105 unsigned short refresh1
;
107 unsigned short sequence
;
108 unsigned short bus_width
;
111 struct viafb_ioctl_info
{
112 u32 viafb_id
; /* for identifying viafb */
113 #define VIAID 0x56494146 /* Identify myself with 'VIAF' */
118 u8 reserved
[246]; /* for future use */
121 struct viafb_ioctl_mode
{
128 u32 virtual_xres_sec
;
129 u32 virtual_yres_sec
;
133 struct viafb_ioctl_samm
{
141 struct viafb_driver_version
{
148 struct viafb_ioctl_lcd_attribute
{
149 unsigned int panel_id
;
150 unsigned int display_center
;
151 unsigned int lcd_mode
;
154 struct viafb_ioctl_setting
{
155 /* Enable or disable active devices */
156 unsigned short device_flag
;
157 /* Indicate which device should be turn on or turn off. */
158 unsigned short device_status
;
159 unsigned int reserved
;
160 /* Indicate which LCD's attribute can be changed. */
161 unsigned short lcd_operation_flag
;
162 /* 1: SAMM ON 0: SAMM OFF */
163 unsigned short samm_status
;
164 /* horizontal resolution of first device */
165 unsigned short first_dev_hor_res
;
166 /* vertical resolution of first device */
167 unsigned short first_dev_ver_res
;
168 /* horizontal resolution of second device */
169 unsigned short second_dev_hor_res
;
170 /* vertical resolution of second device */
171 unsigned short second_dev_ver_res
;
172 /* refresh rate of first device */
173 unsigned short first_dev_refresh
;
174 /* bpp of first device */
175 unsigned short first_dev_bpp
;
176 /* refresh rate of second device */
177 unsigned short second_dev_refresh
;
178 /* bpp of second device */
179 unsigned short second_dev_bpp
;
180 /* Indicate which device are primary display device. */
181 unsigned int primary_device
;
182 /* Indicate which device will show video. only valid in duoview mode */
183 unsigned int video_device_status
;
184 unsigned int struct_reserved
[34];
185 struct viafb_ioctl_lcd_attribute lcd_attributes
;
188 struct _UTFunctionCaps
{
189 unsigned int dw3DScalingState
;
190 unsigned int reserved
[31];
193 struct _POSITIONVALUE
{
198 struct _panel_size_pos_info
{
199 unsigned int device_type
;
204 extern int viafb_LCD_ON
;
205 extern int viafb_DVI_ON
;
207 int viafb_ioctl_get_viafb_info(u_long arg
);
208 int viafb_ioctl_hotplug(int hres
, int vres
, int bpp
);
210 #endif /* __IOCTL_H__ */