4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/** @file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UGA Draw protocol from the EFI 1.10 specification.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Abstraction of a very simple graphics device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are licensed and made available under the terms and conditions of the BSD License
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync which accompanies this distribution. The full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync http://opensource.org/licenses/bsd-license.php
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#ifndef __UGA_DRAW_H__
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define __UGA_DRAW_H__
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define EFI_UGA_DRAW_PROTOCOL_GUID \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync { \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync }
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Return the current video mode information.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This The EFI_UGA_DRAW_PROTOCOL instance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param HorizontalResolution The size of video screen in pixels in the X dimension.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param VerticalResolution The size of video screen in pixels in the Y dimension.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param ColorDepth Number of bits per pixel, currently defined to be 32.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param RefreshRate The refresh rate of the monitor in Hertz.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Mode information returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER One of the input args was NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE)(
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_UGA_DRAW_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT32 *HorizontalResolution,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT32 *VerticalResolution,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT32 *ColorDepth,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT32 *RefreshRate
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Set the current video mode information.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This The EFI_UGA_DRAW_PROTOCOL instance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param HorizontalResolution The size of video screen in pixels in the X dimension.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param VerticalResolution The size of video screen in pixels in the Y dimension.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param ColorDepth Number of bits per pixel, currently defined to be 32.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param RefreshRate The refresh rate of the monitor in Hertz.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS Mode information returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE)(
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_UGA_DRAW_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 HorizontalResolution,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 VerticalResolution,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 ColorDepth,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 RefreshRate
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef struct {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 Blue;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 Green;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 Red;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 Reserved;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync} EFI_UGA_PIXEL;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef union {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_UGA_PIXEL Pixel;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT32 Raw;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync} EFI_UGA_PIXEL_UNION;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync///
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Enumration value for actions of Blt operations.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync///
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef enum {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< directly to every pixel of the video display rectangle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< the BltBuffer rectangle (DestinationX, DestinationY )
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< DestinationY is not zero then Delta must be set to the length in bytes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< of a row in the BltBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< video display rectangle (DestinationX, DestinationY)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< not zero then Delta must be set to the length in bytes of a row in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< BltBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< The BltBuffer and Delta are not used in this mode.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ///< larger or equal to this enumration value, it is invalid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync} EFI_UGA_BLT_OPERATION;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Blt a rectangle of pixels on the graphics screen.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] This - Protocol instance pointer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] SourceX - X coordinate of source for the BltBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] SourceY - Y coordinate of source for the BltBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DestinationX - X coordinate of destination for the BltBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Width - Width of rectangle in BltBuffer in pixels.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Height - Hight of rectangle in BltBuffer in pixels.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] Delta - OPTIONAL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS - The Blt operation completed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT)(
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_UGA_DRAW_PROTOCOL * This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_UGA_BLT_OPERATION BltOperation,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN SourceX,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN SourceY,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN DestinationX,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN DestinationY,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Width,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Height,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN Delta OPTIONAL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync///
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// This protocol provides a basic abstraction to set video modes and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// copy pixels to and from the graphics controller's frame buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync///
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncstruct _EFI_UGA_DRAW_PROTOCOL {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_UGA_DRAW_PROTOCOL_BLT Blt;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync};
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncextern EFI_GUID gEfiUgaDrawProtocolGuid;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#endif