OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcBlitLib.c File Reference
#include <Uefi/UefiBaseType.h>
#include <Protocol/GraphicsOutput.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/OcBlitLib.h>
#include "BlitInternal.h"

Go to the source code of this file.

Functions

STATIC VOID BlitLibConfigurePixelFormat (IN CONST EFI_PIXEL_BITMASK *BitMask, OUT UINT32 *BytesPerPixel, OUT INT8 *PixelShl, OUT INT8 *PixelShr)
 
STATIC EFI_STATUS BlitLibVideoFill (IN OC_BLIT_CONFIGURE *Configure, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Color, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height)
 
STATIC RETURN_STATUS BlitLibVideoToBuffer (IN OC_BLIT_CONFIGURE *Configure, 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)
 
STATIC RETURN_STATUS BlitLibBufferToVideo (IN OC_BLIT_CONFIGURE *Configure, 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)
 
STATIC RETURN_STATUS BlitLibVideoToVideo (IN OC_BLIT_CONFIGURE *Configure, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height)
 
RETURN_STATUS EFIAPI OcBlitConfigure (IN VOID *FrameBuffer, IN EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo, IN UINT32 Rotation, IN OUT OC_BLIT_CONFIGURE *Configure, IN OUT UINTN *ConfigureSize)
 
RETURN_STATUS EFIAPI OcBlitRender (IN OC_BLIT_CONFIGURE *Configure, IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL, IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN Delta)
 

Variables

STATIC CONST EFI_PIXEL_BITMASK mRgbPixelMasks
 
STATIC CONST EFI_PIXEL_BITMASK mBgrPixelMasks
 

Detailed Description

OcBlitLib - Library to perform blt operations on a frame buffer.

Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2021, vit9696. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file OcBlitLib.c.

Function Documentation

◆ BlitLibBufferToVideo()

