[weston RFC 3/5] rpi: Add support for SHM buffers in RGB565 format

Tomeu Vizoso tomeu at tomeuvizoso.net
Fri Jul 5 02:41:14 PDT 2013


---
 src/rpi-bcm-stubs.h | 1 +
 src/rpi-renderer.c  | 3 +++
 2 files changed, 4 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 eb64675..533850a 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;
@@ -1273,6 +1275,7 @@ bind_shm(struct wl_client *client,
 
 	wl_shm_send_format(resource, WL_SHM_FORMAT_ARGB8888);
 	wl_shm_send_format(resource, WL_SHM_FORMAT_XRGB8888);
+	wl_shm_send_format(resource, WL_SHM_FORMAT_RGB565);
 }
 
 WL_EXPORT int
-- 
1.8.3.1



More information about the wayland-devel mailing list