diff options
author | Mario Kleiner <[email protected]> | 2017-12-15 23:05:01 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-01-03 22:57:56 +0100 |
commit | 859ccd20967a6550ef45150ea4e6db4d56eca8e7 (patch) | |
tree | 38a6863a82538d16335c891c13205d293265f5df /src/egl/drivers/dri2/platform_wayland.c | |
parent | 84fd5151cd91cace771f88218dbed15001e150ab (diff) |
egl/wayland: Add Wayland dmabuf support for RGB10 winsys buffers. (v2)
Successfully tested under Weston 3.0.
Photometer confirms 10 rgb bits from rendering to display.
v2: Rebased onto master for dri2_teardown_wayland().
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/egl/drivers/dri2/platform_wayland.c')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 8b67a02e1b9..da46449c439 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -354,9 +354,13 @@ get_back_bo(struct dri2_egl_surface *dri2_surf) switch (dri2_surf->format) { case WL_DRM_FORMAT_ARGB2101010: dri_image_format = __DRI_IMAGE_FORMAT_ARGB2101010; + modifiers = u_vector_tail(&dri2_dpy->wl_modifiers.argb2101010); + num_modifiers = u_vector_length(&dri2_dpy->wl_modifiers.argb2101010); break; case WL_DRM_FORMAT_XRGB2101010: dri_image_format = __DRI_IMAGE_FORMAT_XRGB2101010; + modifiers = u_vector_tail(&dri2_dpy->wl_modifiers.xrgb2101010); + num_modifiers = u_vector_length(&dri2_dpy->wl_modifiers.xrgb2101010); break; case WL_DRM_FORMAT_ARGB8888: dri_image_format = __DRI_IMAGE_FORMAT_ARGB8888; @@ -1143,6 +1147,14 @@ dmabuf_handle_modifier(void *data, struct zwp_linux_dmabuf_v1 *dmabuf, return; switch (format) { + case WL_DRM_FORMAT_ARGB2101010: + mod = u_vector_add(&dri2_dpy->wl_modifiers.argb2101010); + dri2_dpy->formats |= HAS_ARGB2101010; + break; + case WL_DRM_FORMAT_XRGB2101010: + mod = u_vector_add(&dri2_dpy->wl_modifiers.xrgb2101010); + dri2_dpy->formats |= HAS_XRGB2101010; + break; case WL_DRM_FORMAT_ARGB8888: mod = u_vector_add(&dri2_dpy->wl_modifiers.argb8888); dri2_dpy->formats |= HAS_ARGB8888; @@ -1314,7 +1326,9 @@ dri2_initialize_wayland_drm(_EGLDriver *drv, _EGLDisplay *disp) dri2_dpy->wl_dpy = disp->PlatformDisplay; } - if (!u_vector_init(&dri2_dpy->wl_modifiers.xrgb8888, sizeof(uint64_t), 32) || + if (!u_vector_init(&dri2_dpy->wl_modifiers.xrgb2101010, sizeof(uint64_t), 32) || + !u_vector_init(&dri2_dpy->wl_modifiers.argb2101010, sizeof(uint64_t), 32) || + !u_vector_init(&dri2_dpy->wl_modifiers.xrgb8888, sizeof(uint64_t), 32) || !u_vector_init(&dri2_dpy->wl_modifiers.argb8888, sizeof(uint64_t), 32) || !u_vector_init(&dri2_dpy->wl_modifiers.rgb565, sizeof(uint64_t), 32)) { goto cleanup; @@ -2055,6 +2069,8 @@ dri2_teardown_wayland(struct dri2_egl_display *dri2_dpy) wl_event_queue_destroy(dri2_dpy->wl_queue); if (dri2_dpy->wl_dpy_wrapper) wl_proxy_wrapper_destroy(dri2_dpy->wl_dpy_wrapper); + u_vector_finish(&dri2_dpy->wl_modifiers.argb2101010); + u_vector_finish(&dri2_dpy->wl_modifiers.xrgb2101010); u_vector_finish(&dri2_dpy->wl_modifiers.argb8888); u_vector_finish(&dri2_dpy->wl_modifiers.xrgb8888); u_vector_finish(&dri2_dpy->wl_modifiers.rgb565); |