public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ruiyu Ni <ruiyu.ni@intel.com>
To: edk2-devel@lists.01.org
Cc: Feng Tian <feng.tian@intel.com>,
	Justen Jordan <jordan.l.justen@intel.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: [PATCH v2 2/5] MdeModulePkg: Add FrameBufferBltLib library class
Date: Sun,  9 Oct 2016 16:49:50 +0800	[thread overview]
Message-ID: <20161009084953.58512-3-ruiyu.ni@intel.com> (raw)
In-Reply-To: <20161009084953.58512-1-ruiyu.ni@intel.com>

This library provides interfaces to perform UEFI Graphics
Output Protocol Video BLT operations.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Justen Jordan <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
---
 MdeModulePkg/Include/Library/FrameBufferBltLib.h | 94 ++++++++++++++++++++++++
 MdeModulePkg/MdeModulePkg.dec                    |  4 +
 2 files changed, 98 insertions(+)
 create mode 100644 MdeModulePkg/Include/Library/FrameBufferBltLib.h

diff --git a/MdeModulePkg/Include/Library/FrameBufferBltLib.h b/MdeModulePkg/Include/Library/FrameBufferBltLib.h
new file mode 100644
index 0000000..c92eb94
--- /dev/null
+++ b/MdeModulePkg/Include/Library/FrameBufferBltLib.h
@@ -0,0 +1,94 @@
+/** @file
+  Library for performing UEFI GOP Blt operations on a framebuffer
+
+  Copyright (c) 2009 - 2016, 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 __FRAMEBUFFER_BLT_LIB__
+#define __FRAMEBUFFER_BLT_LIB__
+
+#include <Protocol/GraphicsOutput.h>
+
+//
+// Opaque structure for the frame buffer configure.
+//
+typedef struct FRAME_BUFFER_CONFIGURE FRAME_BUFFER_CONFIGURE;
+
+/**
+  Create the configuration for a video frame buffer.
+
+  The configuration is returned in the caller provided buffer.
+
+  @param[in] FrameBuffer       Pointer to the start of the frame buffer.
+  @param[in] FrameBufferInfo   Describes the frame buffer characteristics.
+  @param[in,out] Configure     The created configuration information.
+  @param[in,out] ConfigureSize Size of the configuration information.
+
+  @retval RETURN_SUCCESS            The configuration was successful created.
+  @retval RETURN_BUFFER_TOO_SMALL   The Configure is to too small. The required
+                                    size is returned in ConfigureSize.
+  @retval RETURN_UNSUPPORTED        The requested mode is not supported by
+                                    this implementaion.
+**/
+RETURN_STATUS
+EFIAPI
+FrameBufferBltConfigure (
+  IN      VOID                                  *FrameBuffer,
+  IN      EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  *FrameBufferInfo,
+  IN OUT  FRAME_BUFFER_CONFIGURE                *Configure,
+  IN OUT  UINTN                                 *ConfigureSize
+  );
+
+/**
+  Performs a UEFI Graphics Output Protocol Blt operation.
+
+  @param[in]     Configure    Pointer to a configuration which was successfully
+                              created by FrameBufferBltConfigure ().
+  @param[in,out] BltBuffer    The data to transfer to screen.
+  @param[in]     BltOperation The operation to perform.
+  @param[in]     SourceX      The X coordinate of the source for BltOperation.
+  @param[in]     SourceY      The Y coordinate of the source for BltOperation.
+  @param[in]     DestinationX The X coordinate of the destination for
+                              BltOperation.
+  @param[in]     DestinationY The Y coordinate of the destination for
+                              BltOperation.
+  @param[in]     Width        The width of a rectangle in the blt rectangle
+                              in pixels.
+  @param[in]     Height       The height of a rectangle in the blt rectangle
+                              in pixels.
+  @param[in]     Delta        Not 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.
+
+  @retval RETURN_INVALID_PARAMETER Invalid parameter were passed in.
+  @retval RETURN_SUCCESS           The Blt operation was performed successfully.
+**/
+RETURN_STATUS
+EFIAPI
+FrameBufferBlt (
+  IN     FRAME_BUFFER_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
+  );
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index f870b83..85ff1cf 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -153,6 +153,10 @@ [LibraryClasses]
   #
   MemoryProfileLib|Include/Library/MemoryProfileLib.h
 
+  ##  @libraryclass  Provides an interface for performing UEFI Graphics Output Protocol Video blt operations.
+  ##
+  FrameBufferBltLib|Include/Library/FrameBufferBltLib.h
+
 [Guids]
   ## MdeModule package token space guid
   # Include/Guid/MdeModulePkgTokenSpace.h
-- 
2.9.0.windows.1



  parent reply	other threads:[~2016-10-09  8:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09  8:49 [PATCH v2 0/5] Add FrameBufferBltLib and GraphicsOutputDxe Ruiyu Ni
2016-10-09  8:49 ` [PATCH v2 1/5] MdePkg/GraphicsInfoHob: Add GraphicsDeviceInfo HOB GUID and structure Ruiyu Ni
2016-10-10  2:34   ` [PATCH v3 " Ruiyu Ni
2016-10-10  2:35     ` Ni, Ruiyu
2016-10-11  5:45     ` Gao, Liming
2016-10-09  8:49 ` Ruiyu Ni [this message]
2016-10-10 14:26   ` [PATCH v2 2/5] MdeModulePkg: Add FrameBufferBltLib library class Laszlo Ersek
2016-10-09  8:49 ` [PATCH v2 3/5] MdeModulePkg: Add FrameBufferBltLib library instance Ruiyu Ni
2016-10-09  8:49 ` [PATCH v2 4/5] MdeModulePkg: Add GraphicsOutputDxe driver Ruiyu Ni
2016-10-09  8:49 ` [PATCH v2 5/5] OvmfPkg: QemuVideoDxe uses MdeModulePkg/FrameBufferLib Ruiyu Ni
2016-10-10 14:56   ` Laszlo Ersek
2016-10-10  6:38 ` [PATCH v2 0/5] Add FrameBufferBltLib and GraphicsOutputDxe Tian, Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161009084953.58512-3-ruiyu.ni@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox