PageRenderTime 45ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/libeg/efiUgaDraw.h

https://github.com/sbutler/rEFInd
C Header | 182 lines | 66 code | 13 blank | 103 comment | 0 complexity | 6898a319f4715aa83a05c1bcd2f3cc4b MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0
  1. /*++
  2. Copyright (c) 2004, Intel Corporation
  3. All rights reserved. This program and the accompanying materials
  4. are licensed and made available under the terms and conditions of the BSD License
  5. which accompanies this distribution. The full text of the license may be found at
  6. http://opensource.org/licenses/bsd-license.php
  7. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  9. Module Name:
  10. UgaDraw.h
  11. Abstract:
  12. UGA Draw protocol from the EFI 1.1 specification.
  13. Abstraction of a very simple graphics device.
  14. --*/
  15. #ifndef __UGA_DRAW_H__
  16. #define __UGA_DRAW_H__
  17. #define EFI_UGA_DRAW_PROTOCOL_GUID \
  18. { \
  19. 0x982c298b, 0xf4fa, 0x41cb, { 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
  20. }
  21. /* typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL; */
  22. struct _EFI_UGA_DRAW_PROTOCOL;
  23. typedef
  24. EFI_STATUS
  25. (EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
  26. IN struct _EFI_UGA_DRAW_PROTOCOL * This,
  27. OUT UINT32 *HorizontalResolution,
  28. OUT UINT32 *VerticalResolution,
  29. OUT UINT32 *ColorDepth,
  30. OUT UINT32 *RefreshRate
  31. )
  32. /*++
  33. Routine Description:
  34. Return the current video mode information.
  35. Arguments:
  36. This - Protocol instance pointer.
  37. HorizontalResolution - Current video horizontal resolution in pixels
  38. VerticalResolution - Current video vertical resolution in pixels
  39. ColorDepth - Current video color depth in bits per pixel
  40. RefreshRate - Current video refresh rate in Hz.
  41. Returns:
  42. EFI_SUCCESS - Mode information returned.
  43. EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
  44. EFI_INVALID_PARAMETER - One of the input args was NULL.
  45. --*/
  46. ;
  47. typedef
  48. EFI_STATUS
  49. (EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
  50. IN struct _EFI_UGA_DRAW_PROTOCOL * This,
  51. IN UINT32 HorizontalResolution,
  52. IN UINT32 VerticalResolution,
  53. IN UINT32 ColorDepth,
  54. IN UINT32 RefreshRate
  55. )
  56. /*++
  57. Routine Description:
  58. Return the current video mode information.
  59. Arguments:
  60. This - Protocol instance pointer.
  61. HorizontalResolution - Current video horizontal resolution in pixels
  62. VerticalResolution - Current video vertical resolution in pixels
  63. ColorDepth - Current video color depth in bits per pixel
  64. RefreshRate - Current video refresh rate in Hz.
  65. Returns:
  66. EFI_SUCCESS - Mode information returned.
  67. EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
  68. --*/
  69. ;
  70. typedef struct {
  71. UINT8 Blue;
  72. UINT8 Green;
  73. UINT8 Red;
  74. UINT8 Reserved;
  75. } EFI_UGA_PIXEL;
  76. typedef union {
  77. EFI_UGA_PIXEL Pixel;
  78. UINT32 Raw;
  79. } EFI_UGA_PIXEL_UNION;
  80. typedef enum {
  81. EfiUgaVideoFill,
  82. EfiUgaVideoToBltBuffer,
  83. EfiUgaBltBufferToVideo,
  84. EfiUgaVideoToVideo,
  85. EfiUgaBltMax
  86. } EFI_UGA_BLT_OPERATION;
  87. typedef
  88. EFI_STATUS
  89. (EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
  90. IN struct _EFI_UGA_DRAW_PROTOCOL * This,
  91. IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
  92. IN EFI_UGA_BLT_OPERATION BltOperation,
  93. IN UINTN SourceX,
  94. IN UINTN SourceY,
  95. IN UINTN DestinationX,
  96. IN UINTN DestinationY,
  97. IN UINTN Width,
  98. IN UINTN Height,
  99. IN UINTN Delta OPTIONAL
  100. );
  101. /*++
  102. Routine Description:
  103. The following table defines actions for BltOperations:
  104. EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
  105. directly to every pixel of the video display rectangle
  106. (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
  107. Only one pixel will be used from the BltBuffer. Delta is NOT used.
  108. EfiUgaVideoToBltBuffer - Read data from the video display rectangle
  109. (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
  110. the BltBuffer rectangle (DestinationX, DestinationY )
  111. (DestinationX + Width, DestinationY + Height). If DestinationX or
  112. DestinationY is not zero then Delta must be set to the length in bytes
  113. of a row in the BltBuffer.
  114. EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle
  115. (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
  116. video display rectangle (DestinationX, DestinationY)
  117. (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
  118. not zero then Delta must be set to the length in bytes of a row in the
  119. BltBuffer.
  120. EfiUgaVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
  121. (SourceX + Width, SourceY + Height) .to the video display rectangle
  122. (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
  123. The BltBuffer and Delta are not used in this mode.
  124. Arguments:
  125. This - Protocol instance pointer.
  126. BltBuffer - Buffer containing data to blit into video buffer. This
  127. buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
  128. BltOperation - Operation to perform on BlitBuffer and video memory
  129. SourceX - X coordinate of source for the BltBuffer.
  130. SourceY - Y coordinate of source for the BltBuffer.
  131. DestinationX - X coordinate of destination for the BltBuffer.
  132. DestinationY - Y coordinate of destination for the BltBuffer.
  133. Width - Width of rectangle in BltBuffer in pixels.
  134. Height - Hight of rectangle in BltBuffer in pixels.
  135. Delta -
  136. Returns:
  137. EFI_SUCCESS - The Blt operation completed.
  138. EFI_INVALID_PARAMETER - BltOperation is not valid.
  139. EFI_DEVICE_ERROR - A hardware error occured writting to the video
  140. buffer.
  141. --*/
  142. ;
  143. typedef struct _EFI_UGA_DRAW_PROTOCOL {
  144. EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
  145. EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
  146. EFI_UGA_DRAW_PROTOCOL_BLT Blt;
  147. } EFI_UGA_DRAW_PROTOCOL;
  148. extern EFI_GUID gEfiUgaDrawProtocolGuid;
  149. #endif