public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: yuchenlin@synology.com
Cc: edk2-devel@lists.01.org, jordan.l.justen@intel.com,
	ard.biesheuvel@linaro.org, anthony.perard@citrix.com,
	julien.grall@linaro.org, Gerd Hoffmann <kraxel@redhat.com>,
	Phil Dennis-Jordan <phil@philjordan.eu>
Subject: Re: [PATCH] OvmfPkg: initialize bochs when initializing vmsvga
Date: Tue, 23 Oct 2018 12:18:53 +0200	[thread overview]
Message-ID: <ddd3122a-1ec3-0aa1-e17b-3c602802a787@redhat.com> (raw)
In-Reply-To: <20181023024057.21942-1-yuchenlin@synology.com>

(1) Adding Gerd (because he maintains video in QEMU), and Phil
Dennis-Jordan (for authoring commit c137d9508169, "OvmfPkg/QemuVideoDxe:
VMWare SVGA device support", 2017-04-07).


On 10/23/18 04:40, yuchenlin@synology.com wrote:
> From: yuchenlin <yuchenlin@synology.com>
> 
> When driver doesn't set fifo config, the vmsvga will fall back
> to std vga. However, we don't initialize vbe related port. It
> causes blank screen in qemu console.

(2) The words "when driver doesn't set fifo config" tell me nothing. The
QemuVideoDxe directory has zero instances of the word "fifo". The same
applies to "OvmfPkg/Include/IndustryStandard/VmwareSvga.h".

In addition, the "vmsvga will fall back to std vga" statement is also
unclear. Is that a statement about the QEMU device model's behavior?

I vaguely suspect that your intent might be to say, "QemuVideoDxe does
not perform a necessary configuration step, and therefore it cannot
drive QEMU's VMW SVGA device". However, if that is indeed your intent,
then I believe something must have changed recently in QEMU, because
QemuVideoDxe *definitely* worked when Phil contributed the VMW SVGA
driver logic, in commit c137d9508169.

Are we talking about a QEMU regression, or a driver-side configuration
step that QemuVideoDxe has always missed (and we're being punished for
it only now)?


> This patch will fix "Guest has not initialized the display (yet)"
> when using qemu -device vmware-svga with ovmf.

Right, as I write above, this definitely worked earlier. I suggest
bisecting QEMU (and/or testing older QEMU machine types) to identify the
QEMU side change. Once we know that, we can decide whether this is a
QEMU regression, or just exposing a long-standing OVMF bug.

Comments about the code below:


> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: yuchenlin <yuchenlin@synology.com>
> ---
>  OvmfPkg/QemuVideoDxe/Driver.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
> index 0dce80e59..255c01881 100644
> --- a/OvmfPkg/QemuVideoDxe/Driver.c
> +++ b/OvmfPkg/QemuVideoDxe/Driver.c
> @@ -1067,8 +1067,7 @@ InitializeVmwareSvgaGraphicsMode (
>  
>    VmwareSvgaWrite (Private, VmwareSvgaRegEnable, 1);
>  
> -  SetDefaultPalette (Private);
> -  ClearScreen (Private);
> +  InitializeBochsGraphicsMode (Private, ModeData);
>  }
>  
>  EFI_STATUS
> 

(3) Calling InitializeBochsGraphicsMode() from within
InitializeVmwareSvgaGraphicsMode() seems wrong, considering the current
structure of the driver.

We only have InitializeXxxGraphicsMode() calls in
QemuVideoGraphicsOutputSetMode(). In order to determine which variant to
call, we check the "Private->Variant" field, in a "switch" statement.
Therefore:

(3a) If a general fallback from "VmwareSvga" to "Bochs" is necessary,
then the fallback logic should be added to earlier code that sets the
Variant field.

You can see an example for that in the QemuVideoControllerDriverStart()
function, near the debug message "QemuVideo: No mmio bar, fallback to
port io". There the Variant field is degraded from the originally
detected QEMU_VIDEO_BOCHS_MMIO value, to QEMU_VIDEO_BOCHS.

(3b) Or else, if calling InitializeVmwareSvgaGraphicsMode() is fine as a
basis, but we also need the actions of InitializeBochsGraphicsMode() *in
addition*, then please:

- extract the common actions from InitializeBochsGraphicsMode() to a new
helper function, and call the helper from both
InitializeBochsGraphicsMode() and InitializeVmwareSvgaGraphicsMode(),

- explain, in InitializeVmwareSvgaGraphicsMode(), *why* the Bochs config
actions are necessary, in addition to the VmwareSvga actions.

Thanks,
Laszlo


  reply	other threads:[~2018-10-23 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  2:40 [PATCH] OvmfPkg: initialize bochs when initializing vmsvga yuchenlin
2018-10-23 10:18 ` Laszlo Ersek [this message]
2018-10-23 11:12   ` yuchenlin
2018-10-23 12:45     ` Laszlo Ersek
2018-10-23 13:42       ` Gerd Hoffmann
2018-10-23 14:02         ` Laszlo Ersek
2018-10-24  1:33           ` yuchenlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ddd3122a-1ec3-0aa1-e17b-3c602802a787@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox