summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/QemuRamfbDxe
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:09 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commitac0a286f4d747a4c6c603a7b225917293cbe1e9f (patch)
tree32654f2b35755afc961e2c97296b2dec5762da75 /OvmfPkg/QemuRamfbDxe
parentd1050b9dff1cace252aff86630bfdb59dff5f507 (diff)
downloadedk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.tar.gz
edk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.tar.bz2
edk2-ac0a286f4d747a4c6c603a7b225917293cbe1e9f.zip
OvmfPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the OvmfPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
Diffstat (limited to 'OvmfPkg/QemuRamfbDxe')
-rw-r--r--OvmfPkg/QemuRamfbDxe/QemuRamfb.c191
1 files changed, 119 insertions, 72 deletions
diff --git a/OvmfPkg/QemuRamfbDxe/QemuRamfb.c b/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
index 881315f42d..f5113fbc78 100644
--- a/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
+++ b/OvmfPkg/QemuRamfbDxe/QemuRamfb.c
@@ -26,22 +26,22 @@
#pragma pack (1)
typedef struct RAMFB_CONFIG {
- UINT64 Address;
- UINT32 FourCC;
- UINT32 Flags;
- UINT32 Width;
- UINT32 Height;
- UINT32 Stride;
+ UINT64 Address;
+ UINT32 FourCC;
+ UINT32 Flags;
+ UINT32 Width;
+ UINT32 Height;
+ UINT32 Stride;
} RAMFB_CONFIG;
#pragma pack ()
-STATIC EFI_HANDLE mRamfbHandle;
-STATIC EFI_HANDLE mGopHandle;
-STATIC FRAME_BUFFER_CONFIGURE *mQemuRamfbFrameBufferBltConfigure;
-STATIC UINTN mQemuRamfbFrameBufferBltConfigureSize;
-STATIC FIRMWARE_CONFIG_ITEM mRamfbFwCfgItem;
+STATIC EFI_HANDLE mRamfbHandle;
+STATIC EFI_HANDLE mGopHandle;
+STATIC FRAME_BUFFER_CONFIGURE *mQemuRamfbFrameBufferBltConfigure;
+STATIC UINTN mQemuRamfbFrameBufferBltConfigureSize;
+STATIC FIRMWARE_CONFIG_ITEM mRamfbFwCfgItem;
-STATIC EFI_GRAPHICS_OUTPUT_MODE_INFORMATION mQemuRamfbModeInfo[] = {
+STATIC EFI_GRAPHICS_OUTPUT_MODE_INFORMATION mQemuRamfbModeInfo[] = {
{
0, // Version
640, // HorizontalResolution
@@ -57,7 +57,7 @@ STATIC EFI_GRAPHICS_OUTPUT_MODE_INFORMATION mQemuRamfbModeInfo[] = {
}
};
-STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE mQemuRamfbMode = {
+STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE mQemuRamfbMode = {
ARRAY_SIZE (mQemuRamfbModeInfo), // MaxMode
0, // Mode
mQemuRamfbModeInfo, // Info
@@ -76,17 +76,22 @@ QemuRamfbGraphicsOutputQueryMode (
{
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *ModeInfo;
- if (Info == NULL || SizeOfInfo == NULL ||
- ModeNumber >= mQemuRamfbMode.MaxMode) {
+ if ((Info == NULL) || (SizeOfInfo == NULL) ||
+ (ModeNumber >= mQemuRamfbMode.MaxMode))
+ {
return EFI_INVALID_PARAMETER;
}
+
ModeInfo = &mQemuRamfbModeInfo[ModeNumber];
- *Info = AllocateCopyPool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
- ModeInfo);
+ *Info = AllocateCopyPool (
+ sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
+ ModeInfo
+ );
if (*Info == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
*SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
return EFI_SUCCESS;
@@ -96,8 +101,8 @@ STATIC
EFI_STATUS
EFIAPI
QemuRamfbGraphicsOutputSetMode (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN UINT32 ModeNumber
)
{
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *ModeInfo;
@@ -108,10 +113,16 @@ QemuRamfbGraphicsOutputSetMode (
if (ModeNumber >= mQemuRamfbMode.MaxMode) {
return EFI_UNSUPPORTED;
}
+
ModeInfo = &mQemuRamfbModeInfo[ModeNumber];
- DEBUG ((DEBUG_INFO, "Ramfb: SetMode %u (%ux%u)\n", ModeNumber,
- ModeInfo->HorizontalResolution, ModeInfo->VerticalResolution));
+ DEBUG ((
+ DEBUG_INFO,
+ "Ramfb: SetMode %u (%ux%u)\n",
+ ModeNumber,
+ ModeInfo->HorizontalResolution,
+ ModeInfo->VerticalResolution
+ ));
Config.Address = SwapBytes64 (mQemuRamfbMode.FrameBufferBase);
Config.FourCC = SwapBytes32 (RAMFB_FORMAT);
@@ -121,7 +132,7 @@ QemuRamfbGraphicsOutputSetMode (
Config.Stride = SwapBytes32 (ModeInfo->HorizontalResolution * RAMFB_BPP);
Status = FrameBufferBltConfigure (
- (VOID*)(UINTN)mQemuRamfbMode.FrameBufferBase,
+ (VOID *)(UINTN)mQemuRamfbMode.FrameBufferBase,
ModeInfo,
mQemuRamfbFrameBufferBltConfigure,
&mQemuRamfbFrameBufferBltConfigureSize
@@ -131,6 +142,7 @@ QemuRamfbGraphicsOutputSetMode (
if (mQemuRamfbFrameBufferBltConfigure != NULL) {
FreePool (mQemuRamfbFrameBufferBltConfigure);
}
+
mQemuRamfbFrameBufferBltConfigure =
AllocatePool (mQemuRamfbFrameBufferBltConfigureSize);
if (mQemuRamfbFrameBufferBltConfigure == NULL) {
@@ -139,12 +151,13 @@ QemuRamfbGraphicsOutputSetMode (
}
Status = FrameBufferBltConfigure (
- (VOID*)(UINTN)mQemuRamfbMode.FrameBufferBase,
+ (VOID *)(UINTN)mQemuRamfbMode.FrameBufferBase,
ModeInfo,
mQemuRamfbFrameBufferBltConfigure,
&mQemuRamfbFrameBufferBltConfigureSize
);
}
+
if (RETURN_ERROR (Status)) {
ASSERT (Status == RETURN_UNSUPPORTED);
return Status;
@@ -173,8 +186,12 @@ QemuRamfbGraphicsOutputSetMode (
0 // Delta -- ignored
);
if (RETURN_ERROR (Status)) {
- DEBUG ((DEBUG_WARN, "%a: clearing the screen failed: %r\n",
- __FUNCTION__, Status));
+ DEBUG ((
+ DEBUG_WARN,
+ "%a: clearing the screen failed: %r\n",
+ __FUNCTION__,
+ Status
+ ));
}
return EFI_SUCCESS;
@@ -184,16 +201,16 @@ STATIC
EFI_STATUS
EFIAPI
QemuRamfbGraphicsOutputBlt (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN 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
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN 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
)
{
return FrameBufferBlt (
@@ -210,7 +227,7 @@ QemuRamfbGraphicsOutputBlt (
);
}
-STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL mQemuRamfbGraphicsOutput = {
+STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL mQemuRamfbGraphicsOutput = {
QemuRamfbGraphicsOutputQueryMode,
QemuRamfbGraphicsOutputSetMode,
QemuRamfbGraphicsOutputBlt,
@@ -220,8 +237,8 @@ STATIC EFI_GRAPHICS_OUTPUT_PROTOCOL mQemuRamfbGraphicsOutput = {
EFI_STATUS
EFIAPI
InitializeQemuRamfb (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_DEVICE_PATH_PROTOCOL *RamfbDevicePath;
@@ -244,9 +261,14 @@ InitializeQemuRamfb (
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
+
if (FwCfgSize != sizeof (RAMFB_CONFIG)) {
- DEBUG ((DEBUG_ERROR, "Ramfb: FwCfg size mismatch (expected %lu, got %lu)\n",
- (UINT64)sizeof (RAMFB_CONFIG), (UINT64)FwCfgSize));
+ DEBUG ((
+ DEBUG_ERROR,
+ "Ramfb: FwCfg size mismatch (expected %lu, got %lu)\n",
+ (UINT64)sizeof (RAMFB_CONFIG),
+ (UINT64)FwCfgSize
+ ));
return EFI_PROTOCOL_ERROR;
}
@@ -257,26 +279,37 @@ InitializeQemuRamfb (
mQemuRamfbModeInfo[Index].PixelFormat =
PixelBlueGreenRedReserved8BitPerColor;
FbSize = RAMFB_BPP *
- mQemuRamfbModeInfo[Index].HorizontalResolution *
- mQemuRamfbModeInfo[Index].VerticalResolution;
+ mQemuRamfbModeInfo[Index].HorizontalResolution *
+ mQemuRamfbModeInfo[Index].VerticalResolution;
if (MaxFbSize < FbSize) {
MaxFbSize = FbSize;
}
- DEBUG ((DEBUG_INFO, "Ramfb: Mode %lu: %ux%u, %lu kB\n", (UINT64)Index,
+
+ DEBUG ((
+ DEBUG_INFO,
+ "Ramfb: Mode %lu: %ux%u, %lu kB\n",
+ (UINT64)Index,
mQemuRamfbModeInfo[Index].HorizontalResolution,
mQemuRamfbModeInfo[Index].VerticalResolution,
- (UINT64)(FbSize / 1024)));
+ (UINT64)(FbSize / 1024)
+ ));
}
- Pages = EFI_SIZE_TO_PAGES (MaxFbSize);
+ Pages = EFI_SIZE_TO_PAGES (MaxFbSize);
MaxFbSize = EFI_PAGES_TO_SIZE (Pages);
- FbBase = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedPages (Pages);
+ FbBase = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateReservedPages (Pages);
if (FbBase == 0) {
DEBUG ((DEBUG_ERROR, "Ramfb: memory allocation failed\n"));
return EFI_OUT_OF_RESOURCES;
}
- DEBUG ((DEBUG_INFO, "Ramfb: Framebuffer at 0x%lx, %lu kB, %lu pages\n",
- (UINT64)FbBase, (UINT64)(MaxFbSize / 1024), (UINT64)Pages));
+
+ DEBUG ((
+ DEBUG_INFO,
+ "Ramfb: Framebuffer at 0x%lx, %lu kB, %lu pages\n",
+ (UINT64)FbBase,
+ (UINT64)(MaxFbSize / 1024),
+ (UINT64)Pages
+ ));
mQemuRamfbMode.FrameBufferSize = MaxFbSize;
mQemuRamfbMode.FrameBufferBase = FbBase;
@@ -288,14 +321,18 @@ InitializeQemuRamfb (
//
// ramfb vendor devpath
//
- VendorDeviceNode.Header.Type = HARDWARE_DEVICE_PATH;
+ VendorDeviceNode.Header.Type = HARDWARE_DEVICE_PATH;
VendorDeviceNode.Header.SubType = HW_VENDOR_DP;
CopyGuid (&VendorDeviceNode.Guid, &gQemuRamfbGuid);
- SetDevicePathNodeLength (&VendorDeviceNode.Header,
- sizeof (VENDOR_DEVICE_PATH));
+ SetDevicePathNodeLength (
+ &VendorDeviceNode.Header,
+ sizeof (VENDOR_DEVICE_PATH)
+ );
- RamfbDevicePath = AppendDevicePathNode (NULL,
- (EFI_DEVICE_PATH_PROTOCOL *) &VendorDeviceNode);
+ RamfbDevicePath = AppendDevicePathNode (
+ NULL,
+ (EFI_DEVICE_PATH_PROTOCOL *)&VendorDeviceNode
+ );
if (RamfbDevicePath == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto FreeFramebuffer;
@@ -308,31 +345,38 @@ InitializeQemuRamfb (
NULL
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "Ramfb: install Ramfb Vendor DevicePath failed: %r\n",
- Status));
+ DEBUG ((
+ DEBUG_ERROR,
+ "Ramfb: install Ramfb Vendor DevicePath failed: %r\n",
+ Status
+ ));
goto FreeRamfbDevicePath;
}
//
// gop devpath + protocol
//
- AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH;
+ AcpiDeviceNode.Header.Type = ACPI_DEVICE_PATH;
AcpiDeviceNode.Header.SubType = ACPI_ADR_DP;
- AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (
- 1, // DeviceIdScheme
- 0, // HeadId
- 0, // NonVgaOutput
- 1, // BiosCanDetect
- 0, // VendorInfo
- ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL, // Type
- 0, // Port
- 0 // Index
+ AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (
+ 1, // DeviceIdScheme
+ 0, // HeadId
+ 0, // NonVgaOutput
+ 1, // BiosCanDetect
+ 0, // VendorInfo
+ ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL, // Type
+ 0, // Port
+ 0 // Index
+ );
+ SetDevicePathNodeLength (
+ &AcpiDeviceNode.Header,
+ sizeof (ACPI_ADR_DEVICE_PATH)
);
- SetDevicePathNodeLength (&AcpiDeviceNode.Header,
- sizeof (ACPI_ADR_DEVICE_PATH));
- GopDevicePath = AppendDevicePathNode (RamfbDevicePath,
- (EFI_DEVICE_PATH_PROTOCOL *) &AcpiDeviceNode);
+ GopDevicePath = AppendDevicePathNode (
+ RamfbDevicePath,
+ (EFI_DEVICE_PATH_PROTOCOL *)&AcpiDeviceNode
+ );
if (GopDevicePath == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto FreeRamfbHandle;
@@ -347,8 +391,11 @@ InitializeQemuRamfb (
NULL
);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "Ramfb: install GOP DevicePath failed: %r\n",
- Status));
+ DEBUG ((
+ DEBUG_ERROR,
+ "Ramfb: install GOP DevicePath failed: %r\n",
+ Status
+ ));
goto FreeGopDevicePath;
}
@@ -388,6 +435,6 @@ FreeRamfbHandle:
FreeRamfbDevicePath:
FreePool (RamfbDevicePath);
FreeFramebuffer:
- FreePages ((VOID*)(UINTN)mQemuRamfbMode.FrameBufferBase, Pages);
+ FreePages ((VOID *)(UINTN)mQemuRamfbMode.FrameBufferBase, Pages);
return Status;
}