qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Corrupted display changing screen colour depth in qemu-system-ppc/Ma


From: Mark Cave-Ayland
Subject: Re: Corrupted display changing screen colour depth in qemu-system-ppc/MacOS
Date: Sat, 23 Jul 2022 09:59:04 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

On 22/07/2022 17:40, Mark Cave-Ayland wrote:

On 22/07/2022 14:44, Marc-André Lureau wrote:

Hi

On Fri, Jul 22, 2022 at 4:28 PM Howard Spoelstra <hsp.cat7@gmail.com> wrote:



On Fri, Jun 17, 2022 at 2:38 PM Marc-André Lureau <marcandre.lureau@redhat.com> wrote:

Hi

On Fri, Jun 17, 2022 at 1:56 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

   Hi,

Can you try ditch the QEMU_ALLOCATED_FLAG check added by the commit?

Commit cb8962c146 drops the QEMU_ALLOCATED_FLAG check: if I add it back in
with the following diff on top then everything works again:

Ah, the other way around.

diff --git a/ui/console.c b/ui/console.c
index 365a2c14b8..decae4287f 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -2400,11 +2400,12 @@ static void vc_chr_open(Chardev *chr,

  void qemu_console_resize(QemuConsole *s, int width, int height)
  {
-    DisplaySurface *surface;
+    DisplaySurface *surface = qemu_console_surface(s);

      assert(s->console_type == GRAPHIC_CONSOLE);

-    if (qemu_console_get_width(s, -1) == width &&
+    if (surface && (surface->flags & QEMU_ALLOCATED_FLAG) &&
+        qemu_console_get_width(s, -1) == width &&
          qemu_console_get_height(s, -1) == height) {
          return;
      }

Which depth changes triggers this?  Going from direct color to a
paletted mode?

A quick test suggests anything that isn't 32-bit colour is affected.

Hmm, I think the commit should simply be reverted.

Short-cutting the qemu_console_resize() call is only valid in case the
current surface was created by qemu_console_resize() too.  When it is
something else -- typically a surface backed by vga vram -- it's not.
Looking at the QEMU_ALLOCATED_FLAG checks exactly that ...

Oh ok, it might be worth adding a comment to clarify that. By
reverting, we are going back to the situation where
qemu_console_resize() will create a needless surface when rendering
with GL. As I tried to explain in the commit message, it will need
more changes to prevent that. I can take a look later.


Hi Marc-André,

I wondered whether you've had a chance to look at this?


No, it's not clear to me how to reproduce it. Someone that can
actually test it should send a patch with some comments to explain it.

Unfortunately I don't know anything about the host display code, but I think I should be able to come up with some Forth to run from the command line that will reproduce the issue with qemu-system-ppc. Let me see if I can come up with something...

Okay here's the command line reproducer for qemu-system-ppc:

./build/qemu-system-ppc -M mac99 -prom-env 'use-nvramrc?=true' -prom-env nvramrc=': vbe-w! f20001ce le-w! f20001d0 le-w! ; : set-res 0 4 vbe-w! 20 3 vbe-w! 320 1 vbe-w! 258 2 vbe-w! 61 4 vbe-w! 0 4 vbe-w! 8 3 vbe-w! 320 1 vbe-w! 258 2 vbe-w! 61 4 vbe-w! 320 to openbios-video-width 258 to openbios-video-height 320 to line-bytes 8 to depth-bits ;' -prom-env 'boot-command=cd /chosen set-res show-devs' -trace '*vbe*'

I've also uploaded the full command line to https://www.ilande.co.uk/tmp/qemu/ppc-vbe-repro.txt just in case the spacing gets mangled by my mail client.

What this command does is to set the screen resolution to 800x600 32bpp followed by 800x600 8bpp using the Bochs VBE registers, and then dump out the device tree to the framebuffer.

If you run this command on current QEMU git then you end up with the same problem exhibited by the QEMU MacOS VGA driver which is that the individual planes become visible on the display as per https://www.ilande.co.uk/tmp/qemu/ppc-vbe-repro-bad.png.

Reverting the effect of cb8962c146 using the patch above restores the previous working behaviour where you end up with black text on a grey background as per https://www.ilande.co.uk/tmp/qemu/ppc-vbe-repro-good.png.


ATB,

Mark.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]