OpenCore
1.0.4
OpenCore Bootloader
|
#include "OcConsoleLibInternal.h"
#include <Base.h>
#include <Uefi/UefiBaseType.h>
#include <IndustryStandard/ProcessorInfo.h>
#include <IndustryStandard/VirtualMemory.h>
#include <Library/BaseLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/MtrrLib.h>
#include <Library/OcMemoryLib.h>
#include <Library/OcStringLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
Go to the source code of this file.
Macros | |
#define | PAT_INDEX_TO_CHANGE 7 |
Functions | |
EFI_STATUS | OcGopModeBytesPerPixel (IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode, OUT UINTN *BytesPerPixel) |
EFI_STATUS | OcGopModeSafeFrameBufferSize (IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode, OUT UINTN *FrameBufferSize) |
STATIC EFI_STATUS | WriteCombineGop (EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop, BOOLEAN SetPatWC) |
EFI_STATUS | OcSetGopBurstMode (VOID) |
GOP buffer and pixel size utility methods, and GOP burst mode caching code.
Copyright (C) 2023, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Definition in file GopUtils.c.
#define PAT_INDEX_TO_CHANGE 7 |
Definition at line 26 of file GopUtils.c.
EFI_STATUS OcGopModeBytesPerPixel | ( | IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE * | Mode, |
OUT UINTN * | BytesPerPixel ) |
Return the bytes per pixel for the current GOP mode.
GOP mode information does not include anything directly containing the bytes per pixel, but there is a defined algorithm for working out this size, even for non-standard pixel masks, and also a defined situation (PixelBltOnly pixel format) where there is no such size.
[in] | Mode | GOP mode. |
[in] | BytesPerPixel | Bytes per pixel for the mode in use. |
EFI_SUCCESS | Success. |
EFI_UNSUPPORTED | There is no frame buffer. |
EFI_INVALID_PARAMETER | Mode info parameters are outside valid ranges. |
Definition at line 29 of file GopUtils.c.
EFI_STATUS OcGopModeSafeFrameBufferSize | ( | IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE * | Mode, |
OUT UINTN * | FrameBufferSize ) |
Return the frame buffer size in use for the current GOP mode, even where Gop->Mode->FrameBufferSize misreports this.
Occasional GOP implementations report a frame buffer size far larger (e.g. ~100x) than required for the actual mode in use.
[in] | Mode | GOP mode. |
[in] | FrameBufferSize | Frame buffer size in use. |
EFI_SUCCESS | Success. |
EFI_UNSUPPORTED | There is no frame buffer. |
EFI_INVALID_PARAMETER | Size parameters are outside valid ranges. |
Definition at line 85 of file GopUtils.c.
EFI_STATUS OcSetGopBurstMode | ( | VOID | ) |
Use PAT to enable write-combining caching (burst mode) on GOP memory, when it is suppported but firmware has not set it up.
EFI_SUCCESS | on success. |
Definition at line 308 of file GopUtils.c.
STATIC EFI_STATUS WriteCombineGop | ( | EFI_GRAPHICS_OUTPUT_PROTOCOL * | Gop, |
BOOLEAN | SetPatWC ) |
Definition at line 128 of file GopUtils.c.