diff options
author | Mario Kleiner <[email protected]> | 2017-12-15 23:05:02 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-01-03 22:57:56 +0100 |
commit | 3f867d1299de17b77b45f953aea35aeb9c8e0980 (patch) | |
tree | e8d46d43ce0f51cd6f10d3f5395a9142b543905b /src | |
parent | 859ccd20967a6550ef45150ea4e6db4d56eca8e7 (diff) |
egl/wayland: Add Wayland shm swrast support for RGB10 winsys buffers.
Signed-off-by: Mario Kleiner <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index da46449c439..d221728ff2c 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -162,10 +162,14 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp, assert(dri2_dpy->wl_shm); if (conf->RedSize == 5) dri2_surf->format = WL_SHM_FORMAT_RGB565; - else if (conf->AlphaSize == 0) + else if (conf->RedSize == 8 && conf->AlphaSize == 0) dri2_surf->format = WL_SHM_FORMAT_XRGB8888; - else + else if (conf->RedSize == 8) dri2_surf->format = WL_SHM_FORMAT_ARGB8888; + else if (conf->RedSize == 10 && conf->AlphaSize == 0) + dri2_surf->format = WL_SHM_FORMAT_XRGB2101010; + else if (conf->RedSize == 10) + dri2_surf->format = WL_SHM_FORMAT_ARGB2101010; } dri2_surf->wl_queue = wl_display_create_queue(dri2_dpy->wl_dpy); @@ -1469,7 +1473,7 @@ dri2_wl_swrast_get_stride_for_format(int format, int w) { if (format == WL_SHM_FORMAT_RGB565) return 2 * w; - else /* ARGB8888 || XRGB8888 */ + else /* ARGB8888 || XRGB8888 || ARGB2101010 || XRGB2101010 */ return 4 * w; } @@ -1894,6 +1898,12 @@ shm_handle_format(void *data, struct wl_shm *shm, uint32_t format) struct dri2_egl_display *dri2_dpy = data; switch (format) { + case WL_SHM_FORMAT_ARGB2101010: + dri2_dpy->formats |= HAS_ARGB2101010; + break; + case WL_SHM_FORMAT_XRGB2101010: + dri2_dpy->formats |= HAS_XRGB2101010; + break; case WL_SHM_FORMAT_ARGB8888: dri2_dpy->formats |= HAS_ARGB8888; break; |