yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
169b9a
From b01048102e5cc91d484d23531799a130a49d723a Mon Sep 17 00:00:00 2001
169b9a
From: Tarun Gupta <tgupta@redhat.com>
169b9a
Date: Wed, 20 Jun 2018 18:54:16 +0200
169b9a
Subject: [PATCH 08/17] spice: fix simple display on bigendian hosts
169b9a
169b9a
RH-Author: Tarun Gupta <tgupta@redhat.com>
169b9a
Message-id: <1529520865-18127-3-git-send-email-tgupta@redhat.com>
169b9a
Patchwork-id: 80907
169b9a
O-Subject: [RHEL7.6 qemu-kvm PATCH v3 02/11] spice: fix simple display on bigendian hosts
169b9a
Bugzilla: 1555246
169b9a
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
169b9a
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
169b9a
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
169b9a
169b9a
Denis Kirjanov is busy getting spice run on ppc64 and trapped into this
169b9a
one.  Spice wire format is little endian, so we have to explicitly say
169b9a
we want little endian when letting pixman convert the data for us.
169b9a
169b9a
Reported-by: Denis Kirjanov <kirjanov@gmail.com>
169b9a
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
169b9a
169b9a
(cherry picked from c1d37cd353be3ea4c5773fc227ba8459c1f20470)
169b9a
169b9a
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
169b9a
---
169b9a
 include/ui/qemu-pixman.h | 2 ++
169b9a
 ui/spice-display.c       | 2 +-
169b9a
 2 files changed, 3 insertions(+), 1 deletion(-)
169b9a
169b9a
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
169b9a
index ba970f8..500725c 100644
169b9a
--- a/include/ui/qemu-pixman.h
169b9a
+++ b/include/ui/qemu-pixman.h
169b9a
@@ -27,8 +27,10 @@
169b9a
 
169b9a
 #ifdef HOST_WORDS_BIGENDIAN
169b9a
 # define PIXMAN_BE_r8g8b8     PIXMAN_r8g8b8
169b9a
+# define PIXMAN_LE_x8r8g8b8   PIXMAN_b8g8r8x8
169b9a
 #else
169b9a
 # define PIXMAN_BE_r8g8b8     PIXMAN_b8g8r8
169b9a
+# define PIXMAN_LE_x8r8g8b8   PIXMAN_x8r8g8b8
169b9a
 #endif
169b9a
 
169b9a
 /* -------------------------------------------------------------------- */
169b9a
diff --git a/ui/spice-display.c b/ui/spice-display.c
169b9a
index e2c24a9..8b73e5a 100644
169b9a
--- a/ui/spice-display.c
169b9a
+++ b/ui/spice-display.c
169b9a
@@ -178,7 +178,7 @@ static void qemu_spice_create_one_update(SimpleSpiceDisplay *ssd,
169b9a
     image->bitmap.palette = 0;
169b9a
     image->bitmap.format = SPICE_BITMAP_FMT_32BIT;
169b9a
 
169b9a
-    dest = pixman_image_create_bits(PIXMAN_x8r8g8b8, bw, bh,
169b9a
+    dest = pixman_image_create_bits(PIXMAN_LE_x8r8g8b8, bw, bh,
169b9a
                                     (void *)update->bitmap, bw * 4);
169b9a
     pixman_image_composite(PIXMAN_OP_SRC, ssd->surface, NULL, ssd->mirror,
169b9a
                            rect->left, rect->top, 0, 0,
169b9a
-- 
169b9a
1.8.3.1
169b9a