From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web09.11136.1639665012766125311 for ; Thu, 16 Dec 2021 06:30:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZF80AwZ6; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639665011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9fXgv6irNZGm8rYAjZ31fi4RQPnh2lnrmLdLPQyJ1Yo=; b=ZF80AwZ66MCbnScYJ9N64DzSmpmhxKdIWM2rwfkIBofiwAIuhoUOjAr71IoGUQJbCr3jy2 VSi6kBDln5OB+hczig/HnXB9iyDosMasPH0jx8LwFv5eD2FLt1/RZ/ey573J4TZvz/fWWN 7JtOcQ1a+ZuwAxEy5N/KzcQAZ6Im4Vw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-yP102KIwPjCCLPo9SS2aDg-1; Thu, 16 Dec 2021 09:30:08 -0500 X-MC-Unique: yP102KIwPjCCLPo9SS2aDg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A394E10247AC; Thu, 16 Dec 2021 14:30:06 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BA5F7A22A; Thu, 16 Dec 2021 14:30:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4397118003B6; Thu, 16 Dec 2021 15:29:59 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Erdem Aktas , Julien Grall , Brijesh Singh , Pawel Polawski , Min Xu , Jiewen Yao , Tom Lendacky , Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , James Bottomley , Anthony Perard , Gerd Hoffmann Subject: [PATCH 3/5] OvmfPkg/QemuVideoDxe: drop QEMU_VIDEO_BOCHS_MODES->ColorDepth Date: Thu, 16 Dec 2021 15:29:57 +0100 Message-Id: <20211216142959.1998191-4-kraxel@redhat.com> In-Reply-To: <20211216142959.1998191-1-kraxel@redhat.com> References: <20211216142959.1998191-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" All video modes in the list are 32-bit, so drop the useless ColorDepth field. Signed-off-by: Gerd Hoffmann --- OvmfPkg/QemuVideoDxe/Qemu.h | 1 - OvmfPkg/QemuVideoDxe/Initialize.c | 80 +++++++++++++++---------------- 2 files changed, 39 insertions(+), 42 deletions(-) diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h index fef648c967b2..1e6507f44caa 100644 --- a/OvmfPkg/QemuVideoDxe/Qemu.h +++ b/OvmfPkg/QemuVideoDxe/Qemu.h @@ -132,7 +132,6 @@ typedef struct { typedef struct { UINT32 Width; UINT32 Height; - UINT32 ColorDepth; } QEMU_VIDEO_BOCHS_MODES; #define QEMU_VIDEO_PRIVATE_DATA_FROM_GRAPHICS_OUTPUT_THIS(a) \ diff --git a/OvmfPkg/QemuVideoDxe/Initialize.c b/OvmfPkg/QemuVideoDxe/Initialize.c index 8a70cf848483..2b174d13faf2 100644 --- a/OvmfPkg/QemuVideoDxe/Initialize.c +++ b/OvmfPkg/QemuVideoDxe/Initialize.c @@ -203,43 +203,43 @@ QemuVideoCirrusModeSetup ( /// Table of supported video modes /// STATIC QEMU_VIDEO_BOCHS_MODES QemuVideoBochsModes[] = { - { 640, 480, 32 }, - { 800, 480, 32 }, - { 800, 600, 32 }, - { 832, 624, 32 }, - { 960, 640, 32 }, - { 1024, 600, 32 }, - { 1024, 768, 32 }, - { 1152, 864, 32 }, - { 1152, 870, 32 }, - { 1280, 720, 32 }, - { 1280, 760, 32 }, - { 1280, 768, 32 }, - { 1280, 800, 32 }, - { 1280, 960, 32 }, - { 1280, 1024, 32 }, - { 1360, 768, 32 }, - { 1366, 768, 32 }, - { 1400, 1050, 32 }, - { 1440, 900, 32 }, - { 1600, 900, 32 }, - { 1600, 1200, 32 }, - { 1680, 1050, 32 }, - { 1920, 1080, 32 }, - { 1920, 1200, 32 }, - { 1920, 1440, 32 }, - { 2000, 2000, 32 }, - { 2048, 1536, 32 }, - { 2048, 2048, 32 }, - { 2560, 1440, 32 }, - { 2560, 1600, 32 }, - { 2560, 2048, 32 }, - { 2800, 2100, 32 }, - { 3200, 2400, 32 }, - { 3840, 2160, 32 }, - { 4096, 2160, 32 }, - { 7680, 4320, 32 }, - { 8192, 4320, 32 } + { 640, 480 }, + { 800, 480 }, + { 800, 600 }, + { 832, 624 }, + { 960, 640 }, + { 1024, 600 }, + { 1024, 768 }, + { 1152, 864 }, + { 1152, 870 }, + { 1280, 720 }, + { 1280, 760 }, + { 1280, 768 }, + { 1280, 800 }, + { 1280, 960 }, + { 1280, 1024 }, + { 1360, 768 }, + { 1366, 768 }, + { 1400, 1050 }, + { 1440, 900 }, + { 1600, 900 }, + { 1600, 1200 }, + { 1680, 1050 }, + { 1920, 1080 }, + { 1920, 1200 }, + { 1920, 1440 }, + { 2000, 2000 }, + { 2048, 1536 }, + { 2048, 2048 }, + { 2560, 1440 }, + { 2560, 1600 }, + { 2560, 2048 }, + { 2800, 2100 }, + { 3200, 2400 }, + { 3840, 2160 }, + { 4096, 2160 }, + { 7680, 4320 }, + { 8192, 4320 } }; #define QEMU_VIDEO_BOCHS_MODE_COUNT \ @@ -348,14 +348,12 @@ QemuVideoBochsModeSetup ( for (Index = 0; Index < QEMU_VIDEO_BOCHS_MODE_COUNT; Index++) { UINTN RequiredFbSize; - ASSERT (VideoMode->ColorDepth % 8 == 0); - RequiredFbSize = (UINTN)VideoMode->Width * VideoMode->Height * - (VideoMode->ColorDepth / 8); + RequiredFbSize = (UINTN)VideoMode->Width * VideoMode->Height * 4; if (RequiredFbSize <= AvailableFbSize) { ModeData->InternalModeIndex = Index; ModeData->HorizontalResolution = VideoMode->Width; ModeData->VerticalResolution = VideoMode->Height; - ModeData->ColorDepth = VideoMode->ColorDepth; + ModeData->ColorDepth = 32; DEBUG (( DEBUG_INFO, "Adding Mode %d as Bochs Internal Mode %d: %dx%d, %d-bit\n", -- 2.33.1