]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OptionRomPkg: Add BltLib definition
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 12 Apr 2011 15:07:34 +0000 (15:07 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 12 Apr 2011 15:07:34 +0000 (15:07 +0000)
This library is intended to make it easy to perform blt operations
on a GOP framebuffer without using the GOP Blt function.

There can be two main forms of implementations of this library:
1) A library which interfaces directly with a framebuffer, and
   has no dependence on the GOP protocol.  Once configured with
   the framebuffer parameters, it can operate directly on the
   framebuffer.
2) A library which interfaces with the GOP protocol.  In this
   case this library provides a convenience layer and allows
   blt code to look cleaner.

Potential uses for this library:
* Video driver with a framebuffer will not need to implement
  GOP Blt function itself.  Instead it can utilize an
  implementation of this library as described in #1 above.
* OS Loader code which would like to easily use the GOP framebuffer
  after Exit Boot Services.  This would use a library instance
  as described in #1 above.
* Any other code which would like to call GOP blt, but simplify
  the code with the more convenient functions provided by this
  library interface.  (Using a library as described in #2 above.)

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11520 6f19259b-4bc3-4df7-8a09-765794883524

OptionRomPkg/Include/Library/BltLib.h [new file with mode: 0644]
OptionRomPkg/OptionRomPkg.dec

diff --git a/OptionRomPkg/Include/Library/BltLib.h b/OptionRomPkg/Include/Library/BltLib.h
new file mode 100644 (file)
index 0000000..9e519b1
--- /dev/null
@@ -0,0 +1,259 @@
+/** @file\r
+  Library for performing video blt operations\r
+\r
+  Copyright (c) 2009 - 2011, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __BLT_LIB__\r
+#define __BLT_LIB__\r
+\r
+#include <Protocol/GraphicsOutput.h>\r
+\r
+\r
+/**\r
+  Configure the BltLib for a frame-buffer\r
+\r
+  @param[in] FrameBuffer      Pointer to the start of the frame buffer\r
+  @param[in] FrameBufferInfo  Describes the frame buffer characteristics\r
+\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibConfigure (\r
+  IN  VOID                                 *FrameBuffer,\r
+  IN  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo\r
+  );\r
+\r
+\r
+/**\r
+  Performs a UEFI Graphics Output Protocol Blt operation.\r
+\r
+  @param[in,out] BltBuffer     - The data to transfer to screen\r
+  @param[in]     BltOperation  - The operation to perform\r
+  @param[in]     SourceX       - The X coordinate of the source for BltOperation\r
+  @param[in]     SourceY       - The Y coordinate of the source for BltOperation\r
+  @param[in]     DestinationX  - The X coordinate of the destination for BltOperation\r
+  @param[in]     DestinationY  - The Y coordinate of the destination for BltOperation\r
+  @param[in]     Width         - The width of a rectangle in the blt rectangle in pixels\r
+  @param[in]     Height        - The height of a rectangle in the blt rectangle in pixels\r
+  @param[in]     Delta         - Not used for EfiBltVideoFill and EfiBltVideoToVideo operation.\r
+                                 If a Delta of 0 is used, the entire BltBuffer will be operated on.\r
+                                 If a subrectangle of the BltBuffer is used, then Delta represents\r
+                                 the number of bytes in a row of the BltBuffer.\r
+\r
+  @retval  EFI_DEVICE_ERROR - A hardware error occured\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibGopBlt (\r
+  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer, OPTIONAL\r
+  IN     EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,\r
+  IN     UINTN                              SourceX,\r
+  IN     UINTN                              SourceY,\r
+  IN     UINTN                              DestinationX,\r
+  IN     UINTN                              DestinationY,\r
+  IN     UINTN                              Width,\r
+  IN     UINTN                              Height,\r
+  IN     UINTN                              Delta\r
+  );\r
+\r
+\r
+/**\r
+  Performs a UEFI Graphics Output Protocol Blt Video Fill.\r
+\r
+  @param[in]  Color         Color to fill the region with\r
+  @param[in]  DestinationX  X location to start fill operation\r
+  @param[in]  DestinationY  Y location to start fill operation\r
+  @param[in]  Width         Width (in pixels) to fill\r
+  @param[in]  Height        Height to fill\r
+\r
+  @retval  EFI_DEVICE_ERROR - A hardware error occured\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibVideoFill (\r
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *Color,\r
+  IN  UINTN                                 DestinationX,\r
+  IN  UINTN                                 DestinationY,\r
+  IN  UINTN                                 Width,\r
+  IN  UINTN                                 Height\r
+  );\r
+\r
+\r
+/**\r
+  Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation.\r
+\r
+  @param[out] BltBuffer     Output buffer for pixel color data\r
+  @param[in]  SourceX       X location within video\r
+  @param[in]  SourceY       Y location within video\r
+  @param[in]  Width         Width (in pixels)\r
+  @param[in]  Height        Height\r
+\r
+  @retval  EFI_DEVICE_ERROR - A hardware error occured\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibVideoToBltBuffer (\r
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,\r
+  IN  UINTN                                 SourceX,\r
+  IN  UINTN                                 SourceY,\r
+  IN  UINTN                                 Width,\r
+  IN  UINTN                                 Height\r
+  );\r
+\r
+\r
+/**\r
+  Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation\r
+  with extended parameters.\r
+\r
+  @param[out] BltBuffer     Output buffer for pixel color data\r
+  @param[in]  SourceX       X location within video\r
+  @param[in]  SourceY       Y location within video\r
+  @param[in]  DestinationX  X location within BltBuffer\r
+  @param[in]  DestinationY  Y location within BltBuffer\r
+  @param[in]  Width         Width (in pixels)\r
+  @param[in]  Height        Height\r
+  @param[in]  Delta         Number of bytes in a row of BltBuffer\r
+\r
+  @retval  EFI_DEVICE_ERROR - A hardware error occured\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibVideoToBltBufferEx (\r
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,\r
+  IN  UINTN                                 SourceX,\r
+  IN  UINTN                                 SourceY,\r
+  IN  UINTN                                 DestinationX,\r
+  IN  UINTN                                 DestinationY,\r
+  IN  UINTN                                 Width,\r
+  IN  UINTN                                 Height,\r
+  IN  UINTN                                 Delta\r
+  );\r
+\r
+\r
+/**\r
+  Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation.\r
+\r
+  @param[in]  BltBuffer     Output buffer for pixel color data\r
+  @param[in]  DestinationX  X location within video\r
+  @param[in]  DestinationY  Y location within video\r
+  @param[in]  Width         Width (in pixels)\r
+  @param[in]  Height        Height\r
+\r
+  @retval  EFI_DEVICE_ERROR - A hardware error occured\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibBufferToVideo (\r
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,\r
+  IN  UINTN                                 DestinationX,\r
+  IN  UINTN                                 DestinationY,\r
+  IN  UINTN                                 Width,\r
+  IN  UINTN                                 Height\r
+  );\r
+\r
+\r
+/**\r
+  Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation\r
+  with extended parameters.\r
+\r
+  @param[in]  BltBuffer     Output buffer for pixel color data\r
+  @param[in]  SourceX       X location within BltBuffer\r
+  @param[in]  SourceY       Y location within BltBuffer\r
+  @param[in]  DestinationX  X location within video\r
+  @param[in]  DestinationY  Y location within video\r
+  @param[in]  Width         Width (in pixels)\r
+  @param[in]  Height        Height\r
+  @param[in]  Delta         Number of bytes in a row of BltBuffer\r
+\r
+  @retval  EFI_DEVICE_ERROR - A hardware error occured\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibBufferToVideoEx (\r
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,\r
+  IN  UINTN                                 SourceX,\r
+  IN  UINTN                                 SourceY,\r
+  IN  UINTN                                 DestinationX,\r
+  IN  UINTN                                 DestinationY,\r
+  IN  UINTN                                 Width,\r
+  IN  UINTN                                 Height,\r
+  IN  UINTN                                 Delta\r
+  );\r
+\r
+\r
+/**\r
+  Performs a UEFI Graphics Output Protocol Blt Video to Video operation\r
+\r
+  @param[in]  SourceX       X location within video\r
+  @param[in]  SourceY       Y location within video\r
+  @param[in]  DestinationX  X location within video\r
+  @param[in]  DestinationY  Y location within video\r
+  @param[in]  Width         Width (in pixels)\r
+  @param[in]  Height        Height\r
+\r
+  @retval  EFI_DEVICE_ERROR - A hardware error occured\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - Blt operation success\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibVideoToVideo (\r
+  IN  UINTN                                 SourceX,\r
+  IN  UINTN                                 SourceY,\r
+  IN  UINTN                                 DestinationX,\r
+  IN  UINTN                                 DestinationY,\r
+  IN  UINTN                                 Width,\r
+  IN  UINTN                                 Height\r
+  );\r
+\r
+\r
+/**\r
+  Returns the sizes related to the video device\r
+\r
+  @param[out]  Width   Width (in pixels)\r
+  @param[out]  Height  Height (in pixels)\r
+\r
+  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in\r
+  @retval  EFI_SUCCESS - The sizes were returned\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BltLibGetSizes (\r
+  OUT UINTN                                 *Width,  OPTIONAL\r
+  OUT UINTN                                 *Height  OPTIONAL\r
+  );\r
+\r
+#endif\r
+\r
index b9eb62048be99c493801512e44992ce8c8b38db9..db61bbec74914ac46f81662add81b4c665703f7e 100644 (file)
   PACKAGE_GUID                   = AA3865E8-7F30-4f59-8696-99F560101852\r
   PACKAGE_VERSION                = 0.1\r
 \r
+[Includes.common]\r
+  Include\r
+\r
+[LibraryClasses]\r
+  ##  @libraryclass  Provides an interface for performing UEFI Graphics\r
+  ##                 Output Protocol Video blt operations\r
+  ##\r
+  BltLib|Include/Library/BltLib.h\r
+\r
 [PcdsFeatureFlag]\r
   gOptionRomPkgTokenSpaceGuid.PcdSupportScsiPassThru|TRUE|BOOLEAN|0x00010001\r
   gOptionRomPkgTokenSpaceGuid.PcdSupportExtScsiPassThru|TRUE|BOOLEAN|0x00010002\r