From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
Paolo Bonzini <pbonzini@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [RFC] qemu VGA endian swap low level drawing changes
Date: Wed, 18 Jun 2014 07:32:14 +1000 [thread overview]
Message-ID: <1403040734.7661.173.camel@pasglop> (raw)
In-Reply-To: <1403006267.1614.14.camel@nilsson.home.kraxel.org>
On Tue, 2014-06-17 at 13:57 +0200, Gerd Hoffmann wrote:
> Ok, it is supposed to work this way:
>
> The virtual graphics card creates a DisplaySurface, which is a pixman
> image under the hood. There are basically two ways to do that:
>
> (1) Use qemu_create_displaysurface(). Allocates host memory.
> Returns 32bpp framebuffer in host byte order. virtual graphics
> card is supposed to convert the guests framebuffer into that
> format.
> (2) Use qemu_create_displaysurface_from(). DisplaySurface (and pixman
> image) is backed by guest display memory then. pixman format
> obviously must match the guests framebuffer format.
>
> The ui (gtk / sdl / vnc / screendump via monitor) is supposed to deal
> with whatever it gets. Typically the ui checks whenever it can use the
> format directly, and if not it converts using pixman (see gd_switch in
> ui/gtk.c for example). vnc and screendump use pixman too. sdl feeds
> SDL_CreateRGBSurfaceFrom with the shifts of the pixelformat instead.
Allright, I'll play with this, it makes sense to get rid of most of
the conversion functions if we know the surface will always be 32-bit
indeed.
I think we can work step by step:
- Remove all the non-32bpp targets from vga_template
- Add the 32-bit target only version of my byteswap
This gives us something that works quickly. We also need to focus on how
to trigger the endian mode etc...
Then we can
- Look into doing at least some of the conversions in pixman
Which would be a subsequent optimization.
Any objection ? I'll spend some time in the next few days getting myself
a bit more familiar with that pixman stuff (I need to fix the ppc vector
stuff for LE in there anyway) and come up with patches.
Another step I hinted to earlier is how we do the actual endian
transition. My idea is to add a new register to the BOCHS DISPI VBE
list and bump the PCI revision ID to advertise its existence.
Additionally, I wouldn't mind of we did a quick "trick" equivalent (but
cleaner) to what I did in my patch which is when the pseries guest calls
the hypervisor call to change the interrupt endian mode, we notify VGA
and switch its endian mode, so we work "by default" with kernels not
updated to know about that register. But this is open for debate. It's
somewhat "acceptable" in the context of our hypercall being a
"paravirtualized" interface, so it can be argued that the hypercall
poking at the VGA chip is equivalent to some FW doing so :-)
Cheers,
Ben.
next prev parent reply other threads:[~2014-06-17 21:32 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 3:07 [Qemu-devel] [RFC] qemu VGA endian swap low level drawing changes Benjamin Herrenschmidt
2014-06-17 4:40 ` Paolo Bonzini
2014-06-17 4:59 ` Benjamin Herrenschmidt
2014-06-17 5:36 ` Paolo Bonzini
2014-06-17 6:06 ` Benjamin Herrenschmidt
2014-06-17 9:18 ` Alexey Kardashevskiy
2014-06-17 9:26 ` Alexander Graf
2014-06-17 10:00 ` Greg Kurz
2014-06-17 10:09 ` Benjamin Herrenschmidt
2014-06-17 10:19 ` Peter Maydell
2014-06-17 10:57 ` Benjamin Herrenschmidt
2014-06-17 11:40 ` Greg Kurz
2014-06-17 11:53 ` Benjamin Herrenschmidt
2014-06-17 12:05 ` Peter Maydell
2014-06-17 10:45 ` Gerd Hoffmann
2014-06-17 11:08 ` Peter Maydell
2014-06-17 11:24 ` Gerd Hoffmann
2014-06-17 11:42 ` Peter Maydell
2014-06-19 12:33 ` Gerd Hoffmann
2014-06-19 13:01 ` Paolo Bonzini
2014-06-17 11:15 ` Benjamin Herrenschmidt
2014-06-17 11:57 ` Gerd Hoffmann
2014-06-17 21:32 ` Benjamin Herrenschmidt [this message]
2014-06-17 22:12 ` Peter Maydell
2014-06-17 22:55 ` Benjamin Herrenschmidt
2014-06-17 23:05 ` Alexander Graf
2014-06-17 23:16 ` Benjamin Herrenschmidt
2014-06-18 11:18 ` Gerd Hoffmann
2014-06-18 13:03 ` Benjamin Herrenschmidt
2014-06-19 9:36 ` Gerd Hoffmann
2014-06-21 5:37 ` Benjamin Herrenschmidt
2014-06-22 2:10 ` Benjamin Herrenschmidt
2014-06-23 1:13 ` Benjamin Herrenschmidt
2014-06-30 11:14 ` Gerd Hoffmann
2014-06-30 12:32 ` Benjamin Herrenschmidt
2014-07-01 8:20 ` Gerd Hoffmann
2014-07-01 8:26 ` Alexander Graf
2014-07-01 8:31 ` Paolo Bonzini
2014-07-01 9:07 ` Gerd Hoffmann
2014-07-01 9:19 ` Paolo Bonzini
2014-07-01 11:15 ` Gerd Hoffmann
2014-07-01 11:23 ` Benjamin Herrenschmidt
2014-07-02 9:19 ` Benjamin Herrenschmidt
2014-07-02 9:21 ` Benjamin Herrenschmidt
2014-07-02 12:12 ` Gerd Hoffmann
2014-07-02 12:16 ` Benjamin Herrenschmidt
2014-07-06 2:19 ` Benjamin Herrenschmidt
2014-07-06 5:49 ` Benjamin Herrenschmidt
2014-07-06 6:46 ` Benjamin Herrenschmidt
2014-07-06 7:05 ` Benjamin Herrenschmidt
2014-07-06 7:22 ` Benjamin Herrenschmidt
2014-07-06 8:15 ` Benjamin Herrenschmidt
2014-07-06 10:13 ` Benjamin Herrenschmidt
2014-07-06 11:08 ` Alexander Graf
2014-07-06 11:13 ` Peter Maydell
2014-07-06 11:23 ` Benjamin Herrenschmidt
2014-07-06 13:09 ` Peter Maydell
2014-07-06 20:56 ` Benjamin Herrenschmidt
2014-07-07 0:08 ` Benjamin Herrenschmidt
2014-07-07 10:13 ` Gerd Hoffmann
2014-07-07 9:38 ` Gerd Hoffmann
2014-07-06 5:53 ` Benjamin Herrenschmidt
2014-07-01 12:06 ` Paolo Bonzini
2014-07-01 8:59 ` Gerd Hoffmann
2014-07-01 9:35 ` Benjamin Herrenschmidt
2014-07-01 9:33 ` Benjamin Herrenschmidt
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-all 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=1403040734.7661.173.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).