[weston v3 4/4] rpi: Add support for SHM buffers in RGB565 format

Tomeu Vizoso tomeu at tomeuvizoso.net
Tue Aug 6 11:05:57 PDT 2013


---
 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 4b89319..d3ffd4b 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 919ecc5..be520a6 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;
 }
 
-- 
1.8.3.1



More information about the wayland-devel mailing list