Jordan and Laszlo,
I reviewed the OptionRomPkg/BltLib again and would like to discuss with you 
about the potential API refinement.
I attached two versions of the refined BltLib.h.

The common part of the two versions is:

1.      BltLibGetSizes() is removed.

Because the size information is actually passed from the library consumer to 
the library. Caller do not need to get the information from the library 
interface.

2.      BltLibBufferToVideoEx and BltLibVideoToBltBufferEx are removed and the 
accordingly non-Ex version of APIs will be used for *Ex operation.
Just for reducing the library APIs and avoid the different APIs have overlapped 
functionality.

3.      BltLibGopBlt() is removed

Same reason as the above #2.

BltLib2.h contains another change.

4.      BltLibConfigure() is removed and the frame buffer information will be 
passed through the four BltLib* APIs.

Because it can remove the restriction to allow the library can be re-entry.

What's your thoughts about this?

Regards,
Ray

/** @file
  Library for performing video blt operations

  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD 
License
  which accompanies this distribution.  The full text of the license may be 
found at
  http://opensource.org/licenses/bsd-license.php

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

#ifndef __BLT_LIB__
#define __BLT_LIB__

#include <Protocol/GraphicsOutput.h>


/**
  Configure the BltLib for a frame-buffer

  @param[in] FrameBuffer      Pointer to the start of the frame buffer
  @param[in] FrameBufferInfo  Describes the frame buffer characteristics

  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
  @retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibConfigure (
  IN  VOID                                 *FrameBuffer,
  IN  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo
  );

/**
  Performs a UEFI Graphics Output Protocol Blt Video Fill.

  @param[in]  Color         Color to fill the region with
  @param[in]  DestinationX  X location to start fill operation
  @param[in]  DestinationY  Y location to start fill operation
  @param[in]  Width         Width (in pixels) to fill
  @param[in]  Height        Height to fill

  @retval  EFI_DEVICE_ERROR - A hardware error occured
  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
  @retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibVideoFill (
  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *Color,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height
  );

/**
  Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation
  with extended parameters.

  @param[out] BltBuffer     Output buffer for pixel color data
  @param[in]  SourceX       X location within video
  @param[in]  SourceY       Y location within video
  @param[in]  DestinationX  X location within BltBuffer
  @param[in]  DestinationY  Y location within BltBuffer
  @param[in]  Width         Width (in pixels)
  @param[in]  Height        Height
  @param[in]  Delta         Number of bytes in a row of BltBuffer

  @retval  EFI_DEVICE_ERROR - A hardware error occured
  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
  @retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibVideoToBltBuffer (
  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
  IN  UINTN                                 SourceX,
  IN  UINTN                                 SourceY,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height,
  IN  UINTN                                 Delta
  );

/**
  Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation
  with extended parameters.

  @param[in]  BltBuffer     Output buffer for pixel color data
  @param[in]  SourceX       X location within BltBuffer
  @param[in]  SourceY       Y location within BltBuffer
  @param[in]  DestinationX  X location within video
  @param[in]  DestinationY  Y location within video
  @param[in]  Width         Width (in pixels)
  @param[in]  Height        Height
  @param[in]  Delta         Number of bytes in a row of BltBuffer

  @retval  EFI_DEVICE_ERROR - A hardware error occured
  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
  @retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibBufferToVideo (
  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
  IN  UINTN                                 SourceX,
  IN  UINTN                                 SourceY,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height,
  IN  UINTN                                 Delta
  );


/**
  Performs a UEFI Graphics Output Protocol Blt Video to Video operation

  @param[in]  SourceX       X location within video
  @param[in]  SourceY       Y location within video
  @param[in]  DestinationX  X location within video
  @param[in]  DestinationY  Y location within video
  @param[in]  Width         Width (in pixels)
  @param[in]  Height        Height

  @retval  EFI_DEVICE_ERROR - A hardware error occured
  @retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
  @retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibVideoToVideo (
  IN  UINTN                                 SourceX,
  IN  UINTN                                 SourceY,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height
  );

#endif

/** @file
Library for performing video blt operations

Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD 
License
which accompanies this distribution.  The full text of the license may be found 
at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

#ifndef __BLT_LIB__
#define __BLT_LIB__

#include <Protocol/GraphicsOutput.h>

/**
Performs a UEFI Graphics Output Protocol Blt Video Fill.

@param[in] FrameBuffer      Pointer to the start of the frame buffer
@param[in] FrameBufferInfo  Describes the frame buffer characteristics
@param[in]  Color         Color to fill the region with
@param[in]  DestinationX  X location to start fill operation
@param[in]  DestinationY  Y location to start fill operation
@param[in]  Width         Width (in pixels) to fill
@param[in]  Height        Height to fill

@retval  EFI_DEVICE_ERROR - A hardware error occured
@retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
@retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibVideoFill (
  IN  VOID                                  *FrameBuffer,
  IN  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *FrameBufferInfo,
  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *Color,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height
  );

/**
Performs a UEFI Graphics Output Protocol Blt Video to Buffer operation
with extended parameters.

@param[in] FrameBuffer      Pointer to the start of the frame buffer
@param[in] FrameBufferInfo  Describes the frame buffer characteristics
@param[out] BltBuffer     Output buffer for pixel color data
@param[in]  SourceX       X location within video
@param[in]  SourceY       Y location within video
@param[in]  DestinationX  X location within BltBuffer
@param[in]  DestinationY  Y location within BltBuffer
@param[in]  Width         Width (in pixels)
@param[in]  Height        Height
@param[in]  Delta         Number of bytes in a row of BltBuffer

@retval  EFI_DEVICE_ERROR - A hardware error occured
@retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
@retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibVideoToBltBuffer (
  IN  VOID                                 *FrameBuffer,
  IN  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo
  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
  IN  UINTN                                 SourceX,
  IN  UINTN                                 SourceY,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height,
  IN  UINTN                                 Delta
  );

/**
Performs a UEFI Graphics Output Protocol Blt Buffer to Video operation
with extended parameters.

@param[in] FrameBuffer      Pointer to the start of the frame buffer
@param[in] FrameBufferInfo  Describes the frame buffer characteristics
@param[in]  BltBuffer     Output buffer for pixel color data
@param[in]  SourceX       X location within BltBuffer
@param[in]  SourceY       Y location within BltBuffer
@param[in]  DestinationX  X location within video
@param[in]  DestinationY  Y location within video
@param[in]  Width         Width (in pixels)
@param[in]  Height        Height
@param[in]  Delta         Number of bytes in a row of BltBuffer

@retval  EFI_DEVICE_ERROR - A hardware error occured
@retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
@retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibBufferToVideo (
  IN  VOID                                 *FrameBuffer,
  IN  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo
  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL         *BltBuffer,
  IN  UINTN                                 SourceX,
  IN  UINTN                                 SourceY,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height,
  IN  UINTN                                 Delta
  );


/**
Performs a UEFI Graphics Output Protocol Blt Video to Video operation

@param[in] FrameBuffer      Pointer to the start of the frame buffer
@param[in] FrameBufferInfo  Describes the frame buffer characteristics
@param[in]  SourceX       X location within video
@param[in]  SourceY       Y location within video
@param[in]  DestinationX  X location within video
@param[in]  DestinationY  Y location within video
@param[in]  Width         Width (in pixels)
@param[in]  Height        Height

@retval  EFI_DEVICE_ERROR - A hardware error occured
@retval  EFI_INVALID_PARAMETER - Invalid parameter passed in
@retval  EFI_SUCCESS - Blt operation success

**/
EFI_STATUS
EFIAPI
BltLibVideoToVideo (
  IN  VOID                                 *FrameBuffer,
  IN  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo
  IN  UINTN                                 SourceX,
  IN  UINTN                                 SourceY,
  IN  UINTN                                 DestinationX,
  IN  UINTN                                 DestinationY,
  IN  UINTN                                 Width,
  IN  UINTN                                 Height
  );

#endif

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to