OvmfPkg/QemuVideoDxe: ignore display resolutions smaller than 640x480

GraphicsConsoleDxe will assert in case the resolution is too small.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2024-08-23 14:36:16 +02:00 committed by mergify[bot]
parent 58035e8b5e
commit 391666da2c

View File

@ -293,6 +293,8 @@ QemuVideoBochsEdid (
)
{
EFI_STATUS Status;
UINT32 X;
UINT32 Y;
if (Private->Variant != QEMU_VIDEO_BOCHS_MMIO) {
return;
@ -344,16 +346,24 @@ QemuVideoBochsEdid (
return;
}
*XRes = Private->Edid[56] | ((Private->Edid[58] & 0xf0) << 4);
*YRes = Private->Edid[59] | ((Private->Edid[61] & 0xf0) << 4);
X = Private->Edid[56] | ((Private->Edid[58] & 0xf0) << 4);
Y = Private->Edid[59] | ((Private->Edid[61] & 0xf0) << 4);
DEBUG ((
DEBUG_INFO,
"%a: default resolution: %dx%d\n",
__func__,
*XRes,
*YRes
X,
Y
));
if ((X < 640) || (Y < 480)) {
/* ignore hint, GraphicsConsoleDxe needs 640x480 or larger */
return;
}
*XRes = X;
*YRes = Y;
if (PcdGet8 (PcdVideoResolutionSource) == 0) {
Status = PcdSet32S (PcdVideoHorizontalResolution, *XRes);
ASSERT_RETURN_ERROR (Status);