Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

787 lines
29 KiB

  1. #if PAL_SUPPORT
  2. //
  3. // ATIConfig
  4. //
  5. #ifndef PALSUPP_INC_
  6. #define PALSUPP_INC_
  7. // #define BUG_800x600_8BPP //if this is defined, in 800x600 8bpp the memory allocation is
  8. // done in rectangles with the width 800 not 832 (the actual cxMemory in this mode)
  9. // #define ALLOC_RECT_ANYWHERE // if this is defined, then the allocation will be made anywhere in the heap, not starting
  10. // at a requested location
  11. // #define DYNAMIC_REZ_AND_COLOUR_CHANGE // palindrome support for on the fly rez and colour depth
  12. #define ACCESSDEVICEDATA_SUBFUNC_ALLOC (DWORD)0x00000001
  13. #define ACCESSDEVICEDATA_SUBFUNC_FREE (DWORD)0x00000002
  14. #define ACCESSDEVICEDATA_SUBFUNC_QUERY (DWORD)0x00000003
  15. #define ACCESSDEVICECODE_CONNECTOR (DWORD)0x00000001
  16. #define ACCESSDEVICECODE_OVERLAY (DWORD)0x00000002
  17. // structure used for the size of off-screen memory alloc
  18. typedef struct tag_OFFSCEREEN {
  19. LONG cx; //width
  20. LONG cy; //height
  21. } OFFSCREEN;
  22. //structure for retriving the info about where the allocated off_screen memory is allocated
  23. typedef struct tag_OVERLAY_LOCATION {
  24. LONG x; //x coordinate in pixels from the begining of the aperture
  25. LONG y; //y coordinate in pixels from the begining of the aperture
  26. ULONG app_offset;//pointer to the begining of the allocated memory in the liniar memory
  27. } OVERLAY_LOCATION;
  28. typedef struct tag_RW_REG_STRUCT{
  29. BYTE reg_block;
  30. WORD reg_offset;
  31. DWORD data;
  32. } RW_REG_STRUCT;
  33. typedef struct struct_ATIConfig
  34. {
  35. BYTE ATISig[10];
  36. BYTE Filler1[2];
  37. BYTE DriverName[9];
  38. BYTE Filler2[3];
  39. DWORD dwMajorVersion;
  40. DWORD dwMinorVersion;
  41. DWORD dwBuildNumber;
  42. DWORD dwDesktopWidth;
  43. DWORD dwDesktopHeight;
  44. DWORD dwEnginePitch;
  45. DWORD dwRealRamAvail;
  46. DWORD VGABoundary;
  47. DWORD dwBpp;
  48. DWORD dwBoardBpp;
  49. DWORD dwColorFormat;
  50. DWORD dwAlphaBitMask;
  51. DWORD dwConfigBits;
  52. DWORD dwAsicRevision;
  53. DWORD dwROMVersion;
  54. DWORD dwBoardType;
  55. DWORD dwApertureType;
  56. DWORD AperturePtr;
  57. DWORD DisplayOffset;
  58. DWORD MemRegPtr;
  59. DWORD dwExtDevice[8];
  60. DWORD MemReg1Ptr;
  61. }
  62. ATIConfig;
  63. #define ATIConfig_ColorFmt_4 0x0000 //4 bpp
  64. #define ATIConfig_ColorFmt_4_Packed 0x0001 //4 bpp
  65. #define ATIConfig_ColorFmt_8 0x0002 //8 bpp
  66. #define ATIConfig_ColorFmt_RGB332 0x0003 //8 bpp
  67. #define ATIConfig_ColorFmt_Crystal8 0x0004 //8 bpp
  68. #define ATIConfig_ColorFmt_RGB555 0x0005 //16 bpp
  69. #define ATIConfig_ColorFmt_RGB565 0x0006 //16 bpp
  70. #define ATIConfig_ColorFmt_RGB655 0x0007 //16 bpp
  71. #define ATIConfig_ColorFmt_RGB664 0x0008 //16 bpp
  72. #define ATIConfig_ColorFmt_RGB888 0x0009 //24 bpp
  73. #define ATIConfig_ColorFmt_BGR888 0x000A //24 bpp
  74. #define ATIConfig_ColorFmt_aRGB8888 0x000B //32 bpp
  75. #define ATIConfig_ColorFmt_RGBa8888 0x000C //32 bpp
  76. #define ATIConfig_ColorFmt_aBGR8888 0x000D //32 bpp
  77. #define ATIConfig_ColorFmt_BGRa8888 0x000E //32 bpp
  78. #define ATIConfig_ColorFmtBIT_4 0x00000001
  79. #define ATIConfig_ColorFmtBIT_4_Packed 0x00000002
  80. #define ATIConfig_ColorFmtBIT_8 0x00000004
  81. #define ATIConfig_ColorFmtBIT_RGB332 0x00000008
  82. #define ATIConfig_ColorFmtBIT_Crystal8 0x00000010
  83. #define ATIConfig_ColorFmtBIT_RGB555 0x00000020
  84. #define ATIConfig_ColorFmtBIT_RGB565 0x 00000040
  85. #define ATIConfig_ColorFmtBIT_RGB655 0x00000080
  86. #define ATIConfig_ColorFmtBIT_RGB664 0x00000100
  87. #define ATIConfig_ColorFmtBIT_RGB888 0x00000200
  88. #define ATIConfig_ColorFmtBIT_BGR888 0x00000400
  89. #define ATIConfig_ColorFmtBIT_aRGB8888 0x00000800
  90. #define ATIConfig_ColorFmtBIT_RGBa8888 0x00001000
  91. #define ATIConfig_ColorFmtBIT_aBGR8888 0x00002000
  92. #define ATIConfig_ColorFmtBIT_BGRa8888 0x00004000
  93. // these two struct def have been moved into driver.h
  94. /*
  95. typedef struct tag_alloc_history{
  96. ULONG x;
  97. ULONG y;
  98. OH* poh;
  99. } alloc_history;
  100. typedef struct tagACCESSDEVICEDATA
  101. {
  102. DWORD dwSize;
  103. DWORD dwSubFunc;
  104. DWORD dwAccessDeviceCode;
  105. DWORD lpAccessCallbackFuncPtr;
  106. }ACCESSDEVICEDATA, *pACCESSDEVICEDATA;
  107. */
  108. typedef DWORD FOURCC; /* a four character code */
  109. typedef struct tagVIDEOCAPTUREDATA{
  110. DWORD dwSize;
  111. DWORD dwSubFunc;
  112. DWORD dwCaptureWidth;
  113. DWORD dwCaptureHeight;
  114. FOURCC fccFormat;
  115. DWORD dwBitMasks[3];
  116. DWORD dwCaptureMode;
  117. }VIDEOCAPTUREDATA, FAR *LPVIDEOCAPTUREDATA;
  118. /* Gone into atint.h
  119. typedef struct tag_VIDEO_CAPTURE{
  120. DWORD dwSubFunct; // On , Off or return the capture width
  121. DWORD dwCaptureWidth; // maximum width of the capture at the current resolution, color depth and refresh rate
  122. DWORD dwCaptureMode; // Continuous capture or single capture (host mode)
  123. } VIDEO_CAPTURE;
  124. */
  125. #define VIDEOCAPTUREDATA_SUBFUNC_ENABLE 0x00000000
  126. #define VIDEOCAPTUREDATA_SUBFUNC_DISABLE 0x00000001
  127. #define VIDEOCAPTUREDATA_SUBFUNC_QUERY 0x00000002
  128. #define VIDEOCAPTUREDATA_CAPTURE_HOSTTRIGGED 0x00000000
  129. #define VIDEOCAPTUREDATA_CAPTURE_CONTINUOUS 0x00000001
  130. typedef struct
  131. {
  132. long ScreenWidth;
  133. long ScreenHeight;
  134. long ScreenColorFormat;
  135. long DesctopWidth;
  136. long DesctopHeight;
  137. long SystemColorFormat;
  138. }ModeInfo;
  139. #define Control_DisplaymodeIsSupported 0x73A0
  140. #define Control_DisplaymodeIsEnabled 0x73A1
  141. #define Control_GetDisplaymode 0x73A3
  142. #define Control_TimewarpIsSupported 0x7340
  143. #define Control_TimewarpIsEnabled 0x7341
  144. #define Control_TimewarpEnable 0x7342
  145. #define Control_TimewarpDisable 0x7343
  146. #define Control_DCIIsSupported 0x73E0
  147. #define Control_DCIIsEnabled 0x73E1
  148. #define Control_DCIAccessDevice 0x73EC
  149. #define Control_DCIEnable 0x73e2
  150. #define Control_DCIDisable 0x73e3
  151. #define Control_DCIVideoCapture 0x73ee
  152. #define Control_ConfigIsSupported 0x7300
  153. #define Control_ConfigIsEnabled 0x7301
  154. #define Control_GetConfiguration 0x7302
  155. typedef struct {
  156. WORD wCard;
  157. WORD wChipID;
  158. WORD wError;
  159. WORD wWriteCount;
  160. WORD wReadCount;
  161. BYTE lpWrData[10];
  162. BYTE lpRdData[10];
  163. } I2CSTRUCT_NEW, *LPI2CSTRUCT_NEW;
  164. //
  165. // VT Scaler and Overlay Registers
  166. //
  167. #define OVERLAY_Y_X (0x0000 )//* 4)
  168. #define OVERLAY_Y_X_END (0x0001 )//* 4)
  169. #define OVERLAY_VIDEO_KEY_CLR (0x0002 )//* 4)
  170. #define OVERLAY_VIDEO_KEY_MSK (0x0003 )//* 4)
  171. #define OVERLAY_GRAPHICS_KEY_CLR (0x0004 )//* 4)
  172. #define OVERLAY_GRAPHICS_KEY_MSK (0x0005 )//* 4)
  173. #define OVERLAY_KEY_CNTL (0x0006 )//* 4)
  174. #define OVERLAY_SCALE_INC (0x0008 )//* 4)
  175. #define OVERLAY_SCALE_CNTL (0x0009 )//* 4)
  176. #define SCALER_HEIGHT_WIDTH (0x000A )//* 4)
  177. #define OVERLAY_TEST (0x000B )//* 4)
  178. #define SCALER_THRESHOLD (0x000C )//* 4)
  179. #define CAPTURE_Y_X (0x0010 )//* 4)
  180. #define CAPTURE_HEIGHT_WIDTH (0x0011 )//* 4)
  181. #define VIDEO_FORMAT (0x0012 )//* 4)
  182. #define VIDEO_CONFIG (0x0013 )//* 4)
  183. #define CAPTURE_CONFIG (0x0014 )//* 4)
  184. #define TRIG_CNTL (0x0015 )//* 4)
  185. #define VMC_CONFIG (0x0018 )//* 4)
  186. #define BUF0_OFFSET (0x0020 )//* 4)
  187. #define BUF0_PITCH (0x0023 )//* 4)
  188. #define BUF1_OFFSET (0x0026 )//* 4)
  189. #define BUF1_PITCH (0x0029 )//* 4)
  190. //
  191. // Handle private interface between the 3D driver and the 2D GDI
  192. // driver
  193. //
  194. typedef struct {
  195. DWORD dwSize; // size of this struct
  196. DWORD dwVideoBaseAddr; // linear address to aperture
  197. DWORD dwRegisterBaseAddr; // linear address to registers
  198. DWORD dwOffScreenAddr; // linear address to offscreen memory
  199. DWORD dwOffScreenSize; // size of offscreen memory
  200. DWORD dwTotalRAM; // amount of RAM on the card
  201. DWORD dwFIFOSize; // size of FIFO, (tbfl)
  202. DWORD dwScreenWidth; // screen width
  203. DWORD dwScreenHeight; // screen height
  204. DWORD dwScreenPitch; // screen pitch
  205. DWORD dwBpp; // bits per pixel
  206. // 1
  207. // 4
  208. // 8
  209. // 15 = 1555 format
  210. // 16 = 565 format
  211. // 24
  212. // 32
  213. BOOL b3DAvail; // driver supports 3D operations
  214. DWORD dwChipID; // 3D chip id code
  215. DWORD dwChipRevision; // 3D chip revision
  216. DWORD dwAlphaBitMask; // Alpha bit mask
  217. DWORD dwRedBitMask; // Red Bit Mask
  218. DWORD dwGreenBitMask; // Green Bit Mask
  219. DWORD dwBlueBitMask; // Blue Bit Mask
  220. } PHX2DHWINFO, PPHX2DHWINFO;
  221. // defines and structures for Brooktree819
  222. #define LINE_STORE_ENABLE 0
  223. #define MAX_POSSIB_CARDS 4
  224. //void FAR WriteBT819Reg (WORD wCard, BYTE bReg, WORD wData );
  225. //WORD FAR ReadBT819Reg (WORD wCard, BYTE bReg );
  226. //Physical Registers' Description
  227. typedef struct tagMAPBT819INFO {
  228. BYTE bFunctionality; // multifunctional - 1, monofunctional - 0, 2 - read only
  229. BYTE bReserved; // reserved - 1, active - 0
  230. BYTE bData; // data (a byte)
  231. }MAPBT819INFO;
  232. typedef MAPBT819INFO *MAPBT819;
  233. //Logical Registers' Description
  234. typedef struct tagREGSBT819INFO
  235. {
  236. BYTE bSize; // size of the register in bits
  237. BYTE bAddrLSBs; // register's LSBs address (0 - 31)
  238. BYTE bOffsetLSBs; // register's LSB offset (0 - 7)
  239. BYTE bMaskLSBs; // mask for LSBs (0x0 - 0xFF)
  240. BYTE bAddrMSBs; // register's MSBs address - for the registers longer than 1 byte
  241. BYTE bOffsetMSBs; // register's MSB offset - for the registers longer than 1 byte
  242. BYTE bMaskMSBs; // mask for MSBs - for the registers longer than 1 byte
  243. BYTE RegStatus; // read only - 1, otherwise - 0
  244. }REGSBT819INFO;
  245. typedef WORD REGSBT819DEF;
  246. // BT819 MAP BOUNDARIES' FLAGS
  247. #define RESERVED (BYTE) 1
  248. #define ACTIVE (BYTE) 0
  249. #define MULTIFUNC (BYTE) 1
  250. #define MONOFUNC (BYTE) 0
  251. #define READONLY (BYTE) 2
  252. // INDEX OF BT819 PHYSICAL REGISTERS - 1K BOUNDRIES OF THE 32K BT819 REGISTER MAP:
  253. #define STATUS (BYTE) 0x0
  254. #define IFORM (BYTE) 0x1
  255. #define TDEC (BYTE) 0x2
  256. #define CROP (BYTE) 0x3
  257. #define VDELAY_LO (BYTE) 0x4
  258. #define VACTIVE_LO (BYTE) 0x5
  259. #define HDELAY_LO (BYTE) 0x6
  260. #define HACTIVE_LO (BYTE) 0x7
  261. #define HSCALE_HI (BYTE) 0x8
  262. #define HSCALE_LO (BYTE) 0x9
  263. #define BRIGHT (BYTE) 0xA
  264. #define CONTROL (BYTE) 0xB
  265. #define CONTRAST_LO (BYTE) 0xC
  266. #define SAT_U_LO (BYTE) 0xD
  267. #define SAT_V_LO (BYTE) 0xE
  268. #define HUE (BYTE) 0xF
  269. #define RESERV_1 (BYTE) 0x10 //reserved byte
  270. #define RESERV_2 (BYTE) 0x11 //reserved byte
  271. #define OFORM (BYTE) 0x12
  272. #define VSCALE_HI (BYTE) 0x13
  273. #define VSCALE_LO (BYTE) 0x14
  274. #define TEST (BYTE) 0x15
  275. #define VPOLE (BYTE) 0x16
  276. #define IDCODE (BYTE) 0x17
  277. #define ADELAY (BYTE) 0x18
  278. #define BDELAY (BYTE) 0x19
  279. #define ADC (BYTE) 0x1A
  280. #define RESERV_3 (BYTE) 0x1B //reserved byte
  281. #define RESERV_4 (BYTE) 0x1C //reserved byte
  282. #define RESERV_5 (BYTE) 0x1D //reserved byte
  283. #define RESERV_6 (BYTE) 0x1E //reserved byte
  284. #define SRESET (BYTE) 0x1F
  285. #define NUM_BT819_BNDS (BYTE) 32
  286. // END
  287. //LIST OF LOGICAL REGISTERS:
  288. enum tagBT819LOGREGS
  289. {
  290. reg819_PRES,
  291. reg819_HLOC,
  292. reg819_FIELD,
  293. reg819_NUML,
  294. reg819_CSEL,
  295. reg819_LOF,
  296. reg819_COF,
  297. reg819_HACTIVE_I,
  298. reg819_MUXSEL,
  299. reg819_XTSEL,
  300. reg819_FORMAT,
  301. reg819_DEC_FIELD,
  302. reg819_DEC_RAT,
  303. reg819_VDELAY,
  304. reg819_VACTIVE,
  305. reg819_HDELAY,
  306. reg819_HACTIVE,
  307. reg819_HSCALE,
  308. reg819_BRIGHT,
  309. reg819_LNOTCH,
  310. reg819_COMP,
  311. reg819_LDEC,
  312. reg819_CBSENSE,
  313. reg819_INTERP,
  314. reg819_CON,
  315. reg819_SAT_U,
  316. reg819_SAT_V,
  317. reg819_HUE,
  318. reg819_RANGE,
  319. reg819_RND,
  320. reg819_FIFO_BURST,
  321. reg819_CODE,
  322. reg819_LEN,
  323. reg819_SPI,
  324. reg819_FULL,
  325. reg819_LINE,
  326. reg819_COMB,
  327. reg819_INT,
  328. reg819_VSCALE,
  329. reg819_OUTEN,
  330. reg819_VALID_PIN,
  331. reg819_AFF_PIN,
  332. reg819_CBFLAG_PIN,
  333. reg819_FIELD_PIN,
  334. reg819_ACTIVE_PIN,
  335. reg819_HRESET_PIN,
  336. reg819_VRESET_PIN,
  337. reg819_PART_ID,
  338. reg819_PART_REV,
  339. reg819_ADELAY,
  340. reg819_BDELAY,
  341. reg819_CLAMP,
  342. reg819_SYNC_T,
  343. reg819_AGC_EN,
  344. reg819_CLK_SLEEP,
  345. reg819_Y_SLEEP,
  346. reg819_C_SLEEP,
  347. reg819_SRESET
  348. }BT819LOGREGS;
  349. #define NUM_BT819_REGS (BYTE) 58
  350. #define reg819_PRES_DEF (WORD) 0x0000
  351. #define reg819_HLOC_DEF (WORD) 0x0000
  352. #define reg819_FIELD_DEF (WORD) 0x0000
  353. #define reg819_NUML_DEF (WORD) 0x0000
  354. #define reg819_CSEL_DEF (WORD) 0x0000
  355. #define reg819_LOF_DEF (WORD) 0x0000
  356. #define reg819_COF_DEF (WORD) 0x0000
  357. #define reg819_HACTIVE_I_DEF_DEF (WORD) 0x0000
  358. #define reg819_MUXSEL_DEF (WORD) 0x0002
  359. #define reg819_XTSEL_DEF (WORD) 0x0003
  360. #define reg819_FORMAT_DEF (WORD) 0x0000
  361. #define reg819_DEC_FIELD_DEF (WORD) 0x0000
  362. #define reg819_DEC_RAT_DEF (WORD) 0x0000
  363. #define reg819_VDELAY_DEF (WORD) 0x0016
  364. #define reg819_VACTIVE_DEF (WORD) 0x01E0
  365. #define reg819_HDELAY_DEF (WORD) 0x0078
  366. #define reg819_HACTIVE_DEF (WORD) 0x0280
  367. #define reg819_HSCALE_DEF (WORD) 0x02AC
  368. #define reg819_BRIGHT_DEF (WORD) 0x0000
  369. #define reg819_LNOTCH_DEF (WORD) 0x0000
  370. #define reg819_COMP_DEF (WORD) 0x0000
  371. #define reg819_LDEC_DEF (WORD) 0x0001
  372. #define reg819_CBSENSE_DEF (WORD) 0x0000
  373. #define reg819_INTERP_DEF (WORD) 0x0000
  374. #define reg819_CON_DEF (WORD) 0x00D8
  375. #define reg819_SAT_U_DEF (WORD) 0x00FE
  376. #define reg819_SAT_V_DEF (WORD) 0x00B4
  377. #define reg819_HUE_DEF (WORD) 0x0000
  378. #define reg819_RANGE_DEF (WORD) 0x0000
  379. #define reg819_RND_DEF (WORD) 0x0000
  380. #define reg819_FIFO_BURST_DEF (WORD) 0x0000
  381. #define reg819_CODE_DEF_DEF (WORD) 0x0000
  382. #define reg819_LEN_DEF (WORD) 0x0001
  383. #define reg819_SPI_DEF (WORD) 0x0001
  384. #define reg819_FULL_DEF (WORD) 0x0000
  385. #define reg819_LINE_DEF (WORD) 0x0000
  386. #define reg819_COMB_DEF (WORD) 0x0001
  387. #define reg819_INT_DEF (WORD) 0x0001
  388. #define reg819_VSCALE_DEF (WORD) 0x0000
  389. #define reg819_OUTEN_DEF (WORD) 0x0000
  390. #define reg819_VALID_PIN_DEF (WORD) 0x0000
  391. #define reg819_AFF_PIN_DEF (WORD) 0x0000
  392. #define reg819_CBFLAG_PIN_DEF (WORD) 0x0000
  393. #define reg819_FIELD_PIN_DEF (WORD) 0x0000
  394. #define reg819_ACTIVE_PIN_DEF (WORD) 0x0000
  395. #define reg819_HRESET_PIN_DEF (WORD) 0x0000
  396. #define reg819_VRESET_PIN_DEF (WORD) 0x0000
  397. #define reg819_PART_ID_DEF (WORD) 0x0000 /*Unknown, read only register*/
  398. #define reg819_PART_REV_DEF (WORD) 0x0000 /*Unknown, read only register*/
  399. #define reg819_ADELAY_DEF (WORD) 0x0068
  400. #define reg819_BDELAY_DEF (WORD) 0x005D
  401. #define reg819_CLAMP_DEF (WORD) 0x0002
  402. #define reg819_SYNC_T_DEF (WORD) 0x0000
  403. #define reg819_AGC_EN_DEF (WORD) 0x0000
  404. #define reg819_CLK_SLEEP_DEF (WORD) 0x0000
  405. #define reg819_Y_SLEEP_DEF (WORD) 0x0000
  406. #define reg819_C_SLEEP_DEF (WORD) 0x0001
  407. #define reg819_SRESET_DEF (WORD) 0x0000
  408. /**************************************************************************************************************************************/
  409. static MAPBT819INFO MapBT819DEF[NUM_BT819_BNDS] = /*default value*/
  410. {
  411. { MULTIFUNC, ACTIVE, 0x0 }, //STATUS
  412. { MULTIFUNC, ACTIVE, 0x58}, //IFORM
  413. { MULTIFUNC, ACTIVE, 0x0}, //TDEC
  414. { MULTIFUNC, ACTIVE, 0x12}, //CROP
  415. { MONOFUNC, ACTIVE, 0x16}, //VDELAY_LO
  416. { MONOFUNC, ACTIVE, 0xE0}, //VACTIVE_LO
  417. { MONOFUNC, ACTIVE, 0x78}, //HDELAY_LO
  418. { MONOFUNC, ACTIVE, 0x80}, //HACTIVE_LO
  419. { MONOFUNC, ACTIVE, 0x2}, //HSCALE_HI
  420. { MONOFUNC, ACTIVE, 0xAC}, //HSCALE_LO
  421. { MONOFUNC, ACTIVE, 0x0}, //BRIGHT
  422. { MULTIFUNC, ACTIVE, 0x20}, //CONTROL
  423. { MONOFUNC, ACTIVE, 0xD8}, //CONTRAST_LO
  424. { MONOFUNC, ACTIVE, 0xFE}, //SAT_U_LO,
  425. { MONOFUNC, ACTIVE, 0xB4}, //SAT_V_LO,
  426. { MONOFUNC, ACTIVE, 0x0}, //HUE,
  427. { MONOFUNC, RESERVED, 0x0}, //RESERV_1,
  428. { MONOFUNC, RESERVED, 0x0}, //RESERV_2,
  429. { MULTIFUNC, ACTIVE, 0x6}, //OFORM,
  430. { MULTIFUNC, ACTIVE, 0x60}, //VSCALE_HI,
  431. { MONOFUNC, ACTIVE, 0x0}, //VSCALE_LO,
  432. { MONOFUNC, RESERVED, 0x1}, //TEST,
  433. { MULTIFUNC, ACTIVE, 0x0}, //VPOLE,
  434. { MULTIFUNC, READONLY, 0}, //IDCODE,
  435. { MONOFUNC, ACTIVE, 0x68}, //ADELAY,
  436. { MONOFUNC, ACTIVE, 0x5D}, //BDELAY,
  437. { MULTIFUNC, ACTIVE, 0x82}, //ADC,
  438. { MONOFUNC, RESERVED, 0x0}, //RESERV_3,
  439. { MONOFUNC, RESERVED, 0x0}, //RESERV_4,
  440. { MONOFUNC, RESERVED, 0x0}, //RESERV_5,
  441. { MONOFUNC, RESERVED, 0x0}, //RESERV_6,
  442. { MONOFUNC, ACTIVE, 0x0} //SRESET,
  443. };
  444. // this array is initialized in pal_supp.c
  445. #if 0
  446. REGSBT819INFO RegsBT819[NUM_BT819_REGS] = { /* Register's Name*/
  447. { 1, STATUS, 0, 0x7F, 0, 0, 0, 0 }, // 0 - PRES
  448. { 1, STATUS, 1, 0xBF, 0, 0, 0, 0 }, // 1 - HLOC
  449. { 1, STATUS, 2, 0xDF, 0, 0, 0, 0 }, // 2 - FIELD
  450. { 1, STATUS, 3, 0xEF, 0, 0, 0, 0 }, // 3 - NUML
  451. { 1, STATUS, 4, 0xF7, 0, 0, 0, 0 }, // 4 - CSEL
  452. { 1, STATUS, 6, 0xFD, 0, 0, 0, 0 }, // 5 - LOF
  453. { 1, STATUS, 7, 0xFE, 0, 0, 0, 0 }, // 6 - COF
  454. { 1, IFORM, 0, 0x7F, 0, 0, 0, 0 }, // 7 - HACTIVE_I
  455. { 2, IFORM, 1, 0x9F, 0, 0, 0, 0 }, // 8 - MUXEL
  456. { 2, IFORM, 3, 0xE7, 0, 0, 0, 0 }, // 9 - XTSEL
  457. { 2, IFORM, 6, 0xFC, 0, 0, 0, 0 }, // 10 - FORMAT
  458. { 1, TDEC, 0, 0x7F, 0, 0, 0, 0 }, // 11 - DEC_FIELD
  459. { 7, TDEC, 1, 0x80, 0, 0, 0, 0 }, // 12 - DEC_RAT
  460. { 10, VDELAY_LO, 0, 0x00, CROP, 0, 0x3F, 0 }, // 13 - VDELAY
  461. { 10, VACTIVE_LO, 0, 0x00, CROP, 2, 0xCF, 0 }, // 14 - VACTIVE
  462. { 10, HDELAY_LO, 0, 0x00, CROP, 4, 0xF3, 0 }, // 15 - HDELAY
  463. { 10, HACTIVE_LO, 0, 0x00, CROP, 6, 0xFC, 0 }, // 16 - HACTIVE
  464. { 16, HSCALE_LO, 0, 0x00, HSCALE_HI, 0, 0x00, 0 }, // 17 - HSCALE
  465. { 8, BRIGHT, 0, 0x00, 0, 0, 0, 0 }, // 18 - BRIGHT
  466. { 1, CONTROL, 0, 0x7F, 0, 0, 0, 0 }, // 19 - LNOTCH
  467. { 1, CONTROL, 1, 0xBF, 0, 0, 0, 0 }, // 20 - COMP
  468. { 1, CONTROL, 2, 0xDF, 0, 0, 0, 0 }, // 21 - LDEC
  469. { 1, CONTROL, 3, 0xEF, 0, 0, 0, 0 }, // 22 - CBSENSE
  470. { 1, CONTROL, 4, 0xF7, 0, 0, 0, 0 }, // 23 - INTERP
  471. { 9, CONTRAST_LO, 0, 0x00, CONTROL, 5, 0xFB, 0 }, // 24 - CON
  472. { 9, SAT_U_LO, 0, 0x00, CONTROL, 6, 0xFD, 0 }, // 25 - SAT_U
  473. { 9, SAT_V_LO, 0, 0x00, CONTROL, 7, 0xFE, 0 }, // 26 - SAT_V
  474. { 8, HUE, 0, 0x00, 0, 0, 0, 0 }, // 27 - HUE
  475. { 1, OFORM, 0, 0x7F, 0, 0, 0, 0 }, // 28 - RANGE
  476. { 2, OFORM, 1, 0x9F, 0, 0, 0, 0 }, // 29 - RND
  477. { 1, OFORM, 3, 0xEF, 0, 0, 0, 0 }, // 30 - FIFO_BURST
  478. { 1, OFORM, 4, 0xF7, 0, 0, 0, 0 }, // 31 - CODE
  479. { 1, OFORM, 5, 0xFB, 0, 0, 0, 0 }, // 32 - LEN
  480. { 1, OFORM, 6, 0xFD, 0, 0, 0, 0 }, // 33 - SPI
  481. { 1, OFORM, 7, 0xFE, 0, 0, 0, 0 }, // 34 - FULL
  482. { 1, VSCALE_HI, 0, 0x7F, 0, 0, 0, 0 }, // 35 - LINE
  483. { 1, VSCALE_HI, 1, 0xBF, 0, 0, 0, 0 }, // 36 - COMB
  484. { 1, VSCALE_HI, 2, 0xDF, 0, 0, 0, 0 }, // 37 - INT
  485. { 13,VSCALE_LO, 0, 0x00, VSCALE_HI, 3, 0xE0, 0 }, // 38 - VSCALE
  486. { 1, VPOLE, 0, 0x7F, 0, 0, 0, 0 }, // 39 - OUTEN
  487. { 1, VPOLE, 1, 0xBF, 0, 0, 0, 0 }, // 40 - VALID_PIN
  488. { 1, VPOLE, 2, 0xDF, 0, 0, 0, 0 }, // 41 - AFF_PIN
  489. { 1, VPOLE, 3, 0xEF, 0, 0, 0, 0 }, // 42 - CBFLAG_PIN
  490. { 1, VPOLE, 4, 0xF7, 0, 0, 0, 0 }, // 43 - FIELD_PIN
  491. { 1, VPOLE, 5, 0xFB, 0, 0, 0, 0 }, // 44 - ACTIVE_PIN
  492. { 1, VPOLE, 6, 0xFD, 0, 0, 0, 0 }, // 45 - HRESET_PIN
  493. { 1, VPOLE, 7, 0xFE, 0, 0, 0, 0 }, // 46 - VRESET_PIN
  494. { 4, IDCODE, 0, 0, 0, 0, 0, READONLY }, // 47 - PART_ID
  495. { 4, IDCODE, 4, 0, 0, 0, 0, READONLY }, // 48 - PART_REV
  496. { 8, ADELAY, 0, 0x00, 0, 0, 0, 0 }, // 49 - ADELAY
  497. { 8, BDELAY, 0, 0x00, 0, 0, 0, 0 }, // 50 - BDELAY
  498. { 2, ADC, 0, 0x3F, 0, 0, 0, 0 }, // 51 - CLAMP
  499. { 1, ADC, 2, 0xDF, 0, 0, 0, 0 }, // 52 - SYNC_T
  500. { 1, ADC, 3, 0xEF, 0, 0, 0, 0 }, // 53 - AGC_EN
  501. { 1, ADC, 4, 0xF7, 0, 0, 0, 0 }, // 54 - CLK_SLEEP
  502. { 1, ADC, 5, 0xFB, 0, 0, 0, 0 }, // 55 - Y_SLEEP
  503. { 1, ADC, 6, 0xFD, 0, 0, 0, 0 }, // 56 - C_SLEEP
  504. { 8, SRESET, 0, 0x00, 0, 0, 0, 0 }, // 57 - SRESET
  505. };
  506. #endif
  507. // The following array contains default values for BT819 logical registers
  508. static REGSBT819DEF RegsBT819Def[NUM_BT819_REGS] = {
  509. reg819_PRES_DEF,
  510. reg819_HLOC_DEF,
  511. reg819_FIELD_DEF,
  512. reg819_NUML_DEF,
  513. reg819_CSEL_DEF,
  514. reg819_LOF_DEF,
  515. reg819_COF_DEF,
  516. reg819_HACTIVE_I_DEF_DEF,
  517. reg819_MUXSEL_DEF,
  518. reg819_XTSEL_DEF,
  519. reg819_FORMAT_DEF,
  520. reg819_DEC_FIELD_DEF,
  521. reg819_DEC_RAT_DEF,
  522. reg819_VDELAY_DEF,
  523. reg819_VACTIVE_DEF,
  524. reg819_HDELAY_DEF,
  525. reg819_HACTIVE_DEF,
  526. reg819_HSCALE_DEF,
  527. reg819_BRIGHT_DEF,
  528. reg819_LNOTCH_DEF,
  529. reg819_COMP_DEF,
  530. reg819_LDEC_DEF,
  531. reg819_CBSENSE_DEF,
  532. reg819_INTERP_DEF,
  533. reg819_CON_DEF,
  534. reg819_SAT_U_DEF,
  535. reg819_SAT_V_DEF,
  536. reg819_HUE_DEF,
  537. reg819_RANGE_DEF,
  538. reg819_RND_DEF,
  539. reg819_FIFO_BURST_DEF,
  540. reg819_CODE_DEF_DEF,
  541. reg819_LEN_DEF,
  542. reg819_SPI_DEF,
  543. reg819_FULL_DEF,
  544. reg819_LINE_DEF,
  545. reg819_COMB_DEF,
  546. reg819_INT_DEF,
  547. reg819_VSCALE_DEF,
  548. reg819_OUTEN_DEF,
  549. reg819_VALID_PIN_DEF,
  550. reg819_AFF_PIN_DEF,
  551. reg819_CBFLAG_PIN_DEF,
  552. reg819_FIELD_PIN_DEF,
  553. reg819_ACTIVE_PIN_DEF,
  554. reg819_HRESET_PIN_DEF,
  555. reg819_VRESET_PIN_DEF,
  556. reg819_PART_ID_DEF,
  557. reg819_PART_REV_DEF,
  558. reg819_ADELAY_DEF,
  559. reg819_BDELAY_DEF,
  560. reg819_CLAMP_DEF,
  561. reg819_SYNC_T_DEF,
  562. reg819_AGC_EN_DEF,
  563. reg819_CLK_SLEEP_DEF,
  564. reg819_Y_SLEEP_DEF,
  565. reg819_C_SLEEP_DEF,
  566. reg819_SRESET_DEF
  567. };
  568. // end defines and structures for Brooktree819
  569. // defines for I2C support
  570. //#define ATIAPI
  571. #define I2C_ACK_WR_ERROR 0x01
  572. #define I2C_ACK_RD_ERROR 0x02
  573. #define I2C_COLIDE 0x04
  574. /*
  575. I2C Bus constants
  576. */
  577. #define I2C_HIGH (BYTE) 1
  578. #define I2C_LOW (BYTE) 0
  579. #define I2C_TIME_DELAY (BYTE) 5
  580. #define I2C_WRITE (BOOL)TRUE
  581. #define I2C_READ ( BOOL) FALSE
  582. // end for I2C support
  583. /*
  584. void Init3D_Info(PDEV*,PVOID);
  585. ULONG GetDisplayMode(PDEV* ,PVOID ) ;
  586. ULONG AccessDevice(PDEV* , PVOID, PVOID ) ;
  587. ULONG GetConfiguration(PDEV* ,PVOID ) ;
  588. ULONG WriteRegFnct(PDEV* ,PVOID ) ;
  589. ULONG ReadRegFnct(PDEV* ,PVOID , PVOID) ;
  590. void I2CAccess_New(PDEV* ,LPI2CSTRUCT_NEW ,LPI2CSTRUCT_NEW ) ;
  591. BYTE ReverseByte(BYTE ) ;
  592. WORD Ack(PDEV*, WORD , BOOL ) ;
  593. void Start(PDEV*, WORD ) ;
  594. void Stop(PDEV*, WORD ) ;
  595. void I2CDelay(PDEV*, WORD) ;
  596. void WriteByteI2C(PDEV*, WORD , BYTE ) ;
  597. BYTE ReadByteI2C(PDEV*,WORD ) ;
  598. BOOL DisableOvl(PDEV* ) ;
  599. ULONG AllocOffscreenMem(PDEV* , PVOID , PVOID) ;
  600. ULONG DeallocOffscreenMem(PDEV* ) ;
  601. ULONG AllocOffscreenMem(PDEV* , PVOID , PVOID ) ;
  602. void WriteVT264Reg(PDEV* , WORD , BYTE , DWORD );
  603. DWORD ReadVT264Reg(PDEV* , WORD , BYTE ) ;
  604. void WriteI2CData(PDEV* , WORD , BYTE );
  605. */
  606. /*
  607. * VT registers that matter for the I2C bus
  608. */
  609. #define vtf_GEN_GIO2_DATA_OUT 1
  610. #define vtf_GEN_GIO2_WRITE 2
  611. #define vtf_DAC_GIO_STATE_1 3
  612. #define vtf_GEN_GIO2_DATA_IN 4
  613. #define vtf_CFG_CHIP_FND_ID 5
  614. #define vtf_GEN_GIO3_DATA_OUT 6
  615. #define vtf_GEN_GIO2_EN 7
  616. #define vtf_DAC_FEA_CON_EN 8
  617. #define vtf_DAC_GIO_DIR_1 9
  618. // for VTB, GTB support
  619. #define vtf_GP_IO_4 10
  620. #define vtf_GP_IO_DIR_4 11
  621. #define vtf_GP_IO_B 12
  622. #define vtf_GP_IO_7 13
  623. #define vtf_GP_IO_DIR_B 14
  624. #define vtf_CFG_CHIP_MAJOR 15
  625. #endif
  626. #if 0 // the structure was moved in driver.h
  627. // this structure is used (as a static and global structure) instead of the ppdev structure for keeping the values for
  628. // pal support in NT4.0 since returning from DOS full screen with Alt+Enter will reinitialize the pdev and will lose
  629. // all the info
  630. typedef struct _ppdev_pal_type
  631. {
  632. ULONG no_lines_allocated; // number of lines already allocated by "alloc mem" in offscreen mem
  633. //flags for palindrome
  634. BOOL dos_flag;
  635. BOOL Palindrome_flag;
  636. BOOL Realloc_mem_flag;
  637. BOOL Mode_Switch_flag;
  638. BOOL No_mem_allocated_flag;
  639. DWORD* preg;
  640. //storage for buffers values (needed after a mode switch; ATIPlayer doesn't know that the mode was changed)
  641. DWORD Buf0_Offset;
  642. //DWORD Buf_Scaler1; //for the moment this is the same as the previous
  643. //globals for CWDDE
  644. ACCESSDEVICEDATA* lpOwnerAccessStructConnector;
  645. ACCESSDEVICEDATA* lpOwnerAccessStructOverlay;
  646. BOOL Flag_DCIIsEnabled;
  647. ULONG Counter_DCIIsEnabled;
  648. BOOL Flag_Control_ConfigIsEnabled;
  649. // for offscreen allocation history for palindrome
  650. int alloc_cnt;
  651. alloc_history alloc_hist[8];
  652. // global value for the pointer to the permanent node (off-screen memory allocation)
  653. OH* poh;
  654. // for DCIEnable CWDDE call
  655. PVOID pData;
  656. PVOID CallBackFnct;
  657. } PPDEV_PAL_NT;
  658. #endif
  659. // structure used in mode switch by DCIEnable
  660. typedef struct tagDCICB
  661. {
  662. DWORD dwDCICB_FuncCode;
  663. LPVOID lpDCICB_FuncData;
  664. } DCICB;
  665. #endif
  666.