summary refs log tree commit diff stats
path: root/include/ui/console.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2014-06-18 11:03:15 +0200
committerGerd Hoffmann <kraxel@redhat.com>2014-09-05 13:27:11 +0200
commit30f1e661b640de58ba1e8178f7f2290179a7e01c (patch)
treedc373a0d374386bc793e67a9e185dbc5ecdfc8f1 /include/ui/console.h
parent56bd9ea1a37395012adecca8b9c4762da15b01e7 (diff)
downloadfocaccia-qemu-30f1e661b640de58ba1e8178f7f2290179a7e01c.tar.gz
focaccia-qemu-30f1e661b640de58ba1e8178f7f2290179a7e01c.zip
console: stop using PixelFormat
With this patch the qemu console core stops using PixelFormat and pixman
format codes side-by-side, pixman format code is the primary way to
specify the DisplaySurface format:

 * DisplaySurface stops carrying a PixelFormat field.
 * qemu_create_displaysurface_from() expects a pixman format now.

Functions to convert PixelFormat to pixman_format_code_t (and back)
exist for those who still use PixelFormat.   As PixelFormat allows
easy access to masks and shifts it will probably continue to exist.

[ xenfb added by Benjamin Herrenschmidt ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'include/ui/console.h')
-rw-r--r--include/ui/console.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/ui/console.h b/include/ui/console.h
index 845526ed01..68ac362f06 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -119,8 +119,6 @@ struct DisplaySurface {
     pixman_format_code_t format;
     pixman_image_t *image;
     uint8_t flags;
-
-    struct PixelFormat pf;
 };
 
 typedef struct QemuUIInfo {
@@ -188,9 +186,9 @@ struct DisplayChangeListener {
 };
 
 DisplayState *init_displaystate(void);
-DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,
-                                                int linesize, uint8_t *data,
-                                                bool byteswap);
+DisplaySurface *qemu_create_displaysurface_from(int width, int height,
+                                                pixman_format_code_t format,
+                                                int linesize, uint8_t *data);
 PixelFormat qemu_different_endianness_pixelformat(int bpp);
 PixelFormat qemu_default_pixelformat(int bpp);
 
@@ -199,10 +197,12 @@ void qemu_free_displaysurface(DisplaySurface *surface);
 
 static inline int is_surface_bgr(DisplaySurface *surface)
 {
-    if (surface->pf.bits_per_pixel == 32 && surface->pf.rshift == 0)
+    if (PIXMAN_FORMAT_BPP(surface->format) == 32 &&
+        PIXMAN_FORMAT_TYPE(surface->format) == PIXMAN_TYPE_ABGR) {
         return 1;
-    else
+    } else {
         return 0;
+    }
 }
 
 static inline int is_buffer_shared(DisplaySurface *surface)