qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Dave Airlie <airlied@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file
Date: Thu, 25 Sep 2014 17:02:53 +0200	[thread overview]
Message-ID: <1411657373.7154.14.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <1411478887-15183-2-git-send-email-kraxel@redhat.com>

  Hi Dave,

Triggered by the framebuffer endian issues we have with stdvga I've
started to check where we stand with virtio-gpu and whenever we have to
fix something in the virtio protocol before setting in stone with the
upstream merge.

Fixed the protocol.  Basically s/uint32_t/__le32/g.  No changes on
x86_64 obviously.

Fixed the kernel driver to byteswap values when needed.  See
https://www.kraxel.org/cgit/linux/log/?h=virtio-gpu-rebase

Result is bigendian guest on little endian host boots fine (without
virgl).  Colors are wrong though.  Other way around still needs a bunch
of fixes in qemu so virtio-gpu works correctly on bigendian hosts.  To
be done.

So, on the color issue:  How are these defined exactly?

> +    VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM  = 1,
> +    VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM  = 2,
> +    VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM  = 3,
> +    VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM  = 4,

Looking at the code it seems the name defines the byte ordering in
memory, i.e. "B8G8R8A8" means blue first, then red, then green, then
alpha.  Or DRM_FORMAT_ARGB8888 on little endian / DRM_FORMAT_BGRX8888 on
big endian.  Correct?  Easy fix in the guest driver then ...

> +    VIRTIO_GPU_FORMAT_B5G5R5A1_UNORM  = 5,
> +    VIRTIO_GPU_FORMAT_B5G6R5_UNORM    = 7,

Do we really wanna go down this route?  I'm inclined to just zap 16bpp
support.

> +    VIRTIO_GPU_FORMAT_R8_UNORM        = 64,

What is this btw?  Looks like gray or alpha, but why "R8" not "G8" or
"A8" then?  Why the gap in the enumeration?

With the formats being clarified fixed we are settled for 2d mode I
think.

What about 3d mode?  We are passing blobs between virglrenderer and
guest driver:  capabilities and gallium 3d command stream.  What happens
to them in case host and guest endianness don't match?  I think at least
the capabilities have 32bit values which need to be swapped.  Dunno
about the gallium commands ...

cheers,
  Gerd

  reply	other threads:[~2014-09-25 15:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 13:27 [Qemu-devel] [PATCH 0/8] add virtio-gpu Gerd Hoffmann
2014-09-23 13:28 ` [Qemu-devel] [PATCH 1/8] virtio-gpu/2d: add hardware spec include file Gerd Hoffmann
2014-09-25 15:02   ` Gerd Hoffmann [this message]
2014-09-30  0:27     ` Dave Airlie
2014-09-30  7:54       ` Gerd Hoffmann
2014-09-30  7:55       ` Gerd Hoffmann
2014-10-03  4:38         ` Dave Airlie
2014-10-06  9:20           ` Gerd Hoffmann
2014-10-16  3:53             ` Dave Airlie
2014-10-16 12:18               ` Gerd Hoffmann
2014-10-15 10:05   ` Gerd Hoffmann
2014-10-16  3:55     ` Dave Airlie
2014-09-23 13:28 ` [Qemu-devel] [PATCH 2/8] virtio-gpu/2d: add virtio gpu core code Gerd Hoffmann
2014-09-23 13:28 ` [Qemu-devel] [PATCH 3/8] virtio-gpu-pci: add virtio pci support Gerd Hoffmann
2014-09-23 13:28 ` [Qemu-devel] [PATCH 4/8] virtio-vga: add virtio gpu device with vga compatibility Gerd Hoffmann
2014-09-23 13:28 ` [Qemu-devel] [PATCH 5/8] virtio-vga: add '-vga virtio' support Gerd Hoffmann
2014-09-23 13:28 ` [Qemu-devel] [PATCH 6/8] virtio-vga: add vgabios configuration Gerd Hoffmann
2014-09-23 13:28 ` [Qemu-devel] [PATCH 7/8] virtio-vga: add vgabios binary Gerd Hoffmann
2014-09-23 13:28 ` [Qemu-devel] [PATCH 8/8] virtio-gpu: add to display-vga test Gerd Hoffmann

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=1411657373.7154.14.camel@nilsson.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=airlied@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).