rpi: Add support for SHM buffers in RGB565 format

dev
Tomeu Vizoso 12 years ago committed by Kristian Høgsberg
parent 1c1fc29cf1
commit 0368189bac
  1. 1
      src/rpi-bcm-stubs.h
  2. 4
      src/rpi-renderer.c

@ -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 */

@ -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;
}

Loading…
Cancel
Save