qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Big Endian qemu_pixelformat_from_pixman and qemu_default_pixman_format
@ 2014-09-14 19:08 Valentin Manea
  2014-09-15  6:33 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Valentin Manea @ 2014-09-14 19:08 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel@nongnu.org, Jia Liu

Hi Gerd,

  I'm working on improving the OpenRISC support for QEMU and recently I got in
one problem with qemu_pixelformat_from_pixman(). It seems quite recently the
ui/console.c code has started using it for big endian as well but the new change
breaks my existing framebuffer patches.
  The problem is that for little endian 32bpp qemu_default_pixman_format() will
return PIXMAN_x8r8g8b8 but for big endian 32bpp it returns PIXMAN_b8g8r8a8:
pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian)
{
    if (native_endian) {
        switch (bpp) {
        case 15:
            return PIXMAN_x1r5g5b5;
        case 16:
            return PIXMAN_r5g6b5;
        case 24:
            return PIXMAN_r8g8b8;
        case 32:
            return PIXMAN_x8r8g8b8;
        }
    } else {
        switch (bpp) {
        case 24:
            return PIXMAN_b8g8r8;
        case 32:
            return PIXMAN_b8g8r8a8;
        break;
        }
    }

  I was wondering if there is any reason not to return PIXMAN_b8g8r8x8 also for
big endian? In the worst case scenario it would be compatible to the previous code.
  If you are OK, I would like to submit this patch:
diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
index 30c7fdd..1f6fea5 100644
--- a/ui/qemu-pixman.c
+++ b/ui/qemu-pixman.c
@@ -80,7 +80,7 @@ pixman_format_code_t qemu_default_pixman_format(int bpp, bool
native_endian)
         case 24:
             return PIXMAN_b8g8r8;
         case 32:
-            return PIXMAN_b8g8r8a8;
+            return PIXMAN_b8g8r8x8;
         break;
         }
     }


Thanks

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Big Endian qemu_pixelformat_from_pixman and qemu_default_pixman_format
  2014-09-14 19:08 [Qemu-devel] Big Endian qemu_pixelformat_from_pixman and qemu_default_pixman_format Valentin Manea
@ 2014-09-15  6:33 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2014-09-15  6:33 UTC (permalink / raw)
  To: Valentin Manea; +Cc: qemu-devel@nongnu.org, Jia Liu

On So, 2014-09-14 at 22:08 +0300, Valentin Manea wrote:
> Hi Gerd,
> 
>   I'm working on improving the OpenRISC support for QEMU and recently I got in
> one problem with qemu_pixelformat_from_pixman(). It seems quite recently the
> ui/console.c code has started using it for big endian as well but the new change
> breaks my existing framebuffer patches.

>   I was wondering if there is any reason not to return PIXMAN_b8g8r8x8 also for
> big endian? In the worst case scenario it would be compatible to the previous code.

It's a bug indeed (and it is the one which breaks ppc guest display on
x86_64 hosts with SDL).

>   If you are OK, I would like to submit this patch:
> diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
> index 30c7fdd..1f6fea5 100644
> --- a/ui/qemu-pixman.c
> +++ b/ui/qemu-pixman.c
> @@ -80,7 +80,7 @@ pixman_format_code_t qemu_default_pixman_format(int bpp, bool
> native_endian)
>          case 24:
>              return PIXMAN_b8g8r8;
>          case 32:
> -            return PIXMAN_b8g8r8a8;
> +            return PIXMAN_b8g8r8x8;
>          break;
>          }
>      }

Fix is correct.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-15  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-14 19:08 [Qemu-devel] Big Endian qemu_pixelformat_from_pixman and qemu_default_pixman_format Valentin Manea
2014-09-15  6:33 ` Gerd Hoffmann

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).