1/** @file
2  Library for performing UEFI GOP Blt operations on a framebuffer
3
4  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
5
6  This program and the accompanying materials are licensed and made available
7  under the terms and conditions of the BSD License which accompanies this
8  distribution. The full text of the license may be found at
9  http://opensource.org/licenses/bsd-license.php
10
11  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
13  IMPLIED.
14
15**/
16
17#ifndef __FRAMEBUFFER_BLT_LIB__
18#define __FRAMEBUFFER_BLT_LIB__
19
20#include <Protocol/GraphicsOutput.h>
21
22//
23// Opaque structure for the frame buffer configure.
24//
25typedef struct FRAME_BUFFER_CONFIGURE FRAME_BUFFER_CONFIGURE;
26
27/**
28  Create the configuration for a video frame buffer.
29
30  The configuration is returned in the caller provided buffer.
31
32  @param[in] FrameBuffer       Pointer to the start of the frame buffer.
33  @param[in] FrameBufferInfo   Describes the frame buffer characteristics.
34  @param[in,out] Configure     The created configuration information.
35  @param[in,out] ConfigureSize Size of the configuration information.
36
37  @retval RETURN_SUCCESS            The configuration was successful created.
38  @retval RETURN_BUFFER_TOO_SMALL   The Configure is to too small. The required
39                                    size is returned in ConfigureSize.
40  @retval RETURN_UNSUPPORTED        The requested mode is not supported by
41                                    this implementaion.
42**/
43RETURN_STATUS
44EFIAPI
45FrameBufferBltConfigure (
46  IN      VOID                                  *FrameBuffer,
47  IN      EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *FrameBufferInfo,
48  IN OUT  FRAME_BUFFER_CONFIGURE                *Configure,
49  IN OUT  UINTN                                 *ConfigureSize
50  );
51
52/**
53  Performs a UEFI Graphics Output Protocol Blt operation.
54
55  @param[in]     Configure    Pointer to a configuration which was successfully
56                              created by FrameBufferBltConfigure ().
57  @param[in,out] BltBuffer    The data to transfer to screen.
58  @param[in]     BltOperation The operation to perform.
59  @param[in]     SourceX      The X coordinate of the source for BltOperation.
60  @param[in]     SourceY      The Y coordinate of the source for BltOperation.
61  @param[in]     DestinationX The X coordinate of the destination for
62                              BltOperation.
63  @param[in]     DestinationY The Y coordinate of the destination for
64                              BltOperation.
65  @param[in]     Width        The width of a rectangle in the blt rectangle
66                              in pixels.
67  @param[in]     Height       The height of a rectangle in the blt rectangle
68                              in pixels.
69  @param[in]     Delta        Not used for EfiBltVideoFill and
70                              EfiBltVideoToVideo operation. If a Delta of 0
71                              is used, the entire BltBuffer will be operated
72                              on. If a subrectangle of the BltBuffer is
73                              used, then Delta represents the number of
74                              bytes in a row of the BltBuffer.
75
76  @retval RETURN_INVALID_PARAMETER Invalid parameter were passed in.
77  @retval RETURN_SUCCESS           The Blt operation was performed successfully.
78**/
79RETURN_STATUS
80EFIAPI
81FrameBufferBlt (
82  IN     FRAME_BUFFER_CONFIGURE             *Configure,
83  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *BltBuffer, OPTIONAL
84  IN     EFI_GRAPHICS_OUTPUT_BLT_OPERATION  BltOperation,
85  IN     UINTN                              SourceX,
86  IN     UINTN                              SourceY,
87  IN     UINTN                              DestinationX,
88  IN     UINTN                              DestinationY,
89  IN     UINTN                              Width,
90  IN     UINTN                              Height,
91  IN     UINTN                              Delta
92  );
93
94#endif
95