From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTFAM-0002oX-40 for qemu-devel@nongnu.org; Sun, 14 Sep 2014 15:09:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTFAD-0002j1-2k for qemu-devel@nongnu.org; Sun, 14 Sep 2014 15:08:54 -0400 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:34513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTFAC-0002iA-RD for qemu-devel@nongnu.org; Sun, 14 Sep 2014 15:08:45 -0400 Received: by mail-la0-f41.google.com with SMTP id s18so3511665lam.14 for ; Sun, 14 Sep 2014 12:08:43 -0700 (PDT) Message-ID: <5415E7B8.6070704@gmail.com> Date: Sun, 14 Sep 2014 22:08:40 +0300 From: Valentin Manea MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Big Endian qemu_pixelformat_from_pixman and qemu_default_pixman_format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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