qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Big Endian qemu_pixelformat_from_pixman and qemu_default_pi


From: Valentin Manea
Subject: [Qemu-devel] Big Endian qemu_pixelformat_from_pixman and qemu_default_pixman_format
Date: Sun, 14 Sep 2014 22:08:40 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

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



reply via email to

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