aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--UefiMonitorTest/UefiMonitorTest.c21
-rw-r--r--UefiMonitorTest/UefiMonitorTest.h10
2 files changed, 29 insertions, 2 deletions
diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c
index 2d27013..8dda9b7 100644
--- a/UefiMonitorTest/UefiMonitorTest.c
+++ b/UefiMonitorTest/UefiMonitorTest.c
@@ -23,7 +23,10 @@ PrepareGraphicsInfo (
ASSERT (Gop != NULL);
Graphics->Gop = Gop;
- Graphics->Base = (UINT8 *)Gop->Mode->FrameBufferBase;
+ Graphics->FrontBuffer = (UINT8 *)Gop->Mode->FrameBufferBase;
+ Graphics->BufferSize = Gop->Mode->FrameBufferSize;
+ Graphics->BackBuffer = AllocateCopyPool (Graphics->BufferSize, Graphics->FrontBuffer);
+ ASSERT (Graphics->BackBuffer != NULL);
Graphics->Width = Gop->Mode->Info->HorizontalResolution;
Graphics->Height = Gop->Mode->Info->VerticalResolution;
Graphics->PixelWidth = 4; // A pixel is 32-bits
@@ -44,6 +47,18 @@ PrepareGraphicsInfo (
}
STATIC
+VOID
+ForgetGraphicsInfo (
+ IN GRAPHICS_CONTEXT *Graphics
+ )
+{
+ ASSERT (Graphics != NULL);
+
+ // Should we zero all the data structure?
+
+ FreePool (Graphics->BackBuffer);
+}
+
EFI_GRAPHICS_OUTPUT_PROTOCOL *
GetGraphicsOutputProtocol (
VOID
@@ -100,5 +115,9 @@ UefiMain (
PrepareGraphicsInfo (&Graphics, Gop);
+
+
+ ForgetGraphicsInfo (&Graphics);
+
return EFI_SUCCESS;
}
diff --git a/UefiMonitorTest/UefiMonitorTest.h b/UefiMonitorTest/UefiMonitorTest.h
index d6306bc..97ada85 100644
--- a/UefiMonitorTest/UefiMonitorTest.h
+++ b/UefiMonitorTest/UefiMonitorTest.h
@@ -10,7 +10,15 @@ typedef struct {
/// Base address of graphics linear frame buffer.
/// Starts from the upper left pixel.
///
- UINT8 *Base;
+ UINT8 *FrontBuffer;
+ ///
+ /// Pointer to allocated memory. Secondary linear buffer.
+ ///
+ UINT8 *BackBuffer;
+ ///
+ /// Amount of frame buffer needed to support the active mode.
+ ///
+ UINTN BufferSize;
///
/// The size of video screen in pixels in the X dimension.
///