From nobody Mon Feb 9 08:29:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85684+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85684+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1642121483; cv=none; d=zohomail.com; s=zohoarc; b=MvRRBcHZ6uYpIgZvzRTXq1Fsjv6fWOquV8HgtO3eHDo9CEOYc6j69ZgPaXUV5WWJxqgYLLNvClcukqz2sA/QfXDU4VHAUQ8qmzJW3uzWOFt9ETAWehuBUSljgHA7D2SQiHZw3gRyEfu12A69z6aJzowoppVz1U7Srw/eIB7H5yw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642121483; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=TUhNLeDw5ulrug/SMrJvcsbhbQdKljpnKt2Q/dSIgCE=; b=QuRTKWJlnqJeOisQ/7PNYBSD0Qs36QdTIbVDUQFVN4kFBhpXrC7t4FkvTMcL7KzJovs3Oa7ULewWMPDNxIQOeWVPp9vJ4L5pb8hMiZoeT8xh5mCFw7B8kgy9RHJUM36UAP9agfoznRRCH4J4DNYqEU0QiSy/wQCCDxKxS6oyScI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85684+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1642121483015727.9448848673144; Thu, 13 Jan 2022 16:51:23 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Sud1YY1788612xUn0cjkafBM; Thu, 13 Jan 2022 16:51:22 -0800 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.1082.1642121466955476862 for ; Thu, 13 Jan 2022 16:51:22 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10226"; a="241713871" X-IronPort-AV: E=Sophos;i="5.88,287,1635231600"; d="scan'208";a="241713871" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 16:51:21 -0800 X-IronPort-AV: E=Sophos;i="5.88,287,1635231600"; d="scan'208";a="475564727" X-Received: from guominji-mobl.ccr.corp.intel.com ([10.238.9.87]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 16:51:19 -0800 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: GuoMinJ , Jian J Wang , Liming Gao , Zhichao Gao , Ray Ni Subject: [edk2-devel] [PATCH 07/11] MdeModulePkg/ConSplitterDxe: Remove All UGA Support Date: Fri, 14 Jan 2022 08:50:40 +0800 Message-Id: <20220114005044.1975-8-guomin.jiang@intel.com> In-Reply-To: <20220114005044.1975-1-guomin.jiang@intel.com> References: <20220114005044.1975-1-guomin.jiang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guomin.jiang@intel.com X-Gm-Message-State: wAIYHO9BybKOD8k7rSDaUJR6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1642121482; bh=0Kb40Mqi5vxkCMJTB/eWtMhdzNU5T+hKY0bxEazGFDY=; h=Cc:Date:From:Reply-To:Subject:To; b=R84hRojItA1o9oA4x0nypbZEKJLDy+XSU7Hc8FTyRte2RG4PRQvzx+10ntMGaj7n+0v rYX/zUXA/vZu+63DKLrUNgKqyqKakzfX0+QvZwGZmO9byfNpXjKrFL9oK8YyJA1XgSn36 PJyg0S+9cNbqQmjbD1twbc0xZRSBKD8wL3k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1642121484144100001 Content-Type: text/plain; charset="utf-8" From: GuoMinJ REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2368 Remove the PcdConOutGopSupport, it is unnecessary any more. Remove All UGA Support in ConSplitterDxe component. Signed-off-by: Guomin Jiang Cc: Jian J Wang Cc: Liming Gao Cc: Zhichao Gao Cc: Ray Ni --- .../Console/ConSplitterDxe/ConSplitterDxe.inf | 17 +- .../Console/ConSplitterDxe/ConSplitter.h | 138 +----- .../Console/ConSplitterDxe/ConSplitter.c | 405 +++--------------- .../ConSplitterDxe/ConSplitterGraphics.c | 310 +------------- .../Console/ConSplitterDxe/ConSplitterDxe.uni | 12 +- 5 files changed, 80 insertions(+), 802 deletions(-) diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.i= nf b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf index 9aa1dade752a..c0c57193b04d 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf @@ -3,14 +3,9 @@ # # This driver acts as a virtual console, takes over the console I/O contro= l from selected # standard console devices, and transmits console I/O to related console d= evice drivers. -# Consplitter could install Graphics Output protocol and/or UGA Draw proto= col in system -# table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSuppor= t). It always -# consumes Graphics Output protocol which is produced by display device, a= nd consumes UGA Draw -# protocol which is produced by display device according to PcdUgaConsumeS= upport value. -# Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSup= port should be -# set to TRUE. +# It always consumes Graphics Output protocol which is produced by display= device # -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -92,14 +87,6 @@ [Protocols] ## SOMETIMES_PRODUCES ## SOMETIMES_CONSUMES gEfiGraphicsOutputProtocolGuid - ## SOMETIMES_PRODUCES - ## SOMETIMES_CONSUMES - gEfiUgaDrawProtocolGuid - -[FeaturePcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport ## CONSUMES - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport ## CONSUMES =20 [Pcd] ## SOMETIMES_PRODUCES diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h b/= MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h index a1fe74726058..ec74415a2fb1 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h @@ -1,7 +1,7 @@ /** @file Private data structures for the Console Splitter driver =20 -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -21,7 +21,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include =20 #include #include @@ -182,7 +181,6 @@ typedef struct { =20 typedef struct { EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - EFI_UGA_DRAW_PROTOCOL *UgaDraw; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut; } TEXT_OUT_AND_GOP_DATA; =20 @@ -195,16 +193,9 @@ typedef struct { EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL TextOut; EFI_SIMPLE_TEXT_OUTPUT_MODE TextOutMode; =20 - EFI_UGA_DRAW_PROTOCOL UgaDraw; - UINT32 UgaHorizontalResolution; - UINT32 UgaVerticalResolution; - UINT32 UgaColorDepth; - UINT32 UgaRefreshRate; - EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *GraphicsOutputModeBuffer; UINTN CurrentNumberOfGraphicsOutput; - UINTN CurrentNumberOfUgaDraw; =20 UINTN CurrentNumberOfConsoles; TEXT_OUT_AND_GOP_DATA *TextOutList; @@ -230,13 +221,6 @@ typedef struct { TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \ ) =20 -#define UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \ - CR ((a), \ - TEXT_OUT_SPLITTER_PRIVATE_DATA, \ - UgaDraw, \ - TEXT_OUT_SPLITTER_PRIVATE_DATA_SIGNATURE \ - ) - #define CONSOLE_CONTROL_SPLITTER_PRIVATE_DATA_FROM_THIS(a) \ CR ((a), \ TEXT_OUT_SPLITTER_PRIVATE_DATA, \ @@ -254,7 +238,7 @@ typedef struct { Installs driver module protocols and. Creates virtual device handles for= ConIn, ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex = protocol, Simple Pointer protocol, Absolute Pointer protocol on those virtual hand= lers. - Installs Graphics Output protocol and/or UGA Draw protocol if needed. + Installs Graphics Output protocol if needed. =20 @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. @param[in] SystemTable A pointer to the EFI System Table. @@ -1202,7 +1186,6 @@ ConSplitterSimplePointerDeleteDevice ( @param Private Text Out Splitter pointer. @param TextOut Simple Text Output protocol pointer. @param GraphicsOutput Graphics Output protocol pointer. - @param UgaDraw UGA Draw protocol pointer. =20 @retval EFI_SUCCESS Text Output Device added successfully. @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size. @@ -1212,8 +1195,7 @@ EFI_STATUS ConSplitterTextOutAddDevice ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut, - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput, - IN EFI_UGA_DRAW_PROTOCOL *UgaDraw + IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput ); =20 /** @@ -1848,119 +1830,7 @@ ConSplitterGraphicsOutputBlt ( IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, - IN UINTN Delta OPTIONAL - ); - -/** - Return the current video mode information. - - @param This The EFI_UGA_DRAW_PROTOCOL instance. - @param HorizontalResolution The size of video screen in pixels in the = X dimension. - @param VerticalResolution The size of video screen in pixels in the = Y dimension. - @param ColorDepth Number of bits per pixel, currently define= d to be 32. - @param RefreshRate The refresh rate of the monitor in Hertz. - - @retval EFI_SUCCESS Mode information returned. - @retval EFI_NOT_STARTED Video display is not initialized. Call Set= Mode () - @retval EFI_INVALID_PARAMETER One of the input args was NULL. - -**/ -EFI_STATUS -EFIAPI -ConSplitterUgaDrawGetMode ( - IN EFI_UGA_DRAW_PROTOCOL *This, - OUT UINT32 *HorizontalResolution, - OUT UINT32 *VerticalResolution, - OUT UINT32 *ColorDepth, - OUT UINT32 *RefreshRate - ); - -/** - Set the current video mode information. - - @param This The EFI_UGA_DRAW_PROTOCOL instance. - @param HorizontalResolution The size of video screen in pixels in the X= dimension. - @param VerticalResolution The size of video screen in pixels in the Y= dimension. - @param ColorDepth Number of bits per pixel, currently defined= to be 32. - @param RefreshRate The refresh rate of the monitor in Hertz. - - @retval EFI_SUCCESS Mode information returned. - @retval EFI_NOT_STARTED Video display is not initialized. Call SetM= ode () - @retval EFI_OUT_OF_RESOURCES Out of resources. - -**/ -EFI_STATUS -EFIAPI -ConSplitterUgaDrawSetMode ( - IN EFI_UGA_DRAW_PROTOCOL *This, - IN UINT32 HorizontalResolution, - IN UINT32 VerticalResolution, - IN UINT32 ColorDepth, - IN UINT32 RefreshRate - ); - -/** - Blt a rectangle of pixels on the graphics screen. - - The following table defines actions for BltOperations. - - EfiUgaVideoFill: - Write data from the BltBuffer pixel (SourceX, SourceY) - directly to every pixel of the video display rectangle - (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - Only one pixel will be used from the BltBuffer. Delta is NOT used. - EfiUgaVideoToBltBuffer: - Read data from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in - the BltBuffer rectangle (DestinationX, DestinationY ) - (DestinationX + Width, DestinationY + Height). If DestinationX or - DestinationY is not zero then Delta must be set to the length in bytes - of a row in the BltBuffer. - EfiUgaBltBufferToVideo: - Write data from the BltBuffer rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the - video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is - not zero then Delta must be set to the length in bytes of a row in the - BltBuffer. - EfiUgaVideoToVideo: - Copy from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) . - to the video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - The BltBuffer and Delta are not used in this mode. - - @param This Protocol instance pointer. - @param BltBuffer Buffer containing data to blit into video buffer.= This - buffer has a size of Width*Height*sizeof(EFI_UGA_= PIXEL) - @param BltOperation Operation to perform on BlitBuffer and video memo= ry - @param SourceX X coordinate of source for the BltBuffer. - @param SourceY Y coordinate of source for the BltBuffer. - @param DestinationX X coordinate of destination for the BltBuffer. - @param DestinationY Y coordinate of destination for the BltBuffer. - @param Width Width of rectangle in BltBuffer in pixels. - @param Height Hight of rectangle in BltBuffer in pixels. - @param Delta OPTIONAL - - @retval EFI_SUCCESS The Blt operation completed. - @retval EFI_INVALID_PARAMETER BltOperation is not valid. - @retval EFI_DEVICE_ERROR A hardware error occurred writting to the= video buffer. - -**/ -EFI_STATUS -EFIAPI -ConSplitterUgaDrawBlt ( - IN EFI_UGA_DRAW_PROTOCOL *This, - IN EFI_UGA_PIXEL *BltBuffer OPTIONAL, - IN EFI_UGA_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta OPTIONAL + IN UINTN Delta OPTIONAL ); =20 /** diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/= MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index 8b5e62e3a883..2eda16cf6f12 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -16,7 +16,7 @@ never removed. Such design ensures system function well during none cons= ole device situation. =20 -Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -107,15 +107,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_IN_SPLITTER_PRIVATE= _DATA mConIn =3D { FALSE }; =20 -// -// Uga Draw Protocol Private Data template -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UGA_DRAW_PROTOCOL mUgaDrawProtocolTempl= ate =3D { - ConSplitterUgaDrawGetMode, - ConSplitterUgaDrawSetMode, - ConSplitterUgaDrawBlt -}; - // // Graphics Output Protocol Private Data template // @@ -153,16 +144,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVAT= E_DATA mConOut =3D { FALSE, }, =20 - { - NULL, - NULL, - NULL - }, - 0, - 0, - 0, - 0, - { NULL, NULL, @@ -171,7 +152,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE= _DATA mConOut =3D { }, (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL, 0, - 0, =20 0, (TEXT_OUT_AND_GOP_DATA *)NULL, @@ -209,16 +189,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVAT= E_DATA mStdErr =3D { FALSE, }, =20 - { - NULL, - NULL, - NULL - }, - 0, - 0, - 0, - 0, - { NULL, NULL, @@ -227,7 +197,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED TEXT_OUT_SPLITTER_PRIVATE= _DATA mStdErr =3D { }, (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *)NULL, 0, - 0, =20 0, (TEXT_OUT_AND_GOP_DATA *)NULL, @@ -422,7 +391,7 @@ ToggleStateSyncReInitialization ( Installs driver module protocols and. Creates virtual device handles for= ConIn, ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex = protocol, Simple Pointer protocol, Absolute Pointer protocol on those virtual hand= lers. - Installs Graphics Output protocol and/or UGA Draw protocol if needed. + Installs Graphics Output protocol if need. =20 @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. @param[in] SystemTable A pointer to the EFI System Table. @@ -493,14 +462,6 @@ ConSplitterDriverEntry ( ); ASSERT_EFI_ERROR (Status); =20 - // - // Either Graphics Output protocol or UGA Draw protocol must be supporte= d. - // - ASSERT ( - FeaturePcdGet (PcdConOutGopSupport) || - FeaturePcdGet (PcdConOutUgaSupport) - ); - // // The driver creates virtual handles for ConIn, ConOut, StdErr. // The virtual handles will always exist even if no console exist in the @@ -757,13 +718,7 @@ ConSplitterTextOutConstructor ( // // Copy protocols template // - if (FeaturePcdGet (PcdConOutUgaSupport)) { - CopyMem (&ConOutPrivate->UgaDraw, &mUgaDrawProtocolTemplate, sizeof (E= FI_UGA_DRAW_PROTOCOL)); - } - - if (FeaturePcdGet (PcdConOutGopSupport)) { - CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTempl= ate, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL)); - } + CopyMem (&ConOutPrivate->GraphicsOutput, &mGraphicsOutputProtocolTemplat= e, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL)); =20 // // Initialize console output splitter's private data. @@ -806,56 +761,47 @@ ConSplitterTextOutConstructor ( ConOutPrivate->TextOutQueryData[0].Rows =3D 25; TextOutSetMode (ConOutPrivate, 0); =20 - if (FeaturePcdGet (PcdConOutUgaSupport)) { - // - // Setup the UgaDraw to 800 x 600 x 32 bits per pixel, 60Hz. - // - ConSplitterUgaDrawSetMode (&ConOutPrivate->UgaDraw, 800, 600, 32, 60); + // + // Setup resource for mode information in Graphics Output Protocol inter= face + // + if ((ConOutPrivate->GraphicsOutput.Mode =3D AllocateZeroPool (sizeof (EF= I_GRAPHICS_OUTPUT_PROTOCOL_MODE))) =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; } =20 - if (FeaturePcdGet (PcdConOutGopSupport)) { - // - // Setup resource for mode information in Graphics Output Protocol int= erface - // - if ((ConOutPrivate->GraphicsOutput.Mode =3D AllocateZeroPool (sizeof (= EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE))) =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } - - if ((ConOutPrivate->GraphicsOutput.Mode->Info =3D AllocateZeroPool (si= zeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } + if ((ConOutPrivate->GraphicsOutput.Mode->Info =3D AllocateZeroPool (size= of (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } =20 - // - // Setup the DevNullGraphicsOutput to 800 x 600 x 32 bits per pixel - // DevNull will be updated to user-defined mode after driver has start= ed. - // - if ((ConOutPrivate->GraphicsOutputModeBuffer =3D AllocateZeroPool (siz= eof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) =3D=3D NULL) { - return EFI_OUT_OF_RESOURCES; - } + // + // Setup the DevNullGraphicsOutput to 800 x 600 x 32 bits per pixel + // DevNull will be updated to user-defined mode after driver has started. + // + if ((ConOutPrivate->GraphicsOutputModeBuffer =3D AllocateZeroPool (sizeo= f (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION))) =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } =20 - Info =3D &ConOutPrivate->GraphicsOutputModeBuffe= r[0]; - Info->Version =3D 0; - Info->HorizontalResolution =3D 800; - Info->VerticalResolution =3D 600; - Info->PixelFormat =3D PixelBltOnly; - Info->PixelsPerScanLine =3D 800; - CopyMem (ConOutPrivate->GraphicsOutput.Mode->Info, Info, sizeof (EFI_G= RAPHICS_OUTPUT_MODE_INFORMATION)); - ConOutPrivate->GraphicsOutput.Mode->SizeOfInfo =3D sizeof (EFI_GRAPHIC= S_OUTPUT_MODE_INFORMATION); + Info =3D &ConOutPrivate->GraphicsOutputModeBuffer[= 0]; + Info->Version =3D 0; + Info->HorizontalResolution =3D 800; + Info->VerticalResolution =3D 600; + Info->PixelFormat =3D PixelBltOnly; + Info->PixelsPerScanLine =3D 800; + CopyMem (ConOutPrivate->GraphicsOutput.Mode->Info, Info, sizeof (EFI_GRA= PHICS_OUTPUT_MODE_INFORMATION)); + ConOutPrivate->GraphicsOutput.Mode->SizeOfInfo =3D sizeof (EFI_GRAPHICS_= OUTPUT_MODE_INFORMATION); =20 - // - // Initialize the following items, theset items remain unchanged in Gr= aphicsOutput->SetMode() - // GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBuffe= rSize - // - ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase =3D (EFI_PHYSICAL_= ADDRESS)(UINTN)NULL; - ConOutPrivate->GraphicsOutput.Mode->FrameBufferSize =3D 0; + // + // Initialize the following items, theset items remain unchanged in Grap= hicsOutput->SetMode() + // GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBufferS= ize + // + ConOutPrivate->GraphicsOutput.Mode->FrameBufferBase =3D (EFI_PHYSICAL_AD= DRESS)(UINTN)NULL; + ConOutPrivate->GraphicsOutput.Mode->FrameBufferSize =3D 0; =20 - ConOutPrivate->GraphicsOutput.Mode->MaxMode =3D 1; - // - // Initial current mode to unknown state, and then set to mode 0 - // - ConOutPrivate->GraphicsOutput.Mode->Mode =3D 0xffff; - ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput,= 0); - } + ConOutPrivate->GraphicsOutput.Mode->MaxMode =3D 1; + // + // Initial current mode to unknown state, and then set to mode 0 + // + ConOutPrivate->GraphicsOutput.Mode->Mode =3D 0xffff; + ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0= ); =20 return EFI_SUCCESS; } @@ -1332,12 +1278,9 @@ ConSplitterConOutDriverBindingStart ( IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) { - EFI_STATUS Status; - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut; - EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - EFI_UGA_DRAW_PROTOCOL *UgaDraw; - UINTN SizeOfInfo; - EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; + EFI_STATUS Status; + EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut; + EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; =20 // // Start ConSplitter on ControllerHandle, and create the virtual @@ -1356,7 +1299,6 @@ ConSplitterConOutDriverBindingStart ( } =20 GraphicsOutput =3D NULL; - UgaDraw =3D NULL; // // Try to Open Graphics Output protocol // @@ -1369,20 +1311,6 @@ ConSplitterConOutDriverBindingStart ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); =20 - if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) { - // - // Open UGA DRAW protocol - // - gBS->OpenProtocol ( - ControllerHandle, - &gEfiUgaDrawProtocolGuid, - (VOID **)&UgaDraw, - This->DriverBindingHandle, - mConOut.VirtualHandle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - } - // // When new console device is added, the new mode will be set later, // so put current mode back to init state. @@ -1393,38 +1321,9 @@ ConSplitterConOutDriverBindingStart ( // If both ConOut and StdErr incorporate the same Text Out device, // their MaxMode and QueryData should be the intersection of both. // - Status =3D ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutpu= t, UgaDraw); + Status =3D ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutpu= t); ConSplitterTextOutSetAttribute (&mConOut.TextOut, EFI_TEXT_ATTR (EFI_LIG= HTGRAY, EFI_BLACK)); =20 - if (FeaturePcdGet (PcdConOutUgaSupport)) { - // - // Get the UGA mode data of ConOut from the current mode - // - if (GraphicsOutput !=3D NULL) { - Status =3D GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput= ->Mode->Mode, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { - return Status; - } - - ASSERT (SizeOfInfo <=3D sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION= )); - - mConOut.UgaHorizontalResolution =3D Info->HorizontalResolution; - mConOut.UgaVerticalResolution =3D Info->VerticalResolution; - mConOut.UgaColorDepth =3D 32; - mConOut.UgaRefreshRate =3D 60; - - FreePool (Info); - } else if (UgaDraw !=3D NULL) { - Status =3D UgaDraw->GetMode ( - UgaDraw, - &mConOut.UgaHorizontalResolution, - &mConOut.UgaVerticalResolution, - &mConOut.UgaColorDepth, - &mConOut.UgaRefreshRate - ); - } - } - return Status; } =20 @@ -1477,7 +1376,7 @@ ConSplitterStdErrDriverBindingStart ( // If both ConOut and StdErr incorporate the same Text Out device, // their MaxMode and QueryData should be the intersection of both. // - Status =3D ConSplitterTextOutAddDevice (&mStdErr, TextOut, NULL, NULL); + Status =3D ConSplitterTextOutAddDevice (&mStdErr, TextOut, NULL); ConSplitterTextOutSetAttribute (&mStdErr.TextOut, EFI_TEXT_ATTR (EFI_LIG= HTGRAY, EFI_BLACK)); =20 return Status; @@ -2737,7 +2636,6 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr ( =20 @param Private Text Out Splitter pointer. @param GraphicsOutput Graphics Output protocol pointer. - @param UgaDraw UGA Draw protocol pointer. =20 @retval EFI_SUCCESS Output mode added successfully. @retval other Failed to add output mode. @@ -2746,8 +2644,7 @@ ConSplitterGetIntersectionBetweenConOutAndStrErr ( EFI_STATUS ConSplitterAddGraphicsOutputMode ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput, - IN EFI_UGA_DRAW_PROTOCOL *UgaDraw + IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput ) { EFI_STATUS Status; @@ -2762,12 +2659,8 @@ ConSplitterAddGraphicsOutputMode ( UINTN NumberIndex; BOOLEAN Match; BOOLEAN AlreadyExist; - UINT32 UgaHorizontalResolution; - UINT32 UgaVerticalResolution; - UINT32 UgaColorDepth; - UINT32 UgaRefreshRate; =20 - ASSERT (GraphicsOutput !=3D NULL || UgaDraw !=3D NULL); + ASSERT (GraphicsOutput !=3D NULL); =20 CurrentGraphicsOutputMode =3D Private->GraphicsOutput.Mode; =20 @@ -2775,15 +2668,6 @@ ConSplitterAddGraphicsOutputMode ( CurrentIndex =3D 0; Status =3D EFI_SUCCESS; =20 - if (Private->CurrentNumberOfUgaDraw !=3D 0) { - // - // If any UGA device has already been added, then there is no need to - // calculate intersection of display mode of different GOP/UGA device, - // since only one display mode will be exported (i.e. user-defined mod= e) - // - goto Done; - } - if (GraphicsOutput !=3D NULL) { if (Private->CurrentNumberOfGraphicsOutput =3D=3D 0) { // @@ -2937,51 +2821,12 @@ ConSplitterAddGraphicsOutputMode ( } } } - } else if (UgaDraw !=3D NULL) { - // - // Graphics console driver can ensure the same mode for all GOP devices - // so we can get the current mode from this video device - // - UgaDraw->GetMode ( - UgaDraw, - &UgaHorizontalResolution, - &UgaVerticalResolution, - &UgaColorDepth, - &UgaRefreshRate - ); - - CurrentGraphicsOutputMode->MaxMode =3D 1; - Info =3D CurrentGraphicsOutputMo= de->Info; - Info->Version =3D 0; - Info->HorizontalResolution =3D UgaHorizontalResolution; - Info->VerticalResolution =3D UgaVerticalResolution; - Info->PixelFormat =3D PixelBltOnly; - Info->PixelsPerScanLine =3D UgaHorizontalResolution; - CurrentGraphicsOutputMode->SizeOfInfo =3D sizeof (EFI_GRAPHICS_OU= TPUT_MODE_INFORMATION); - CurrentGraphicsOutputMode->FrameBufferBase =3D (EFI_PHYSICAL_ADDRESS)(= UINTN)NULL; - CurrentGraphicsOutputMode->FrameBufferSize =3D 0; - - // - // Update the private mode buffer - // - CopyMem (&Private->GraphicsOutputModeBuffer[0], Info, sizeof (EFI_GRAP= HICS_OUTPUT_MODE_INFORMATION)); - - // - // Only mode 0 is available to be set - // - CurrentIndex =3D 0; } =20 -Done: - if (GraphicsOutput !=3D NULL) { Private->CurrentNumberOfGraphicsOutput++; } =20 - if (UgaDraw !=3D NULL) { - Private->CurrentNumberOfUgaDraw++; - } - // // Force GraphicsOutput mode to be set, // @@ -3130,7 +2975,6 @@ ConsplitterSetConsoleOutMode ( @param Private Text Out Splitter pointer. @param TextOut Simple Text Output protocol pointer. @param GraphicsOutput Graphics Output protocol pointer. - @param UgaDraw UGA Draw protocol pointer. =20 @retval EFI_SUCCESS Text Output Device added successfully. @retval EFI_OUT_OF_RESOURCES Could not grow the buffer size. @@ -3140,21 +2984,14 @@ EFI_STATUS ConSplitterTextOutAddDevice ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOut, - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput, - IN EFI_UGA_DRAW_PROTOCOL *UgaDraw + IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput ) { - EFI_STATUS Status; - UINTN CurrentNumOfConsoles; - INT32 MaxMode; - UINT32 UgaHorizontalResolution; - UINT32 UgaVerticalResolution; - UINT32 UgaColorDepth; - UINT32 UgaRefreshRate; - TEXT_OUT_AND_GOP_DATA *TextAndGop; - UINTN SizeOfInfo; - EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; - EFI_STATUS DeviceStatus; + EFI_STATUS Status; + UINTN CurrentNumOfConsoles; + INT32 MaxMode; + TEXT_OUT_AND_GOP_DATA *TextAndGop; + EFI_STATUS DeviceStatus; =20 Status =3D EFI_SUCCESS; CurrentNumOfConsoles =3D Private->CurrentNumberOfConsoles; @@ -3186,7 +3023,6 @@ ConSplitterTextOutAddDevice ( =20 TextAndGop->TextOut =3D TextOut; TextAndGop->GraphicsOutput =3D GraphicsOutput; - TextAndGop->UgaDraw =3D UgaDraw; =20 if (CurrentNumOfConsoles =3D=3D 0) { // @@ -3215,101 +3051,21 @@ ConSplitterTextOutAddDevice ( // // This device display mode will be added into Graphics Ouput modes. // - if ((GraphicsOutput !=3D NULL) || (UgaDraw !=3D NULL)) { - DeviceStatus =3D ConSplitterAddGraphicsOutputMode (Private, GraphicsOu= tput, UgaDraw); + if (GraphicsOutput !=3D NULL) { + DeviceStatus =3D ConSplitterAddGraphicsOutputMode (Private, GraphicsOu= tput); } =20 - if (FeaturePcdGet (PcdConOutUgaSupport)) { + if (!EFI_ERROR (DeviceStatus)) { // - // If UGA is produced by Consplitter + // Graphics Output Protocol is installed + // on virtual handle. // - if (GraphicsOutput !=3D NULL) { - Status =3D GraphicsOutput->QueryMode (GraphicsOutput, GraphicsOutput= ->Mode->Mode, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { - return Status; - } - - ASSERT (SizeOfInfo <=3D sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION= )); - - UgaHorizontalResolution =3D Info->HorizontalResolution; - UgaVerticalResolution =3D Info->VerticalResolution; - - FreePool (Info); - } else if (UgaDraw !=3D NULL) { - Status =3D UgaDraw->GetMode ( - UgaDraw, - &UgaHorizontalResolution, - &UgaVerticalResolution, - &UgaColorDepth, - &UgaRefreshRate - ); - if (!EFI_ERROR (Status) && EFI_ERROR (DeviceStatus)) { - // - // if GetMode is successfully and UGA device hasn't been set, set = it - // - Status =3D ConSplitterUgaDrawSetMode ( - &Private->UgaDraw, - UgaHorizontalResolution, - UgaVerticalResolution, - UgaColorDepth, - UgaRefreshRate - ); - } - - // - // If GetMode/SetMode is failed, set to 800x600 mode - // - if (EFI_ERROR (Status)) { - Status =3D ConSplitterUgaDrawSetMode ( - &Private->UgaDraw, - 800, - 600, - 32, - 60 - ); - } - } - } - - if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) && - ((Private->CurrentNumberOfGraphicsOutput + Private->CurrentNumberOfU= gaDraw) =3D=3D 1)) - { - if (!FeaturePcdGet (PcdConOutGopSupport)) { - // - // If Graphics Outpurt protocol not supported, UGA Draw protocol is = installed - // on the virtual handle. - // - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &mConOut.VirtualHandle, - &gEfiUgaDrawProtocolGuid, - &mConOut.UgaDraw, - NULL - ); - } else if (!FeaturePcdGet (PcdConOutUgaSupport)) { - // - // If UGA Draw protocol not supported, Graphics Output Protocol is i= nstalled - // on virtual handle. - // - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &mConOut.VirtualHandle, - &gEfiGraphicsOutputProtocolGuid, - &mConOut.GraphicsOutput, - NULL - ); - } else { - // - // Boot Graphics Output protocol and UGA Draw protocol are supported, - // both they will be installed on virtual handle. - // - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &mConOut.VirtualHandle, - &gEfiGraphicsOutputProtocolGuid, - &mConOut.GraphicsOutput, - &gEfiUgaDrawProtocolGuid, - &mConOut.UgaDraw, - NULL - ); - } + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &mConOut.VirtualHandle, + &gEfiGraphicsOutputProtocolGuid, + &mConOut.GraphicsOutput, + NULL + ); } =20 // @@ -3353,10 +3109,6 @@ ConSplitterTextOutDeleteDevice ( TextOutList =3D Private->TextOutList; while (Index >=3D 0) { if (TextOutList->TextOut =3D=3D TextOut) { - if (TextOutList->UgaDraw !=3D NULL) { - Private->CurrentNumberOfUgaDraw--; - } - if (TextOutList->GraphicsOutput !=3D NULL) { Private->CurrentNumberOfGraphicsOutput--; } @@ -3377,33 +3129,16 @@ ConSplitterTextOutDeleteDevice ( return EFI_NOT_FOUND; } =20 - if ((Private->CurrentNumberOfGraphicsOutput =3D=3D 0) && (Private->Curre= ntNumberOfUgaDraw =3D=3D 0)) { + if (Private->CurrentNumberOfGraphicsOutput =3D=3D 0) { // - // If there is not any physical GOP and UGA device in system, - // Consplitter GOP or UGA protocol will be uninstalled + // If there is not any physical GOP in system, + // Consplitter GOP protocol will be uninstalled // - if (!FeaturePcdGet (PcdConOutGopSupport)) { - Status =3D gBS->UninstallProtocolInterface ( - Private->VirtualHandle, - &gEfiUgaDrawProtocolGuid, - &Private->UgaDraw - ); - } else if (!FeaturePcdGet (PcdConOutUgaSupport)) { - Status =3D gBS->UninstallProtocolInterface ( - Private->VirtualHandle, - &gEfiGraphicsOutputProtocolGuid, - &Private->GraphicsOutput - ); - } else { - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - Private->VirtualHandle, - &gEfiUgaDrawProtocolGuid, - &Private->UgaDraw, - &gEfiGraphicsOutputProtocolGuid, - &Private->GraphicsOutput, - NULL - ); - } + Status =3D gBS->UninstallProtocolInterface ( + Private->VirtualHandle, + &gEfiGraphicsOutputProtocolGuid, + &Private->GraphicsOutput + ); } =20 if (CurrentNumOfConsoles =3D=3D 0) { diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraph= ics.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c index 64ad567a6d7d..a37a6b0e4bd8 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c @@ -1,7 +1,7 @@ /** @file Support for Graphics output spliter. =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 =20 @@ -117,7 +117,6 @@ ConSplitterGraphicsOutputSetMode ( UINTN NumberIndex; UINTN SizeOfInfo; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; - EFI_UGA_DRAW_PROTOCOL *UgaDraw; =20 if (ModeNumber >=3D This->Mode->MaxMode) { return EFI_UNSUPPORTED; @@ -157,20 +156,6 @@ ConSplitterGraphicsOutputSetMode ( if (EFI_ERROR (Status)) { ReturnStatus =3D Status; } - } else if (FeaturePcdGet (PcdUgaConsumeSupport)) { - UgaDraw =3D Private->TextOutList[Index].UgaDraw; - if (UgaDraw !=3D NULL) { - Status =3D UgaDraw->SetMode ( - UgaDraw, - Mode->HorizontalResolution, - Mode->VerticalResolution, - 32, - 60 - ); - if (EFI_ERROR (Status)) { - ReturnStatus =3D Status; - } - } } } =20 @@ -261,7 +246,6 @@ ConSplitterGraphicsOutputBlt ( TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; UINTN Index; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - EFI_UGA_DRAW_PROTOCOL *UgaDraw; =20 if ((This =3D=3D NULL) || (((UINTN)BltOperation) >=3D EfiGraphicsOutputB= ltOperationMax)) { return EFI_INVALID_PARAMETER; @@ -298,298 +282,6 @@ ConSplitterGraphicsOutputBlt ( return EFI_SUCCESS; } } - - UgaDraw =3D Private->TextOutList[Index].UgaDraw; - if ((UgaDraw !=3D NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) { - Status =3D UgaDraw->Blt ( - UgaDraw, - (EFI_UGA_PIXEL *)BltBuffer, - (EFI_UGA_BLT_OPERATION)BltOperation, - SourceX, - SourceY, - DestinationX, - DestinationY, - Width, - Height, - Delta - ); - if (EFI_ERROR (Status)) { - ReturnStatus =3D Status; - } else if (BltOperation =3D=3D EfiBltVideoToBltBuffer) { - // - // Only need to read the data into buffer one time - // - return EFI_SUCCESS; - } - } - } - - return ReturnStatus; -} - -/** - Return the current video mode information. - - @param This The EFI_UGA_DRAW_PROTOCOL instance. - @param HorizontalResolution The size of video screen in pixels in the = X dimension. - @param VerticalResolution The size of video screen in pixels in the = Y dimension. - @param ColorDepth Number of bits per pixel, currently define= d to be 32. - @param RefreshRate The refresh rate of the monitor in Hertz. - - @retval EFI_SUCCESS Mode information returned. - @retval EFI_NOT_STARTED Video display is not initialized. Call Set= Mode () - @retval EFI_INVALID_PARAMETER One of the input args was NULL. - -**/ -EFI_STATUS -EFIAPI -ConSplitterUgaDrawGetMode ( - IN EFI_UGA_DRAW_PROTOCOL *This, - OUT UINT32 *HorizontalResolution, - OUT UINT32 *VerticalResolution, - OUT UINT32 *ColorDepth, - OUT UINT32 *RefreshRate - ) -{ - TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; - - if ((HorizontalResolution =3D=3D NULL) || - (VerticalResolution =3D=3D NULL) || - (RefreshRate =3D=3D NULL) || - (ColorDepth =3D=3D NULL)) - { - return EFI_INVALID_PARAMETER; - } - - // - // retrieve private data - // - Private =3D UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This); - - *HorizontalResolution =3D Private->UgaHorizontalResolution; - *VerticalResolution =3D Private->UgaVerticalResolution; - *ColorDepth =3D Private->UgaColorDepth; - *RefreshRate =3D Private->UgaRefreshRate; - - return EFI_SUCCESS; -} - -/** - Set the current video mode information. - - @param This The EFI_UGA_DRAW_PROTOCOL instance. - @param HorizontalResolution The size of video screen in pixels in the X= dimension. - @param VerticalResolution The size of video screen in pixels in the Y= dimension. - @param ColorDepth Number of bits per pixel, currently defined= to be 32. - @param RefreshRate The refresh rate of the monitor in Hertz. - - @retval EFI_SUCCESS Mode information returned. - @retval EFI_NOT_STARTED Video display is not initialized. Call SetM= ode () - @retval EFI_OUT_OF_RESOURCES Out of resources. - -**/ -EFI_STATUS -EFIAPI -ConSplitterUgaDrawSetMode ( - IN EFI_UGA_DRAW_PROTOCOL *This, - IN UINT32 HorizontalResolution, - IN UINT32 VerticalResolution, - IN UINT32 ColorDepth, - IN UINT32 RefreshRate - ) -{ - EFI_STATUS Status; - TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; - UINTN Index; - EFI_STATUS ReturnStatus; - EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - UINTN NumberIndex; - UINTN SizeOfInfo; - EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; - EFI_UGA_DRAW_PROTOCOL *UgaDraw; - - Private =3D UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This); - - ReturnStatus =3D EFI_SUCCESS; - - // - // Update the Mode data - // - Private->UgaHorizontalResolution =3D HorizontalResolution; - Private->UgaVerticalResolution =3D VerticalResolution; - Private->UgaColorDepth =3D ColorDepth; - Private->UgaRefreshRate =3D RefreshRate; - - // - // return the worst status met - // - for (Index =3D 0; Index < Private->CurrentNumberOfConsoles; Index++) { - GraphicsOutput =3D Private->TextOutList[Index].GraphicsOutput; - if (GraphicsOutput !=3D NULL) { - // - // Find corresponding ModeNumber of this GraphicsOutput instance - // - for (NumberIndex =3D 0; NumberIndex < GraphicsOutput->Mode->MaxMode;= NumberIndex++) { - Status =3D GraphicsOutput->QueryMode (GraphicsOutput, (UINT32)Numb= erIndex, &SizeOfInfo, &Info); - if (EFI_ERROR (Status)) { - return Status; - } - - if ((Info->HorizontalResolution =3D=3D HorizontalResolution) && (I= nfo->VerticalResolution =3D=3D VerticalResolution)) { - FreePool (Info); - break; - } - - FreePool (Info); - } - - Status =3D GraphicsOutput->SetMode (GraphicsOutput, (UINT32)NumberIn= dex); - if (EFI_ERROR (Status)) { - ReturnStatus =3D Status; - } - } else if (FeaturePcdGet (PcdUgaConsumeSupport)) { - UgaDraw =3D Private->TextOutList[Index].UgaDraw; - if (UgaDraw !=3D NULL) { - Status =3D UgaDraw->SetMode ( - UgaDraw, - HorizontalResolution, - VerticalResolution, - ColorDepth, - RefreshRate - ); - if (EFI_ERROR (Status)) { - ReturnStatus =3D Status; - } - } - } - } - - return ReturnStatus; -} - -/** - Blt a rectangle of pixels on the graphics screen. - - The following table defines actions for BltOperations. - - EfiUgaVideoFill: - Write data from the BltBuffer pixel (SourceX, SourceY) - directly to every pixel of the video display rectangle - (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - Only one pixel will be used from the BltBuffer. Delta is NOT used. - EfiUgaVideoToBltBuffer: - Read data from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in - the BltBuffer rectangle (DestinationX, DestinationY ) - (DestinationX + Width, DestinationY + Height). If DestinationX or - DestinationY is not zero then Delta must be set to the length in bytes - of a row in the BltBuffer. - EfiUgaBltBufferToVideo: - Write data from the BltBuffer rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the - video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is - not zero then Delta must be set to the length in bytes of a row in the - BltBuffer. - EfiUgaVideoToVideo: - Copy from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) . - to the video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - The BltBuffer and Delta are not used in this mode. - - @param This Protocol instance pointer. - @param BltBuffer Buffer containing data to blit into video buffer.= This - buffer has a size of Width*Height*sizeof(EFI_UGA_= PIXEL) - @param BltOperation Operation to perform on BlitBuffer and video memo= ry - @param SourceX X coordinate of source for the BltBuffer. - @param SourceY Y coordinate of source for the BltBuffer. - @param DestinationX X coordinate of destination for the BltBuffer. - @param DestinationY Y coordinate of destination for the BltBuffer. - @param Width Width of rectangle in BltBuffer in pixels. - @param Height Hight of rectangle in BltBuffer in pixels. - @param Delta OPTIONAL - - @retval EFI_SUCCESS The Blt operation completed. - @retval EFI_INVALID_PARAMETER BltOperation is not valid. - @retval EFI_DEVICE_ERROR A hardware error occurred writting to the= video buffer. - -**/ -EFI_STATUS -EFIAPI -ConSplitterUgaDrawBlt ( - IN EFI_UGA_DRAW_PROTOCOL *This, - IN EFI_UGA_PIXEL *BltBuffer OPTIONAL, - IN EFI_UGA_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta OPTIONAL - ) -{ - EFI_STATUS Status; - TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; - UINTN Index; - EFI_STATUS ReturnStatus; - EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - - Private =3D UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This); - - ReturnStatus =3D EFI_SUCCESS; - // - // return the worst status met - // - for (Index =3D 0; Index < Private->CurrentNumberOfConsoles; Index++) { - GraphicsOutput =3D Private->TextOutList[Index].GraphicsOutput; - if (GraphicsOutput !=3D NULL) { - Status =3D GraphicsOutput->Blt ( - GraphicsOutput, - (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)BltBuffe= r, - (EFI_GRAPHICS_OUTPUT_BLT_OPERATION)BltOpe= ration, - SourceX, - SourceY, - DestinationX, - DestinationY, - Width, - Height, - Delta - ); - if (EFI_ERROR (Status)) { - ReturnStatus =3D Status; - } else if (BltOperation =3D=3D EfiUgaVideoToBltBuffer) { - // - // Only need to read the data into buffer one time - // - return EFI_SUCCESS; - } - } - - if ((Private->TextOutList[Index].UgaDraw !=3D NULL) && FeaturePcdGet (= PcdUgaConsumeSupport)) { - Status =3D Private->TextOutList[Index].UgaDraw->Blt ( - Private->TextOutList= [Index].UgaDraw, - BltBuffer, - BltOperation, - SourceX, - SourceY, - DestinationX, - DestinationY, - Width, - Height, - Delta - ); - if (EFI_ERROR (Status)) { - ReturnStatus =3D Status; - } else if (BltOperation =3D=3D EfiUgaVideoToBltBuffer) { - // - // Only need to read the data into buffer one time - // - return EFI_SUCCESS; - } - } } =20 return ReturnStatus; diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.u= ni b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni index 13c25b2a4ffc..f1324e93a5f2 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.uni @@ -3,14 +3,9 @@ // // This driver acts as a virtual console, takes over the console I/O contr= ol from selected // standard console devices, and transmits console I/O to related console = device drivers. -// Consplitter could install Graphics Output protocol and/or UGA Draw prot= ocol in system -// table according PCD settings(PcdConOutGopSupport, and PcdConOutUgaSuppo= rt). It always -// consumes Graphics Output protocol which is produced by display device, = and consumes UGA Draw -// protocol which is produced by display device according to PcdUgaConsume= Support value. -// Note: If only UGA Draw protocol is installed in system, PcdUgaConsumeSu= pport should be -// set to TRUE. +// It always consumes Graphics Output protocol which is produced by displa= y device // -// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+// Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
// // SPDX-License-Identifier: BSD-2-Clause-Patent // @@ -19,5 +14,4 @@ =20 #string STR_MODULE_ABSTRACT #language en-US "Provides multi co= nsole support" =20 -#string STR_MODULE_DESCRIPTION #language en-US "This driver acts = as a virtual console, takes over the console I/O control from selected stan= dard console devices, and transmits console I/O to related console device d= rivers. Consplitter could install Graphics Output protocol and/or UGA Draw = protocol in system table according PCD settings(PcdConOutGopSupport, and Pc= dConOutUgaSupport). It always consumes Graphics Output protocol, which is p= roduced by display device, and consumes UGA Draw protocol, which is produce= d by display device according to PcdUgaConsumeSupport value. Note: If only = UGA Draw protocol is installed in system, PcdUgaConsumeSupport should be se= t to TRUE." - +#string STR_MODULE_DESCRIPTION #language en-US "This driver acts = as a virtual console, takes over the console I/O control from selected stan= dard console devices, and transmits console I/O to related console device d= rivers. It always consumes Graphics Output protocol, which is produced by d= isplay device." --=20 2.30.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85684): https://edk2.groups.io/g/devel/message/85684 Mute This Topic: https://groups.io/mt/88411252/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-