ui: make qemu_default_pixelformat() static inline
The function is a trivial wrapper around qemu_default_pixman_format() and qemu_pixelformat_from_pixman(), so make it static inline in qemu-pixman.h instead of a standalone function in console.c, allowing to be easily reused. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
Feb 23, 2026 at 12:29 UTC
842ef95b81f76b27fb9b7653872023a8ef9fdae9
3 files changed
+8
-9
include/ui/qemu-pixman.h
+8
@@ -73,6 +73,14 @@ typedef struct PixelFormat {
73
74
PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format);
75
pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian);
76
+
77
+static inline PixelFormat qemu_default_pixelformat(int bpp)
78
+{
79
+ pixman_format_code_t fmt = qemu_default_pixman_format(bpp, true);
80
+ PixelFormat pf = qemu_pixelformat_from_pixman(fmt);
81
+ return pf;
82
+}
83
+
84
pixman_format_code_t qemu_drm_format_to_pixman(uint32_t drm_format);
85
uint32_t qemu_pixman_to_drm_format(pixman_format_code_t pixman);
86
int qemu_pixman_get_type(int rshift, int gshift, int bshift, int endian);
include/ui/surface.h
-2
@@ -24,8 +24,6 @@ typedef struct DisplaySurface {
24
uint32_t share_handle_offset;
25
} DisplaySurface;
26
27
-PixelFormat qemu_default_pixelformat(int bpp);
28
-
27
DisplaySurface *qemu_create_displaysurface_from(int width, int height,
28
pixman_format_code_t format,
29
int linesize, uint8_t *data);
ui/console.c
-7
@@ -1390,13 +1390,6 @@ DisplaySurface *qemu_console_surface(QemuConsole *console)
1390
}
1391
}
1392
1393
-PixelFormat qemu_default_pixelformat(int bpp)
1394
-{
1395
- pixman_format_code_t fmt = qemu_default_pixman_format(bpp, true);
1396
- PixelFormat pf = qemu_pixelformat_from_pixman(fmt);
1397
- return pf;
1398
-}
1399
-
1393
static QemuDisplay *dpys[DISPLAY_TYPE__MAX];
1394
1395
void qemu_display_register(QemuDisplay *ui)