ioctl.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
  3. * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License as published by the Free Software Foundation;
  7. * either version 2, or (at your option) any later version.
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
  10. * the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. * A PARTICULAR PURPOSE.See the GNU General Public License
  12. * for more details.
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc.,
  16. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #ifndef __IOCTL_H__
  19. #define __IOCTL_H__
  20. #ifndef __user
  21. #define __user
  22. #endif
  23. /* VIAFB IOCTL definition */
  24. #define VIAFB_GET_INFO_SIZE 0x56494101 /* 'VIA\01' */
  25. #define VIAFB_GET_INFO 0x56494102 /* 'VIA\02' */
  26. #define VIAFB_HOTPLUG 0x56494103 /* 'VIA\03' */
  27. #define VIAFB_SET_HOTPLUG_FLAG 0x56494104 /* 'VIA\04' */
  28. #define VIAFB_GET_RESOLUTION 0x56494105 /* 'VIA\05' */
  29. #define VIAFB_GET_SAMM_INFO 0x56494107 /* 'VIA\07' */
  30. #define VIAFB_TURN_ON_OUTPUT_DEVICE 0x56494108 /* 'VIA\08' */
  31. #define VIAFB_TURN_OFF_OUTPUT_DEVICE 0x56494109 /* 'VIA\09' */
  32. #define VIAFB_SET_DEVICE 0x5649410A
  33. #define VIAFB_GET_DEVICE 0x5649410B
  34. #define VIAFB_GET_DRIVER_VERSION 0x56494112 /* 'VIA\12' */
  35. #define VIAFB_GET_CHIP_INFO 0x56494113 /* 'VIA\13' */
  36. #define VIAFB_SET_DEVICE_INFO 0x56494114
  37. #define VIAFB_GET_DEVICE_INFO 0x56494115
  38. #define VIAFB_GET_DEVICE_SUPPORT 0x56494118
  39. #define VIAFB_GET_DEVICE_CONNECT 0x56494119
  40. #define VIAFB_GET_PANEL_SUPPORT_EXPAND 0x5649411A
  41. #define VIAFB_GET_DRIVER_NAME 0x56494122
  42. #define VIAFB_GET_DEVICE_SUPPORT_STATE 0x56494123
  43. #define VIAFB_GET_GAMMA_LUT 0x56494124
  44. #define VIAFB_SET_GAMMA_LUT 0x56494125
  45. #define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126
  46. #define VIAFB_SET_VIDEO_DEVICE 0x56494127
  47. #define VIAFB_GET_VIDEO_DEVICE 0x56494128
  48. #define VIAFB_SET_SECOND_MODE 0x56494129
  49. #define VIAFB_SYNC_SURFACE 0x56494130
  50. #define VIAFB_GET_DRIVER_CAPS 0x56494131
  51. #define VIAFB_GET_IGA_SCALING_INFO 0x56494132
  52. #define VIAFB_GET_PANEL_MAX_SIZE 0x56494133
  53. #define VIAFB_GET_PANEL_MAX_POSITION 0x56494134
  54. #define VIAFB_SET_PANEL_SIZE 0x56494135
  55. #define VIAFB_SET_PANEL_POSITION 0x56494136
  56. #define VIAFB_GET_PANEL_POSITION 0x56494137
  57. #define VIAFB_GET_PANEL_SIZE 0x56494138
  58. #define None_Device 0x00
  59. #define CRT_Device 0x01
  60. #define LCD_Device 0x02
  61. #define DVI_Device 0x08
  62. #define CRT2_Device 0x10
  63. #define LCD2_Device 0x40
  64. #define OP_LCD_CENTERING 0x01
  65. #define OP_LCD_PANEL_ID 0x02
  66. #define OP_LCD_MODE 0x03
  67. /*SAMM operation flag*/
  68. #define OP_SAMM 0x80
  69. #define LCD_PANEL_ID_MAXIMUM 22
  70. #define STATE_ON 0x1
  71. #define STATE_OFF 0x0
  72. #define STATE_DEFAULT 0xFFFF
  73. #define MAX_ACTIVE_DEV_NUM 2
  74. struct device_t {
  75. unsigned short crt:1;
  76. unsigned short dvi:1;
  77. unsigned short lcd:1;
  78. unsigned short samm:1;
  79. unsigned short lcd_dsp_cent:1;
  80. unsigned char lcd_mode:1;
  81. unsigned short epia_dvi:1;
  82. unsigned short lcd_dual_edge:1;
  83. unsigned short lcd2:1;
  84. unsigned short primary_dev;
  85. unsigned char lcd_panel_id;
  86. unsigned short xres, yres;
  87. unsigned short xres1, yres1;
  88. unsigned short refresh;
  89. unsigned short bpp;
  90. unsigned short refresh1;
  91. unsigned short bpp1;
  92. unsigned short sequence;
  93. unsigned short bus_width;
  94. };
  95. struct viafb_ioctl_info {
  96. u32 viafb_id; /* for identifying viafb */
  97. #define VIAID 0x56494146 /* Identify myself with 'VIAF' */
  98. u16 vendor_id;
  99. u16 device_id;
  100. u8 version;
  101. u8 revision;
  102. u8 reserved[246]; /* for future use */
  103. };
  104. struct viafb_ioctl_mode {
  105. u32 xres;
  106. u32 yres;
  107. u32 refresh;
  108. u32 bpp;
  109. u32 xres_sec;
  110. u32 yres_sec;
  111. u32 virtual_xres_sec;
  112. u32 virtual_yres_sec;
  113. u32 refresh_sec;
  114. u32 bpp_sec;
  115. };
  116. struct viafb_ioctl_samm {
  117. u32 samm_status;
  118. u32 size_prim;
  119. u32 size_sec;
  120. u32 mem_base;
  121. u32 offset_sec;
  122. };
  123. struct viafb_driver_version {
  124. int iMajorNum;
  125. int iKernelNum;
  126. int iOSNum;
  127. int iMinorNum;
  128. };
  129. struct viafb_ioctl_lcd_attribute {
  130. unsigned int panel_id;
  131. unsigned int display_center;
  132. unsigned int lcd_mode;
  133. };
  134. struct viafb_ioctl_setting {
  135. /* Enable or disable active devices */
  136. unsigned short device_flag;
  137. /* Indicate which device should be turn on or turn off. */
  138. unsigned short device_status;
  139. unsigned int reserved;
  140. /* Indicate which LCD's attribute can be changed. */
  141. unsigned short lcd_operation_flag;
  142. /* 1: SAMM ON 0: SAMM OFF */
  143. unsigned short samm_status;
  144. /* horizontal resolution of first device */
  145. unsigned short first_dev_hor_res;
  146. /* vertical resolution of first device */
  147. unsigned short first_dev_ver_res;
  148. /* horizontal resolution of second device */
  149. unsigned short second_dev_hor_res;
  150. /* vertical resolution of second device */
  151. unsigned short second_dev_ver_res;
  152. /* refresh rate of first device */
  153. unsigned short first_dev_refresh;
  154. /* bpp of first device */
  155. unsigned short first_dev_bpp;
  156. /* refresh rate of second device */
  157. unsigned short second_dev_refresh;
  158. /* bpp of second device */
  159. unsigned short second_dev_bpp;
  160. /* Indicate which device are primary display device. */
  161. unsigned int primary_device;
  162. /* Indicate which device will show video. only valid in duoview mode */
  163. unsigned int video_device_status;
  164. unsigned int struct_reserved[34];
  165. struct viafb_ioctl_lcd_attribute lcd_attributes;
  166. };
  167. struct _UTFunctionCaps {
  168. unsigned int dw3DScalingState;
  169. unsigned int reserved[31];
  170. };
  171. struct _POSITIONVALUE {
  172. unsigned int dwX;
  173. unsigned int dwY;
  174. };
  175. struct _panel_size_pos_info {
  176. unsigned int device_type;
  177. int x;
  178. int y;
  179. };
  180. extern int viafb_LCD_ON;
  181. extern int viafb_DVI_ON;
  182. int viafb_ioctl_get_viafb_info(u_long arg);
  183. int viafb_ioctl_hotplug(int hres, int vres, int bpp);
  184. #endif /* __IOCTL_H__ */