diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-04-26 09:02:07 +0200 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2018-04-26 12:53:19 +0200 |
commit | dd7760470fcefc31acd439b5e6e314839d45f358 (patch) | |
tree | d82ca20d0313db3fed92eb0dfc56bef2d6a1abb5 /OvmfPkg/QemuVideoDxe | |
parent | e31fe995b81b191987b40e2556232493f6e9984f (diff) | |
download | edk2-dd7760470fcefc31acd439b5e6e314839d45f358.tar.gz edk2-dd7760470fcefc31acd439b5e6e314839d45f358.tar.bz2 edk2-dd7760470fcefc31acd439b5e6e314839d45f358.zip |
OvmfPkg/QemuVideoDxe: round up FrameBufferSize to full page
Guests do the same, because the framebuffer is mapped somewhere, which
obviously works with page granularity only.
When not rounding up to full page size we get messages like this one
(linux kernel):
efifb: framebuffer at 0x80000000, using 1876k, total 1875k
^^^^^ ^^^^^
Also sysfb is confused and throws an error:
sysfb: VRAM smaller than advertised
Cc: Phil Dennis-Jordan <phil@philjordan.eu>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: fix coding style]
Diffstat (limited to 'OvmfPkg/QemuVideoDxe')
-rw-r--r-- | OvmfPkg/QemuVideoDxe/Gop.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c index d51efc2a83..c9941ef138 100644 --- a/OvmfPkg/QemuVideoDxe/Gop.c +++ b/OvmfPkg/QemuVideoDxe/Gop.c @@ -69,6 +69,9 @@ QemuVideoCompleteModeData ( Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin;
Mode->FrameBufferSize = Info->HorizontalResolution * Info->VerticalResolution;
Mode->FrameBufferSize = Mode->FrameBufferSize * ((ModeData->ColorDepth + 7) / 8);
+ Mode->FrameBufferSize = EFI_PAGES_TO_SIZE (
+ EFI_SIZE_TO_PAGES (Mode->FrameBufferSize)
+ );
DEBUG ((EFI_D_INFO, "FrameBufferBase: 0x%Lx, FrameBufferSize: 0x%Lx\n",
Mode->FrameBufferBase, (UINT64)Mode->FrameBufferSize));
@@ -107,6 +110,9 @@ QemuVideoVmwareSvgaCompleteModeData ( Mode->FrameBufferBase = FrameBufDesc->AddrRangeMin + FbOffset;
Mode->FrameBufferSize = BytesPerLine * Info->VerticalResolution;
+ Mode->FrameBufferSize = EFI_PAGES_TO_SIZE (
+ EFI_SIZE_TO_PAGES (Mode->FrameBufferSize)
+ );
FreePool (FrameBufDesc);
return Status;
|