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

/WindSLIC_EFI/include/efiUgaDraw.h

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