Source code of Windows XP (NT5)
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.

137 lines
3.4 KiB

  1. //---------------------------------------------------------------------------
  2. /*++
  3. Copyright (c) 1993 Compaq Computer Corporation
  4. Module Name:
  5. ctlrasic.c
  6. Abstract:
  7. This module contains the code for identification of Compaq
  8. Display Controller ASICS.
  9. Original QVision ASIC - Feb. '92
  10. --------------------------------
  11. QVision 1024 /E - 1M configuration
  12. QVision 1024 /I - 1M configuration
  13. Deskpro /i with system board QVision - 512k or 1M configuration
  14. Enhanced QVision ASIC - May '93
  15. -------------------------------
  16. QVision 1024 /E - 1M or 2M configuration
  17. QVision 1024 /I - 1M or 2M configuration
  18. QVision 1280 /E - 2M configuration
  19. QVision 1280 /I - 2M configuration
  20. Environment:
  21. kernel mode only
  22. Notes:
  23. Revision History:
  24. $0006
  25. miked: 02/17/1994
  26. . took out conditional debug code to satisfy MSBHPD
  27. $0004
  28. miked: 1/26/1994
  29. . Added debug print code without all the other DBG overhead
  30. 12/1/93 Mike Duke Original module started as start for NT version of QRY
  31. library.
  32. --*/
  33. //---------------------------------------------------------------------------
  34. #include "dderror.h"
  35. #include "devioctl.h"
  36. #include "miniport.h"
  37. #include "ntddvdeo.h"
  38. #include "video.h"
  39. #include "qvision.h"
  40. #include "qry_nt.h"
  41. ULONG
  42. QRY_ControllerASICID( PUCHAR IOAddress )
  43. /*++
  44. Function: QRY_ControllerASICID
  45. This function returns the ASIC id of Compaq Video controllers.
  46. Return value:
  47. The return value is a ULONG with bytes defined as follows:
  48. 3 2 1 0 (byte positions)
  49. ULONG ---> XX FF FF FF
  50. -- -- -- --
  51. | | | |____ASIC ID
  52. | | |_______Extended ID
  53. | |__________Second Extended ID
  54. |_____________Not used (will be zero)
  55. --*/
  56. //---------------------------------------------------------------------------
  57. {
  58. ULONG ulReturn = 0L;
  59. UCHAR ucTemp = 0 ;
  60. // unlock QVision registers
  61. //
  62. VideoPortWritePortUchar((PUCHAR)(IOAddress + GRAPH_ADDRESS_PORT),
  63. 0x0f);
  64. ucTemp = VideoPortReadPortUchar((IOAddress + \
  65. GRAPH_DATA_PORT)) & 0xf0;
  66. VideoPortWritePortUchar((PUCHAR)(IOAddress + GRAPH_DATA_PORT),
  67. (UCHAR)(0x05 | ucTemp));
  68. VideoPortWritePortUchar((PUCHAR)(IOAddress + GRAPH_ADDRESS_PORT),
  69. 0x10);
  70. ucTemp = VideoPortReadPortUchar((PUCHAR)(IOAddress + GRAPH_DATA_PORT));
  71. VideoPortWritePortUchar((PUCHAR)(IOAddress + GRAPH_DATA_PORT),
  72. (UCHAR)(0x28 | ucTemp));
  73. //
  74. // get asic id
  75. //
  76. VideoPortWritePortUchar((PUCHAR)(IOAddress + GRAPH_ADDRESS_PORT), 0x0c);
  77. // read in asic id
  78. //
  79. ucTemp = VideoPortReadPortUchar(IOAddress + GRAPH_DATA_PORT) ;
  80. ulReturn = (ULONG)ucTemp; // save asic id
  81. //
  82. // is extended id info available ?
  83. //
  84. if (ucTemp & EXTENDED_ID_BIT) {
  85. VideoPortWritePortUchar((PUCHAR)(IOAddress + GRAPH_ADDRESS_PORT), 0x0d);
  86. //
  87. // read in extended id
  88. //
  89. ucTemp = VideoPortReadPortUchar(IOAddress + GRAPH_DATA_PORT) ;
  90. ulReturn |= ((ULONG)(ucTemp)) << 8 ;
  91. //
  92. // is second extended id info available ?
  93. //
  94. if (ucTemp & EXTENDED_ID2_BIT) {
  95. VideoPortWritePortUchar((PUCHAR)(IOAddress + GRAPH_ADDRESS_PORT), 0x0e);
  96. //
  97. // read in second extended id
  98. //
  99. ucTemp = VideoPortReadPortUchar(IOAddress + GRAPH_DATA_PORT) ;
  100. ulReturn |= ((ULONG)(ucTemp)) << 16 ;
  101. }
  102. }
  103. return (ulReturn);
  104. }