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.

95 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1993 Weitek Corporation
  3. Module Name:
  4. vga.c
  5. Abstract:
  6. This module contains VGA specific functions for the Weitek P9
  7. miniport device driver.
  8. Environment:
  9. Kernel mode
  10. Revision History may be found at the end of this file.
  11. --*/
  12. #include "p9.h"
  13. #include "p9gbl.h"
  14. #include "vga.h"
  15. VOID
  16. LockVGARegs(
  17. PHW_DEVICE_EXTENSION HwDeviceExtension
  18. )
  19. /*++
  20. Routine Description:
  21. Arguments:
  22. HwDeviceExtension - Pointer to the miniport driver's device extension.
  23. pPal - Pointer to the array of pallete entries.
  24. StartIndex - Specifies the first pallete entry provided in pPal.
  25. Count - Number of palette entries in pPal
  26. Return Value:
  27. None.
  28. --*/
  29. {
  30. //
  31. // *** Don't lock it for ease of debug ***
  32. //
  33. // VGA_WR_REG(SEQ_INDEX_PORT, SEQ_MISC_INDEX);
  34. // VGA_WR_REG(SEQ_DATA_PORT, VGA_RD_REG(SEQ_DATA_PORT) | SEQ_MISC_CRLOCK);
  35. return;
  36. }
  37. VOID
  38. UnlockVGARegs(
  39. PHW_DEVICE_EXTENSION HwDeviceExtension
  40. )
  41. /*++
  42. Routine Description:
  43. Arguments:
  44. HwDeviceExtension - Pointer to the miniport driver's device extension.
  45. pPal - Pointer to the array of pallete entries.
  46. StartIndex - Specifies the first pallete entry provided in pPal.
  47. Count - Number of palette entries in pPal
  48. Return Value:
  49. None.
  50. --*/
  51. {
  52. USHORT holdit;
  53. VGA_WR_REG(SEQ_INDEX_PORT, SEQ_MISC_INDEX);
  54. holdit = VGA_RD_REG(SEQ_DATA_PORT);
  55. VGA_WR_REG(SEQ_DATA_PORT, holdit);
  56. VGA_WR_REG(SEQ_DATA_PORT, holdit);
  57. holdit = VGA_RD_REG(SEQ_DATA_PORT);
  58. VGA_WR_REG(SEQ_DATA_PORT, holdit & ~(SEQ_MISC_CRLOCK));
  59. return;
  60. }