STATIC RETURN_STATUS BlitLibBufferToVideo ( IN OC_BLIT_CONFIGURE * Configure,
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 Buffer to Video operation with extended parameters.

Parameters
[in]ConfigurePointer to a configuration which was successfully created by FrameBufferBltConfigure ().
[in]BltBufferOutput buffer for pixel color data.
[in]SourceXX location within BltBuffer.
[in]SourceYY location within BltBuffer.
[in]DestinationXX location within video.
[in]DestinationYY location within video.
[in]WidthWidth (in pixels).
[in]HeightHeight.
[in]DeltaNumber of bytes in a row of BltBuffer.
Return values
RETURN_INVALID_PARAMETERInvalid parameter were passed in.
RETURN_SUCCESSThe Blt operation was performed successfully.

Definition at line 382 of file OcBlitLib.c.

◆ BlitLibConfigurePixelFormat()

STATIC VOID BlitLibConfigurePixelFormat ( IN CONST EFI_PIXEL_BITMASK * BitMask,
OUT UINT32 * BytesPerPixel,
OUT INT8 * PixelShl,
OUT INT8 * PixelShr )

Initialize the bit mask in frame buffer configure.

Parameters
BitMaskThe bit mask of pixel.
BytesPerPixelSize in bytes of pixel.
PixelShlLeft shift array.
PixelShrRight shift array.

Definition at line 38 of file OcBlitLib.c.

◆ BlitLibVideoFill()

STATIC EFI_STATUS BlitLibVideoFill ( IN OC_BLIT_CONFIGURE * Configure,
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 Fill.

Parameters
[in]ConfigurePointer to a configuration which was successfully created by FrameBufferBltConfigure ().
[in]ColorColor to fill the region with.
[in]DestinationXX location to start fill operation.
[in]DestinationYY location to start fill operation.
[in]WidthWidth (in pixels) to fill.
[in]HeightHeight to fill.
Return values
RETURN_INVALID_PARAMETERInvalid parameter was passed in.
RETURN_SUCCESSThe video was filled successfully.

Definition at line 100 of file OcBlitLib.c.

◆ BlitLibVideoToBuffer()

STATIC RETURN_STATUS BlitLibVideoToBuffer ( IN OC_BLIT_CONFIGURE * Configure,
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 Video to Buffer operation with extended parameters.

Parameters
[in]ConfigurePointer to a configuration which was successfully created by FrameBufferBltConfigure ().
[out]BltBufferOutput buffer for pixel color data.
[in]SourceXX location within video.
[in]SourceYY location within video.
[in]DestinationXX location within BltBuffer.
[in]DestinationYY location within BltBuffer.
[in]WidthWidth (in pixels).
[in]HeightHeight.
[in]DeltaNumber of bytes in a row of BltBuffer.
Return values
RETURN_INVALID_PARAMETERInvalid parameter were passed in.
RETURN_SUCCESSThe Blt operation was performed successfully.

Definition at line 267 of file OcBlitLib.c.

◆ BlitLibVideoToVideo()

STATIC RETURN_STATUS BlitLibVideoToVideo ( IN OC_BLIT_CONFIGURE * Configure,
IN UINTN SourceX,
IN UINTN SourceY,
IN UINTN DestinationX,
IN UINTN DestinationY,
IN UINTN Width,
IN UINTN Height )

Performs a UEFI Graphics Output Protocol Blt Video to Video operation

Parameters
[in]ConfigurePointer to a configuration which was successfully created by FrameBufferBltConfigure ().
[in]SourceXX location within video.
[in]SourceYY location within video.
[in]DestinationXX location within video.
[in]DestinationYY location within video.
[in]WidthWidth (in pixels).
[in]HeightHeight.
Return values
RETURN_INVALID_PARAMETERInvalid parameter were passed in.
RETURN_SUCCESSThe Blt operation was performed successfully.

Definition at line 494 of file OcBlitLib.c.

◆ OcBlitConfigure()

RETURN_STATUS EFIAPI OcBlitConfigure ( IN VOID * FrameBuffer,
IN EFI_GRAPHICS_OUTPUT_MODE_INFORMATION * FrameBufferInfo,
IN UINT32 Rotation,
IN OUT OC_BLIT_CONFIGURE * Configure,
IN OUT UINTN * ConfigureSize )

Create the configuration for a video frame buffer.

The configuration is returned in the caller provided buffer.

Parameters
[in]FrameBufferPointer to the start of the frame buffer.
[in]FrameBufferInfoDescribes the frame buffer characteristics. The information in FramebufferInfo must refer to unmodified (not rotated) framebuffer.
[in]RotationRotation scheme in degrees (must be one of 0, 90, 180, 270).
[in,out]ConfigureThe created configuration information.
[in,out]ConfigureSizeSize of the configuration information.
Return values
RETURN_SUCCESSThe configuration was successful created.
RETURN_BUFFER_TOO_SMALLThe Configure is to too small. The required size is returned in ConfigureSize.
RETURN_UNSUPPORTEDThe requested mode is not supported by this implementaion.

Definition at line 602 of file OcBlitLib.c.

◆ OcBlitRender()

RETURN_STATUS EFIAPI OcBlitRender ( IN OC_BLIT_CONFIGURE * Configure,
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
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 operation.

Parameters
[in]ConfigurePointer to a configuration which was successfully created by FrameBufferBltConfigure ().
[in,out]BltBufferThe data to transfer to screen.
[in]BltOperationThe operation to perform.
[in]SourceXThe X coordinate of the source for BltOperation.
[in]SourceYThe Y coordinate of the source for BltOperation.
[in]DestinationXThe X coordinate of the destination for BltOperation.
[in]DestinationYThe Y coordinate of the destination for BltOperation.
[in]WidthThe width of a rectangle in the blt rectangle in pixels.
[in]HeightThe height of a rectangle in the blt rectangle in pixels.
[in]DeltaNot used for EfiBltVideoFill and EfiBltVideoToVideo operation. If a Delta of 0 is used, the entire BltBuffer will be operated on. If a subrectangle of the BltBuffer is used, then Delta represents the number of bytes in a row of the BltBuffer.
Return values
RETURN_INVALID_PARAMETERInvalid parameter were passed in.
RETURN_SUCCESSThe Blt operation was performed successfully.

Definition at line 688 of file OcBlitLib.c.

Variable Documentation

◆ mBgrPixelMasks

STATIC CONST EFI_PIXEL_BITMASK mBgrPixelMasks
Initial value:
= {
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
}

Definition at line 24 of file OcBlitLib.c.

◆ mRgbPixelMasks

STATIC CONST EFI_PIXEL_BITMASK mRgbPixelMasks
Initial value:
= {
0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
}

Definition at line 20 of file OcBlitLib.c.