From 0368189baca8a724ef63788819a63714b507ceae Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 6 Aug 2013 20:05:57 +0200 Subject: [PATCH] rpi: Add support for SHM buffers in RGB565 format --- src/rpi-bcm-stubs.h | 1 + src/rpi-renderer.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/rpi-bcm-stubs.h b/src/rpi-bcm-stubs.h index 4b89319f..d3ffd4ba 100644 --- a/src/rpi-bcm-stubs.h +++ b/src/rpi-bcm-stubs.h @@ -85,6 +85,7 @@ typedef enum /* these are not the right values: */ VC_IMAGE_ARGB8888, VC_IMAGE_XRGB8888, + VC_IMAGE_RGB565, } VC_IMAGE_TYPE_T; /* from /opt/vc/include/interface/vmcs_host/vc_dispmanx_types.h */ diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c index 919ecc55..be520a6f 100644 --- a/src/rpi-renderer.c +++ b/src/rpi-renderer.c @@ -233,6 +233,8 @@ shm_buffer_get_vc_format(struct wl_shm_buffer *buffer) return VC_IMAGE_XRGB8888; case WL_SHM_FORMAT_ARGB8888: return VC_IMAGE_ARGB8888 | PREMULT_ALPHA_FLAG; + case WL_SHM_FORMAT_RGB565: + return VC_IMAGE_RGB565; default: /* invalid format */ return VC_IMAGE_MIN; @@ -1285,6 +1287,8 @@ rpi_renderer_create(struct weston_compositor *compositor, compositor->read_format = PIXMAN_a8r8g8b8; /* WESTON_CAP_ROTATION_ANY not supported */ + wl_display_add_shm_format(compositor->wl_display, WL_SHM_FORMAT_RGB565); + return 0; }