Skip to content

Commit

Permalink
Create separate FrameBufferMemDrawLib inf for PEI and DXE (#373)
Browse files Browse the repository at this point in the history
## Description

Splitting inf's for PEI and DXE FrameBufferMemDrawLib to support
building for 64bit PEIM.

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [x] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
Remove old inf path and add the separate PEI and DXE inf to DSC files.
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Verified platform packages consuming the library can build fine and
FrameBufferDraw works as expected for PEI and DXE graphics.

## Integration Instructions

Update dsc file to remove the old inf path and include separate PEI and
DXE infs.
  • Loading branch information
srilathasridharan authored Nov 29, 2023
1 parent c2e0410 commit 7309048
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include <Base.h>
#include <Uefi.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/GraphicsOutput.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/FrameBufferMemDrawLib.h>
#include <Library/FrameBufferBltLib.h>
Expand Down Expand Up @@ -200,6 +197,8 @@ MemFillOnFrameBuffer (
EFI_STATUS
EFIAPI
FrameBufferMemDrawLibDestructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
// Free the buffer if we no longer need it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include <Base.h>
#include <Uefi.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/GraphicsOutput.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/FrameBufferMemDrawLib.h>
#include <Library/FrameBufferBltLib.h>

STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL *mGraphicsOutput = NULL;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

[Defines]
INF_VERSION = 0x00010017
BASE_NAME = FrameBufferMemDrawLib
BASE_NAME = FrameBufferMemDrawLibDxe
FILE_GUID = 75561EAF-4537-4FA8-B65B-40E652602A8B
VERSION_STRING = 1.0
MODULE_TYPE = BASE
MODULE_TYPE = DXE_DRIVER
LIBRARY_CLASS = FrameBufferMemDrawLib
DESTRUCTOR = FrameBufferMemDrawLibDestructor

Expand All @@ -21,6 +21,7 @@
DebugLib
FrameBufferBltLib
MemoryAllocationLib
UefiBootServicesTableLib

[Packages]
MdePkg/MdePkg.dec
Expand All @@ -29,30 +30,11 @@

[Sources]
FrameBufferMemDrawLib.c

##
## IA32 Version
##
[Sources.IA32]
FrameBufferMemDrawLibPeim.c

[LibraryClasses.IA32]
PeiServicesLib

[Ppis.IA32]
gEfiPeiGraphicsPpiGuid

[Depex.IA32]
gEfiPeiGraphicsPpiGuid ## CONSUMES

##
## X64, AARCH64 Versions
##
[Sources.X64, Sources.AARCH64]
FrameBufferMemDrawLibDxe.c
FrameBufferMemDrawLib.h

[LibraryClasses.X64, LibraryClasses.X64]
UefiBootServicesTableLib

[Protocols.X64, Protocols.AARCH64]
[Protocols]
gEfiGraphicsOutputProtocolGuid ## SOMETIMES_CONSUMES

[Depex]
TRUE
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

## @file
# A library for drawing directly to the FrameBuffer memory region
#
# Copyright (C) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##


[Defines]
INF_VERSION = 0x00010017
BASE_NAME = FrameBufferMemDrawLibPei
FILE_GUID = 23E999E3-B231-4076-8791-DA5151BB3DC4
VERSION_STRING = 1.0
MODULE_TYPE = PEIM
LIBRARY_CLASS = FrameBufferMemDrawLib

[LibraryClasses]
DebugLib
FrameBufferBltLib
MemoryAllocationLib
PeiServicesLib

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
MsGraphicsPkg/MsGraphicsPkg.dec

[Sources]
FrameBufferMemDrawLib.c
FrameBufferMemDrawLibPeim.c
FrameBufferMemDrawLib.h

[Ppis]
gEfiPeiGraphicsPpiGuid

[Depex]
gEfiPeiGraphicsPpiGuid
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include <Ppi/Graphics.h>

#include <Protocol/GraphicsOutput.h>

#include <Library/DebugLib.h>
#include <Library/PeiServicesLib.h>

Expand Down
3 changes: 2 additions & 1 deletion MsGraphicsPkg/MsGraphicsPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
MsGraphicsPkg/Library/MsUiThemeLib/Dxe/MsUiThemeLib.inf
MsGraphicsPkg/Library/MsUiThemeLib/Pei/MsUiThemeLib.inf
MsGraphicsPkg/Library/MsColorTableLib/MsColorTableLib.inf
MsGraphicsPkg/Library/FrameBufferMemDrawLib/FrameBufferMemDrawLib.inf
MsGraphicsPkg/Library/FrameBufferMemDrawLib/FrameBufferMemDrawLibDxe.inf
MsGraphicsPkg/Library/SwmDialogsLib/SwmDialogs.inf
MsGraphicsPkg/Library/BootGraphicsLib/BootGraphicsLib.inf
MsGraphicsPkg/Library/BootGraphicsLibNull/BootGraphicsLib.inf
Expand All @@ -134,6 +134,7 @@
MsGraphicsPkg/MsEarlyGraphics/Pei/MsEarlyGraphics.inf
MsGraphicsPkg/MsUiTheme/Pei/MsUiThemePpi.inf
MsGraphicsPkg/Library/MsEarlyGraphicsLibNull/Pei/MsEarlyGraphicsLibNull.inf
MsGraphicsPkg/Library/FrameBufferMemDrawLib/FrameBufferMemDrawLibPei.inf

[Components.X64, Components.AARCH64]
MsGraphicsPkg/Library/MsEarlyGraphicsLibNull/Dxe/MsEarlyGraphicsLibNull.inf
Expand Down

0 comments on commit 7309048

Please sign in to comment.