[Top][All Lists]

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

Re: [Qemu-devel] Cirrus bugs vs endian: how two bugs cancel each other o

From: Blue Swirl
Subject: Re: [Qemu-devel] Cirrus bugs vs endian: how two bugs cancel each other out
Date: Mon, 30 Jul 2012 15:18:49 +0000

On Mon, Jul 30, 2012 at 6:24 AM, Benjamin Herrenschmidt
<address@hidden> wrote:
> So I got cirrus working on ppc with cirrusdrmfb...
> The fun part is that it works :-)
> Basically, the issue is that normally, for it to work, one would have to
> access the framebuffer using the appropriate aperture for byteswapping
> based on the bpp.
> However, qemu doesn't emulate those apertures ... and cirrusdrmfb
> either.
> In fact, qemu cirrus model is just dumb and assumes guest native
> byteorder for the framebuffer.
> The good thing is that this makes it work... the bad thing is that it's
> a completely incorrect HW model and if the linux driver wasn't also
> buggy it wouldn't work.
> However it's also pretty much unfixable without making it also unusable
> in terms of performance so I want to check with you guys if it's ok to
> just leave it as-is.
> Basically, if the fb was LE as it's supposed to be, one would have to
> use the byteswapped apertures. But those can only be emulated by
> trapping on every access to turn it into MMIO emulation, which means
> unusable performances.
> So we end up with what is effectively a BE framebuffer thanks to qemu
> hard coding what it thinks the guest endian is (btw, this is quite
> busted in theory as well since PPC can be bi-endian for example).

I think even this is not fully accurate description of the VGA
insanity, because if the host display happens to use BGR pixel format
instead of RGB, there may be more byte shuffling, but not in all
cases: compare vga_draw_line24() to vga_draw_line32() in

For VGA, 24 and 32 bit modes and direct frame buffer access are only
available via VBE which does not match any real HW. The real VGA modes
should be accurately emulated.

> Anyways, it works today, it's just that the HW model is wrong... and I
> don't want to fix it. Any objection ?
> As for the work I'm doing to brush up pci-vga a bit, I'm tempted to add
> an MMIO reg or a VBE config reg bit to allow configuring the endianness
> of the underlying fb with a default to what qemu does today.
> Cheers,
> Ben.

reply via email to

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