From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.8013.1587474189795007184 for ; Tue, 21 Apr 2020 06:03:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MVYT4bJY; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587474189; 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=TiL1gvWmNe67InoDmmjUD0KEQwrxgISySTFxbtW1GOQ=; b=MVYT4bJYFORZZz6KuFn61sMAtoVtOzy86o3I+/BWHwIVV1Y9kF7r/dDhT++v6mlG4fPjDW qyAbGI4ImgodDQRF3mI7j0qU+zNevUE3zm02zEF5yqb7zg1GxMMx3YnYoyDLv68Py9jPK6 90opCzSYx06pV6s2j12d1iGxLBOjwBM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-tIO59JKKN_K94JkmQXWTxg-1; Tue, 21 Apr 2020 09:03:02 -0400 X-MC-Unique: tIO59JKKN_K94JkmQXWTxg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53FEB8017F3; Tue, 21 Apr 2020 13:03:01 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-52.ams2.redhat.com [10.36.115.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 483955DA7C; Tue, 21 Apr 2020 13:02:56 +0000 (UTC) Subject: Re: [edk2-discuss] Load Option passing. Either bugs or my confusion. To: Gerd Hoffmann Cc: valerij zaporogeci , Hou Qiming , discuss@edk2.groups.io, "Marcel Apfelbaum (GMail address)" , edk2-devel-groups-io , qemu devel list References: <623b1855-285c-cce3-c806-c17e5fd217ea@redhat.com> <5211.1586899245384995995@groups.io> <20200420141303.dxjqgvmzglrjtsly@sirius.home.kraxel.org> From: "Laszlo Ersek" Message-ID: <9aed493a-2187-cacd-5631-54fb9973509c@redhat.com> Date: Tue, 21 Apr 2020 15:02:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200420141303.dxjqgvmzglrjtsly@sirius.home.kraxel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 04/20/20 16:13, Gerd Hoffmann wrote: > Hi, > >> So I would say that the symptom you see is a QEMU v4.1.0 regression. >> The QemuRamfbGraphicsOutputSetMode() function in the OVMF ramfb >> driver certainly needs the QemuFwCfgWriteBytes() call to work, for >> changing the resolution. > > Oh? QemuRamfbGraphicsOutputSetMode() can be called multiple times? > How does that happen? QemuRamfbGraphicsOutputSetMode() is the "SetMode" member function of the EFI_GRAPHICS_OUTPUT_PROTOCOL instance that QemuRamfbDxe produces. This is a standard protocol; UEFI drivers and applications are free to locate it and to use it. (1) When you launch OVMF, you get the splash screen in a particular resolution. This resolution: - is configured by OvmfPkg/PlatformDxe, - is inherited by an OS boot loader, - is reconfigurable with OvmfPkg/PlatformDxe, for the next boot, via the Setup TUI, - defaults to 800x600 (taking effect when no particular choice is configured). (2) UiApp -- the Setup TUI itself -- uses its own resolution. Under OVMF, this resolution is fixed 640x480. When UiApp is entered, ultimately a call is made to QemuRamfbGraphicsOutputSetMode() -- i.e., a GOP.SetMode() member function -- for setting this 640x480 resolution. Using the following command: qemu-system-x86_64 \ -nodefaults \ -boot menu=on,splash-time=5000 \ -enable-kvm \ -device ramfb \ -drive if=pflash,readonly,format=raw,file=$PREFIX/share/qemu/edk2-x86_64-code.fd \ -drive if=pflash,snapshot,format=raw,file=$PREFIX/share/qemu/edk2-i386-vars.fd \ -debugcon file:ovmf.log \ -global isa-debugcon.iobase=0x402 when you first see the progress bar, the graphical resolution (1) is 800x600. Accordingly, QEMU prints to stderr: > ramfb_fw_cfg_write: 800x600 @ 0x6702000 Once you hit ESC to interrupt the progress bar and to enter the Setup TUI, UiApp switches to resolution (2), 640x480. QEMU prints: > ramfb_fw_cfg_write: 640x480 @ 0x6702000 > ramfb_fw_cfg_write: resolution locked, change rejected And you get garbage in the Setup window. Thanks, Laszlo